changeset 343:9fe019fe7f5c

8168138: Fix failing testcases in javapackager test suite and other modifications mentioned in description Reviewed-by: cbensen
author rgangadhar
date Tue, 25 Oct 2016 09:14:58 +0530
parents bf6ae1d345ce
children 244c3a0749e0
files functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/AntBundlingManager.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/BundlingManager.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/Config.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/ConsoleBundlingManager.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/Constants.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/JavaApiBundlingManager.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/installers/AbstractBundlerUtils.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/installers/WinExeBundlerUtils.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/installers/WinMsiBundlerUtils.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/resources/icon.icns functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/resources/icon2.icns functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/AppBundlersSampleGUI.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/AppCDSAutoInstallTest.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/AppCDSCustomClassesTest.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/AppCDSInstallTest.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/AppCDSTest.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/InstallDirTest.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/JvmOptionsTest.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/LicenseFileTest.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/MacCodesignTest.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/ShortcutMenuHintsTest.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/TestBase.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/CheckExecutablesAvailableTest.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/JmodExplodedModuleAndModularJarDependencyTest.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleBundledWithAllModules.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleBundledWithMinimumModulesAnd3rdPartyJarsTest.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleBundledWithMinimumModulesAnd3rdPartyModulesTest.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleWithMinimumModulesTest.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/UnnamedModuleDependsOn3rdPartyModulesBundledWithEntireJreTest.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/ExplodedModuleParameters.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/GenericModuleParameters.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/JmodParameters.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/ModularJarParameters.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/NormalJarParameters.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/Parameters.java
diffstat 35 files changed, 366 insertions(+), 318 deletions(-) [+]
line wrap: on
line diff
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/AntBundlingManager.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/AntBundlingManager.java	Tue Oct 25 09:14:58 2016 +0530
@@ -90,6 +90,7 @@
             put(LIMIT_MODS, new Location("fx:runtime",""));
             put(MODULEPATH, new Location("fx:runtime",""));
             put(MAIN_MODULE, new Location("fx:application", MAIN_MODULE));
+            put(DUMMY_RELATIVE_FILESET, new Location("fx:resources", ""));
         }
     };
 
@@ -142,7 +143,7 @@
 
     @SuppressWarnings("unchecked")
     private void appendToFXDeploy(Document document, Element fxDeploy,
-            Map<String, Object> params) throws IOException {
+            Map<String, Object> params, boolean isSrcDirRequired) throws IOException {
         final Map<String, Element> ant = toAntEntry.values().stream()
                 .filter(location -> location != Location.DUMMY)
                 .map(location -> location.element).distinct().collect(Collectors
@@ -157,25 +158,28 @@
             if (location != null) {
                 Element parentEl = ant.get(location.element);
                 switch (key) {
-                case "appResources": {
-                    if(ExtensionType.NormalJar == extensionType) {
-                        RelativeFileSet relFileSet = (RelativeFileSet) value;
-                        Element e = document.createElement("fx:fileset");
-                        e.setAttribute("dir",
-                                relFileSet.getBaseDirectory().getAbsolutePath());
-                        e.setAttribute("includes", relFileSet.getIncludedFiles()
-                                .stream().collect(joining(",")));
-                        parentEl.appendChild(e);
+                case APP_RESOURCES: {
+                    if (ExtensionType.NormalJar == extensionType) {
+                        prepareSrcDirAndSrcFiles(document, value, parentEl);
+                    } else if (params.containsKey(DUMMY_RELATIVE_FILESET)
+                            && isSrcDirRequired) {
+                        prepareSrcDirAndSrcFilesForLicenseFileTest(document, value, parentEl);
+                    } else if(isSrcDirRequired) {
+                        prepareSrcDirAndSrcFiles(document, value, parentEl);
                     }
                     break;
                 }
-                case "appResourcesList":
+                case APP_RESOURCES_LIST:
                     break;
-                case "licenseFile": {
+                case LICENSE_FILE: {
                     String file = (String) value;
                     Element e = document.createElement("fx:fileset");
                     RelativeFileSet relFileSet = null;
-                    relFileSet = com.oracle.tools.packager.StandardBundlerParam.APP_RESOURCES.fetchFrom(params);
+                    if(ExtensionType.NormalJar == extensionType) {
+                        relFileSet = (RelativeFileSet) params.get(APP_RESOURCES);
+                    } else {
+                        relFileSet = (RelativeFileSet) params.get(DUMMY_RELATIVE_FILESET);
+                    }
                     e.setAttribute("dir",
                             relFileSet.getBaseDirectory().getAbsolutePath());
                     e.setAttribute("includes", file);
@@ -183,6 +187,12 @@
                     parentEl.appendChild(e);
                     break;
                 }
+
+                case DUMMY_RELATIVE_FILESET: {
+                    //do nothing it is handled in License
+                    break;
+                }
+
                 case "icon": {
                     File icon = (File) value;
                     Element e = document.createElement("fx:icon");
@@ -190,19 +200,19 @@
                     parentEl.appendChild(e);
                     break;
                 }
-                case "jvmOptions": {
+                case JVM_OPTIONS: {
                     createJvmOptionsEntries(document, parentEl, value);
                     break;
                 }
-                case "jvmProperties": {
+                case JVM_PROPERTIES: {
                     createJvmPropertiesEntries(document, parentEl, value);
                     break;
                 }
-                case "userJvmOptions": {
+                case USER_JVM_OPTIONS: {
                     createUserJvmOptionsEntries(document, parentEl, value);
                     break;
                 }
-                case "secondaryLaunchers": {
+                case SECONDARY_LAUNCHERS: {
                     List<Map<String, Object>> launchers = (List<Map<String, Object>>) value;
                     for (Map<String, Object> eachLauncher : launchers) {
                         Element launcherEl = document
@@ -212,22 +222,22 @@
                                 .entrySet()) {
 
                             switch (keyVal.getKey()) {
-                            case "jvmOptions": {
+                            case JVM_OPTIONS: {
                                 createJvmOptionsEntries(document, launcherEl,
                                         keyVal.getValue());
                                 break;
                             }
-                            case "jvmProperties": {
+                            case JVM_PROPERTIES: {
                                 createJvmPropertiesEntries(document, launcherEl,
                                         keyVal.getValue());
                                 break;
                             }
-                            case "userJvmOptions": {
+                            case USER_JVM_OPTIONS: {
                                 createUserJvmOptionsEntries(document,
                                         launcherEl, keyVal.getValue());
                                 break;
                             }
-                            case "arguments": {
+                            case ARGUMENTS: {
                                 createArgumentEntries(document, launcherEl,
                                         keyVal.getValue());
                                 break;
@@ -256,13 +266,13 @@
                     }
                     break;
                 }
-                case "runtime": {
+                case RUNTIME: {
                     RelativeFileSet relFileSet = (RelativeFileSet) value;
                     parentEl.setAttribute(location.attribute,
                             relFileSet.getBaseDirectory().getAbsolutePath());
                     break;
                 }
-                case "arguments": {
+                case ARGUMENTS: {
                     createArgumentEntries(document, parentEl, value);
                     break;
                 }
@@ -335,6 +345,28 @@
         }
     }
 
+    private void prepareSrcDirAndSrcFiles(Document document, Object value,
+            Element parentEl) {
+        RelativeFileSet relFileSet = (RelativeFileSet) value;
+        Element e = document.createElement("fx:fileset");
+        e.setAttribute("dir", relFileSet.getBaseDirectory()
+                .getAbsolutePath());
+        e.setAttribute("includes", relFileSet.getIncludedFiles()
+                .stream().collect(joining(",")));
+        parentEl.appendChild(e);
+    }
+
+    private void prepareSrcDirAndSrcFilesForLicenseFileTest(Document document, Object value,
+            Element parentEl) {
+        RelativeFileSet relFileSet = (RelativeFileSet) value;
+        Element e = document.createElement("fx:fileset");
+        e.setAttribute("dir",
+                relFileSet.getBaseDirectory().getAbsolutePath());
+        e.setAttribute("includes", relFileSet.getIncludedFiles()
+                .stream().collect(joining(",")));
+        parentEl.appendChild(e);
+    }
+
     @SuppressWarnings({ "unchecked", "rawtypes" })
     private String getValueAsString(Object value) {
         String actualValue = null;
@@ -358,8 +390,6 @@
         Element bundleArgument = document.createElement("fx:bundleArgument");
         String argValue = null;
         if ("mainJar".equals(argName)) {
-//            RelativeFileSet fileSet = (RelativeFileSet) value;
-//            argValue = fileSet.getIncludedFiles().iterator().next();
             argValue = (String) value;
         } else {
             checkValue(value);
@@ -425,7 +455,7 @@
     }
 
     private Element fxDeploy(Document document, Map<String, Object> params,
-            File file) throws IOException {
+            File file, boolean isSrcDirRequired) throws IOException {
         Element fxDeploy = document.createElement("fx:deploy");
         String bundleType = getBundler().getBundleType();
         fxDeploy.setAttribute("nativeBundles",
@@ -438,7 +468,7 @@
         fxDeploy.setAttribute("outdir", file.getAbsolutePath());
         fxDeploy.setAttribute("outfile", "test");
         fxDeploy.setAttribute("verbose", "true");
-        appendToFXDeploy(document, fxDeploy, params);
+        appendToFXDeploy(document, fxDeploy, params, isSrcDirRequired);
         return fxDeploy;
     }
 
@@ -460,7 +490,7 @@
             boolean isSrcDirRequired) throws IOException {
         try {
             Data data = createDocument();
-            Element fxDeploy = fxDeploy(data.document, params, file);
+            Element fxDeploy = fxDeploy(data.document, params, file, isSrcDirRequired);
             data.fxDeployTarget.appendChild(fxDeploy);
             Path buildXmlFile = Utils.getTempDir().resolve("build.xml");
             String buildXml = documentToXml(data.document);
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/BundlingManager.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/BundlingManager.java	Tue Oct 25 09:14:58 2016 +0530
@@ -55,7 +55,6 @@
     public Path execute(Map<String, Object> params, AppWrapper app)
             throws IOException {
         this.app = app;
-        LOG.log(Level.INFO, "Bundling with params: {0}.", params);
         Path bundlesDir = app.getBundlesDir();
         return execute(params, bundlesDir.toFile()).toPath();
     }
@@ -63,7 +62,6 @@
     public Path execute(Map<String, Object> params, AppWrapper app,
             boolean isSrcDirRequired) throws IOException {
         this.app = app;
-        LOG.log(Level.INFO, "Bundling with params: {0}.", params);
         Path bundlesDir = app.getBundlesDir();
         return execute(params, bundlesDir.toFile(), isSrcDirRequired).toPath();
     }
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/Config.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/Config.java	Tue Oct 25 09:14:58 2016 +0530
@@ -84,9 +84,9 @@
         if ("single-method".equals(System.getProperty("test-run-mode"))) {
             tryDefineInstallationPackageType();
             tryDefinePackagerInterface();
+            isJavaExtensionTypeDefined();
         }
         tryFilterManual();
-        isJavaExtensionTypeDefined();
     }
 
     private void tryFilterManual() {
@@ -113,7 +113,7 @@
                         BundlerUtils.class, eachInstallationType);
                 acceptedInstallationPackagerType.add(bundlerUtil);
             }
-            System.out.println("[Installation package type filter: "
+            System.out.println("[Filtered Installation-package-types: "
                     + acceptedInstallationPackagerType + "]");
         } catch (Throwable t) {
             System.out
@@ -132,9 +132,9 @@
                 BundlingManagers bundlingMgr = getEnumInstance(
                         BundlingManagers.class, eachBundlingMgr);
                 acceptedPackagerInterface.add(bundlingMgr);
-                System.out.println("[Packager interface filter: "
-                        + acceptedPackagerInterface + "]");
             }
+            System.out.println("[Filtered Packager-interfaces: "
+                    + acceptedPackagerInterface + "]");
         } catch (Throwable t) {
             System.out.println("[Packager interfaces won't be filtered]");
         }
@@ -153,9 +153,9 @@
                     ExtensionType extensionType = getEnumInstance(
                             ExtensionType.class, eachJavaExtension);
                     javaExtensionType.add(extensionType);
-                    System.out.println("[Filtered java extension type: "
-                            + javaExtensionString + "]");
                 }
+                System.out.println("[Filtered java-extension-types: "
+                        + javaExtensionType + "]");
             } else {
                 System.out.println("[Java Extension Type won't be Filtered]");
             }
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/ConsoleBundlingManager.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/ConsoleBundlingManager.java	Tue Oct 25 09:14:58 2016 +0530
@@ -15,8 +15,10 @@
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.concurrent.ExecutionException;
 
 import com.oracle.appbundlers.utils.installers.AbstractBundlerUtils;
@@ -111,7 +113,6 @@
             boolean isSrcDirRequired) throws IOException {
         try {
             List<String> command = command(file, toConsole(params, isSrcDirRequired));
-            System.out.println("execution command is " + command);
             ProcessOutput process = Utils.runCommand(command,
                     CONFIG_INSTANCE.getInstallTimeout());
             if (process.exitCode() != 0) {
@@ -168,45 +169,54 @@
             Object value = entry.getValue();
             RelativeFileSet fileSet;
             switch (key) {
-            case "appResources":
-                if(ExtensionType.NormalJar == extensionType || isSrcDirRequired) {
-                    fileSet = (RelativeFileSet) value;
-                    String path = fileSet.getBaseDirectory().getPath();
-                    key2Value.add(new Pair<>("-srcdir", Arrays.asList(path)));
-                    key2Value.add(
-                            new Pair<>("-srcfiles", fileSet.getIncludedFiles()));
+            case APP_RESOURCES:
+                if (ExtensionType.NormalJar == extensionType) {
+                    prepareSrcDirAndSrcFiles(key2Value, value);
+                } else if (params.containsKey(DUMMY_RELATIVE_FILESET)
+                        && isSrcDirRequired) {
+                    prepareSrcDirAndSrcFilesForLicenseFileTest(params,
+                            key2Value, value);
+                } else if (isSrcDirRequired) {
+                    prepareSrcDirAndSrcFiles(key2Value, value);
                 }
                 break;
-            case "jvmOptions":
+
+            case DUMMY_RELATIVE_FILESET:
+                /*
+                 * do nothing here
+                 * handled in prepareSrcDirAndSrcFiles(params, key2Value, value) method.
+                 */
+                break;
+
+            case JVM_OPTIONS:
                 Collection<String> col = (Collection<String>) value;
                 key2Value.add(new Pair<>(getMappedKeyAndCheck(key),
                         Arrays.asList(col.stream().collect(joining(" ")))));
                 break;
-            case "userJvmOptions":
+            case USER_JVM_OPTIONS:
                 key2Value.addAll(separateOptions(getMappedKeyAndCheck(key),
                         (Map<String, String>) value));
                 break;
-            case "jvmProperties":
+            case JVM_PROPERTIES:
                 key2Value.add(new Pair<>(getMappedKeyAndCheck(key),
                         collectOptions((Map<String, String>) value)));
                 break;
-            case "runtime":
+            case RUNTIME:
                 fileSet = (RelativeFileSet) value;
                 key2Value.add(new Pair<>(getMappedKeyAndCheck(key), Arrays
                         .asList(fileSet.getBaseDirectory().getAbsolutePath())));
                 break;
-            case "licenseFile":
+            case LICENSE_FILE:
                 String file = (String) value;
                 key2Value.add(new Pair<>(getMappedKeyAndCheck(key),
                         Arrays.asList(file)));
                 break;
-            case "installdirChooser":
+
+            case INSTALLDIR_CHOOSER:
                 key2Value.add(new Pair<>(getMappedKeyAndCheck(key),
                         new ArrayList<>(0)));
                 break;
-            case "mainJar":
-                // Use relative references
-//                fileSet = (RelativeFileSet) value;
+            case MAIN_JAR:
                 String jar = (String) value;
                 key2Value.add(new Pair<>(getMappedKeyAndCheck(key),
                         Arrays.asList(jar)));
@@ -224,8 +234,9 @@
                 key2Value.add(new Pair<>(getMappedKeyAndCheck(key),
                         new ArrayList<>(0)));
                 break;
-            case "appResourcesList":
+            case APP_RESOURCES_LIST:
                 break;
+
             default:
                 key2Value.add(new Pair<>(getMappedKeyAndCheck(key),
                         Arrays.asList(value.toString())));
@@ -234,6 +245,33 @@
         return key2Value;
     }
 
+    private void prepareSrcDirAndSrcFiles(
+            List<Pair<String, Collection<String>>> key2Value, Object value) {
+        RelativeFileSet fileSet = (RelativeFileSet) value;
+        String path = fileSet.getBaseDirectory().getPath();
+        key2Value.add(new Pair<>("-srcdir", Arrays.asList(path)));
+        key2Value.add(new Pair<>("-srcfiles", fileSet.getIncludedFiles()));
+    }
+
+    private void prepareSrcDirAndSrcFilesForLicenseFileTest(
+            Map<String, Object> params,
+            List<Pair<String, Collection<String>>> key2Value, Object value) {
+
+        List<String> actualSrcDirList = new ArrayList<String>();
+        Set<String> actualSrcFiles = new HashSet<>();
+
+        if (params.containsKey(DUMMY_RELATIVE_FILESET)) {
+            RelativeFileSet dummyRelativeFileSet = (RelativeFileSet) params
+                    .get(DUMMY_RELATIVE_FILESET);
+            actualSrcDirList
+                    .add(dummyRelativeFileSet.getBaseDirectory().getPath());
+            actualSrcFiles.addAll(dummyRelativeFileSet.getIncludedFiles());
+        }
+
+        key2Value.add(new Pair<>("-srcdir", actualSrcDirList));
+        key2Value.add(new Pair<>("-srcfiles", actualSrcFiles));
+    }
+
     private List<Pair<String, Collection<String>>> separateOptions(String key,
             Map<String, String> value) {
         List<Pair<String, Collection<String>>> result = new ArrayList<>();
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/Constants.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/Constants.java	Tue Oct 25 09:14:58 2016 +0530
@@ -156,5 +156,6 @@
     String RUNTIME = "runtime";
     String MODULE_INFO_DOT_JAVA = "module-info.java";
     String ADD_EXPORTS = "add-exports";
+    String DUMMY_RELATIVE_FILESET="dummy_relative_fileset";
 
 }
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/JavaApiBundlingManager.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/JavaApiBundlingManager.java	Tue Oct 25 09:14:58 2016 +0530
@@ -12,7 +12,6 @@
 
 import com.oracle.appbundlers.utils.installers.AbstractBundlerUtils;
 import com.oracle.tools.packager.ConfigException;
-import com.oracle.tools.packager.RelativeFileSet;
 import com.oracle.tools.packager.UnsupportedPlatformException;
 
 /**
@@ -45,14 +44,7 @@
     @Override
     public File execute(Map<String, Object> params, File file,
             boolean isSrcDirRequired) throws IOException {
-
-        if(ExtensionType.NormalJar == extensionType || isSrcDirRequired) {
-            Object object = params.get("appResources");
-            RelativeFileSet fileSet = (RelativeFileSet) object;
-            String srcDirPath = fileSet.getBaseDirectory().getPath();
-            params.put("srcdir", srcDirPath);
-            LOG.log(Level.INFO, "Bundling with params after adding srcdir to params: {0}.", params);
-        }
+        LOG.log(Level.INFO, "Params before passing are {0}", params);
         return getBundler().execute(params, file);
     }
 }
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/installers/AbstractBundlerUtils.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/installers/AbstractBundlerUtils.java	Tue Oct 25 09:14:58 2016 +0530
@@ -223,61 +223,44 @@
                     @SuppressWarnings("unchecked")
 
                     Pair<String, String> params = (Pair<String, String>) value;
-                    String appName = params.getKey();
                     String secondAppName = params.getValue();
 
-                    // Unless we use -Xbootclasspath the following code will
-                    // check that both applications use the same rt.jar
-                    // which implies that they both use the same JRE.
                     try {
-                        ProcessOutput process = runInstalledExecutable(app,
+                        ProcessOutput processOutput = runInstalledExecutable(app,
                                 applicationTitle);
-                        final String sunBootClasspath = "sun.boot.class.path";
-                        Optional<String> maybePath = process.getOutputStream()
+                        final String openedText = "[info][class,load] opened:";
+                        Optional<String> maybePath = processOutput.getOutputStream()
                                 .stream()
-                                .filter(s -> s.contains(sunBootClasspath))
+                                .filter(s -> s.contains(openedText))
                                 .findFirst();
-                        String path = maybePath.orElseThrow(Exception::new)
-                                .split("=")[1];
-                        String[] pathElements = path.split(File.pathSeparator);
+                        String[] firstAppVerboseOutput = maybePath.orElseThrow(Exception::new)
+                                .split("opened:");
 
-                        Optional<String> maybeRtJar = Stream.of(pathElements)
-                                .filter(s -> s
-                                        .contains(File.separator + "rt.jar"))
-                                .findFirst();
-                        Path rtJar = Paths
-                                .get(maybeRtJar.orElseThrow(Exception::new))
-                                .toAbsolutePath();
                         Path root = getInstalledAppRootLocation(app,
                                 applicationTitle).toAbsolutePath();
 
-                        assertTrue(rtJar.startsWith(root), String.format(
-                                "[%s does not start with %s]", rtJar, rtJar));
+                        String firstAppJdk9ModulesPath = firstAppVerboseOutput[1].trim();
+                        assertTrue(firstAppJdk9ModulesPath.startsWith(root.toString()), String.format(
+                                "[%s does not start with %s]", firstAppJdk9ModulesPath, firstAppJdk9ModulesPath));
 
-                        process = Utils.runCommand(
+                        ProcessOutput secondAppProcessOutput = Utils.runCommand(
                                 new String[] {
                                         getInstalledExecutableLocation(app,
                                                 applicationTitle, secondAppName)
                                                         .toString() },
-                                /* verbose = */ true,
+                                true,
                                 CONFIG_INSTANCE.getRunTimeout());
 
-                        maybePath = process.getOutputStream().stream()
-                                .filter(s -> s.contains(sunBootClasspath))
+                        Optional<String> secondMaybePath = secondAppProcessOutput.getOutputStream()
+                                .stream()
+                                .filter(s -> s.contains(openedText))
                                 .findFirst();
-                        path = maybePath.orElseThrow(Exception::new)
-                                .split("=")[1];
-                        pathElements = path.split(File.pathSeparator);
+                        String[] secondAppVerboseOutput = secondMaybePath.orElseThrow(Exception::new)
+                                .split("opened:");
 
-                        maybeRtJar = Stream.of(pathElements)
-                                .filter(s -> s
-                                        .contains(File.separator + "rt.jar"))
-                                .findFirst();
-                        Path rtJarSecond = Paths
-                                .get(maybeRtJar.orElseThrow(Exception::new))
-                                .toAbsolutePath();
+                        String secondAppJdk9ModulesPath = secondAppVerboseOutput[1].trim();
 
-                        assertEquals(rtJar, rtJarSecond,
+                        assertEquals(firstAppJdk9ModulesPath, secondAppJdk9ModulesPath,
                                 "[Second app uses different java location]");
 
                     } catch (Exception e) {
@@ -565,6 +548,27 @@
         return result.get();
     }
 
+    protected Path findByExtension(Path dir, String extension, int maxDepth,
+            String applicationTitle) throws IOException {
+        Optional<Path> result = Files
+                .find(dir, maxDepth,
+                        (file, attr) -> file.toFile().getName().startsWith(
+                                applicationTitle)
+                        && file.toFile().getName().endsWith("." + extension))
+                .findFirst();
+
+        if (!result.isPresent()) {
+            result = Files.find(dir, maxDepth, (file, attr) -> file.toFile()
+                    .getName().endsWith("." + extension)).findFirst();
+        }
+
+        if (!result.isPresent()) {
+            throw new FileNotFoundException("*." + extension
+                    + " not found under " + dir + " with maxDepth=" + maxDepth);
+        }
+        return result.get();
+    }
+
     protected List<String> getLinesFromOptions(Map<String, String> opts) {
         return opts.keySet().stream().map(key -> key + opts.get(key))
                 .collect(toList());
@@ -583,4 +587,5 @@
     public abstract Path getJavaExecutableBinPathInInstalledApp(AppWrapper appWrapper, String appTitle);
 
     public abstract String getJavaExecutable();
+
 }
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/installers/WinExeBundlerUtils.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/installers/WinExeBundlerUtils.java	Tue Oct 25 09:14:58 2016 +0530
@@ -139,7 +139,7 @@
     public String install(AppWrapper app, String applicationTitle)
             throws IOException {
         String exePath = findByExtension(app.getBundlesDir(), "exe",
-                ROOT_DIRECTORY_DEPTH).toString();
+                ROOT_DIRECTORY_DEPTH, applicationTitle).toString();
         try {
             LOG.log(Level.INFO, "Installing {0}.", exePath);
             String[] cmd = new String[] { exePath, "/VERYSILENT" };
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/installers/WinMsiBundlerUtils.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/installers/WinMsiBundlerUtils.java	Tue Oct 25 09:14:58 2016 +0530
@@ -98,7 +98,7 @@
     public String install(AppWrapper app, String applicationTitle)
             throws IOException {
         String msiPath = findByExtension(app.getBundlesDir(), "msi",
-                ROOT_DIRECTORY_DEPTH).toString();
+                ROOT_DIRECTORY_DEPTH, applicationTitle).toString();
         try {
             LOG.log(Level.INFO, "Installing {0}.", msiPath);
             String[] cmd = new String[] { "msiexec.exe", "/i", msiPath,
@@ -115,7 +115,7 @@
     public void uninstall(AppWrapper app, String applicationTitle)
             throws IOException {
         Path msiPath = findByExtension(app.getBundlesDir(), "msi",
-                ROOT_DIRECTORY_DEPTH);
+                ROOT_DIRECTORY_DEPTH, applicationTitle);
         String msiPath1 = msiPath.toString();
         try {
             LOG.log(Level.INFO, "Uninstalling {0}.", msiPath);
Binary file functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/resources/icon.icns has changed
Binary file functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/resources/icon2.icns has changed
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/AppBundlersSampleGUI.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/AppBundlersSampleGUI.java	Tue Oct 25 09:14:58 2016 +0530
@@ -134,8 +134,8 @@
         Map<String, Object> basicParams = null;
         Map<String, Object> additionalParams = null;
         try {
-            basicParams = parameters.getBasicParams();
-            additionalParams = parameters.getAdditionalParams();
+            basicParams = parameters.createNewBasicParams();
+            additionalParams = parameters.createNewAdditionalParams();
         } catch (Exception exp) {
             exp.printStackTrace();
         }
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/AppCDSAutoInstallTest.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/AppCDSAutoInstallTest.java	Tue Oct 25 09:14:58 2016 +0530
@@ -22,10 +22,12 @@
 import java.util.concurrent.ExecutionException;
 
 import org.testng.annotations.AfterMethod;
+import org.testng.annotations.Test;
 
 import com.oracle.appbundlers.tests.functionality.functionalinterface.AdditionalParams;
 import com.oracle.appbundlers.tests.functionality.functionalinterface.VerifiedOptions;
 import com.oracle.appbundlers.utils.BundlerUtils;
+import com.oracle.appbundlers.utils.BundlingManager;
 import com.oracle.appbundlers.utils.ExtensionType;
 import com.oracle.appbundlers.utils.Utils;
 
@@ -83,4 +85,13 @@
         this.currentParameter.setAdditionalParams(getAdditionalParams(extension));
         this.currentParameter.setVerifiedOptions(getVerifiedOptions());
     }
+
+    /*
+     * SKIPPING APPCDS TEST CASES UNTIL https://bugs.openjdk.java.net/browse/JDK-8167657 is fixed.
+     */
+    @Override
+    @Test(dataProvider = "getBundlers", enabled=false)
+    public void runTest(BundlingManager bundlingManager) throws Exception {
+        super.runTest(bundlingManager);
+    }
 }
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/AppCDSCustomClassesTest.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/AppCDSCustomClassesTest.java	Tue Oct 25 09:14:58 2016 +0530
@@ -18,9 +18,11 @@
 import java.util.concurrent.ExecutionException;
 
 import org.testng.annotations.AfterMethod;
+import org.testng.annotations.Test;
 
 import com.oracle.appbundlers.tests.functionality.functionalinterface.AdditionalParams;
 import com.oracle.appbundlers.tests.functionality.functionalinterface.VerifiedOptions;
+import com.oracle.appbundlers.utils.BundlingManager;
 import com.oracle.appbundlers.utils.ExtensionType;
 import com.oracle.appbundlers.utils.Utils;
 
@@ -79,4 +81,13 @@
         this.currentParameter.setAdditionalParams(getAdditionalParams(extension));
         this.currentParameter.setVerifiedOptions(getVerifiedOptions());
     }
+
+    /*
+     * SKIPPING APPCDS TEST CASES UNTIL https://bugs.openjdk.java.net/browse/JDK-8167657 is fixed.
+     */
+    @Override
+    @Test(dataProvider = "getBundlers", enabled=false)
+    public void runTest(BundlingManager bundlingManager) throws Exception {
+        super.runTest(bundlingManager);
+    }
 }
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/AppCDSInstallTest.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/AppCDSInstallTest.java	Tue Oct 25 09:14:58 2016 +0530
@@ -24,10 +24,12 @@
 import java.util.concurrent.ExecutionException;
 
 import org.testng.annotations.AfterMethod;
+import org.testng.annotations.Test;
 
 import com.oracle.appbundlers.tests.functionality.functionalinterface.AdditionalParams;
 import com.oracle.appbundlers.tests.functionality.functionalinterface.VerifiedOptions;
 import com.oracle.appbundlers.utils.BundlerUtils;
+import com.oracle.appbundlers.utils.BundlingManager;
 import com.oracle.appbundlers.utils.ExtensionType;
 import com.oracle.appbundlers.utils.Utils;
 
@@ -80,4 +82,13 @@
         this.currentParameter.setAdditionalParams(getAdditionalParams(extension));
         this.currentParameter.setVerifiedOptions(getVerifiedOptions());
     }
+
+    /*
+     * SKIPPING APPCDS TEST CASES UNTIL https://bugs.openjdk.java.net/browse/JDK-8167657 is fixed.
+     */
+    @Override
+    @Test(dataProvider = "getBundlers", enabled=false)
+    public void runTest(BundlingManager bundlingManager) throws Exception {
+        super.runTest(bundlingManager);
+    }
 }
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/AppCDSTest.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/AppCDSTest.java	Tue Oct 25 09:14:58 2016 +0530
@@ -14,9 +14,11 @@
 import java.util.concurrent.ExecutionException;
 
 import org.testng.annotations.AfterMethod;
+import org.testng.annotations.Test;
 
 import com.oracle.appbundlers.tests.functionality.functionalinterface.AdditionalParams;
 import com.oracle.appbundlers.tests.functionality.functionalinterface.VerifiedOptions;
+import com.oracle.appbundlers.utils.BundlingManager;
 import com.oracle.appbundlers.utils.ExtensionType;
 import com.oracle.appbundlers.utils.Utils;
 
@@ -63,4 +65,13 @@
         this.currentParameter.setAdditionalParams(getAdditionalParams(extensionType));
         this.currentParameter.setVerifiedOptions(getVerifiedOptions());
     }
+
+    /*
+     * SKIPPING APPCDS TEST CASES UNTIL https://bugs.openjdk.java.net/browse/JDK-8167657 is fixed.
+     */
+    @Override
+    @Test(dataProvider = "getBundlers", enabled=false)
+    public void runTest(BundlingManager bundlingManager) throws Exception {
+        super.runTest(bundlingManager);
+    }
 }
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/InstallDirTest.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/InstallDirTest.java	Tue Oct 25 09:14:58 2016 +0530
@@ -46,7 +46,7 @@
         return () -> {
             Map<String, Object> additionalParams = new HashMap<>();
             RelativeFileSet existingRelativeFileSet = (RelativeFileSet) this.currentParameter
-                    .getBasicParams().get(APP_RESOURCES);
+                    .getBasicParamsMap().get(APP_RESOURCES);
             if (existingRelativeFileSet == null) {
                 RelativeFileSet newRelativeFileSet = this.currentParameter
                         .getApp().getNewRelativeFileSetBasedOnExtension(extension);
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/JvmOptionsTest.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/JvmOptionsTest.java	Tue Oct 25 09:14:58 2016 +0530
@@ -6,7 +6,6 @@
 package com.oracle.appbundlers.tests.functionality;
 
 import static com.oracle.appbundlers.utils.installers.AbstractBundlerUtils.MULTI_OUTPUT_CONTAINS;
-import static java.util.stream.Collectors.toList;
 
 import java.io.IOException;
 import java.util.Arrays;
@@ -21,7 +20,6 @@
 /**
  * @author Dmitry Ginzburg &lt;dmitry.x.ginzburg@oracle.com&gt;
  * @author Dmitry Zinkevich &lt;dmitry.zinkevich@oracle.com&gt;
- * @TODO: test needs to be modified.
  */
 
 /**
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/LicenseFileTest.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/LicenseFileTest.java	Tue Oct 25 09:14:58 2016 +0530
@@ -12,19 +12,26 @@
 import static com.oracle.appbundlers.utils.Config.CONFIG_INSTANCE;
 import static com.oracle.appbundlers.utils.Config.LICENSE_FILE_NAME;
 
+import java.io.File;
 import java.io.IOException;
+import java.nio.file.DirectoryStream;
 import java.nio.file.Files;
 import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 import com.oracle.appbundlers.tests.functionality.functionalinterface.AdditionalParams;
 import com.oracle.appbundlers.tests.functionality.functionalinterface.VerifiedOptions;
 import com.oracle.appbundlers.utils.BundlerUtils;
 import com.oracle.appbundlers.utils.BundlingManager;
 import com.oracle.appbundlers.utils.ExtensionType;
+import com.oracle.appbundlers.utils.JavaApiBundlingManager;
+import com.oracle.appbundlers.utils.Utils;
 import com.oracle.tools.packager.RelativeFileSet;
-import com.sun.javafx.tools.packager.bundlers.BundleParams;
 
 /**
  * @author Dmitry Ginzburg &lt;dmitry.x.ginzburg@oracle.com&gt;
@@ -33,14 +40,12 @@
 
 /**
  * Tests {@code licenseFile} option
+ *
  */
 public class LicenseFileTest extends TestBase {
     private String licenseFileContent;
-    private Path licenseFileSrc;
-
-    public void initializeVars() throws IOException {
-        licenseFileSrc = CONFIG_INSTANCE.getResourceFilePath(LICENSE_FILE_NAME);
-    }
+    private Path licenseFileSrcInSuite;
+    private Path licenseFolder;
 
     @Override
     protected BundlerUtils[] getBundlerUtils() {
@@ -51,19 +56,28 @@
             throws IOException {
         return () -> {
             Map<String, Object> additionalParams = new HashMap<>();
+            RelativeFileSet appResources = (RelativeFileSet) this.currentParameter
+                    .getBasicParamsMap().get(APP_RESOURCES);
+            if (extension == ExtensionType.NormalJar) {
+                appResources.getIncludedFiles().add(LICENSE_FILE_NAME);
+            } else {
+                List<RelativeFileSet> appResourcesList = new ArrayList<RelativeFileSet>();
+                appResourcesList.add(appResources);
+                List<Path> licenses = new ArrayList<>();
+                try (DirectoryStream<Path> licenseFileStream = Files
+                        .newDirectoryStream(Paths.get(licenseFolder.toString()),
+                                "*")) {
+                    licenseFileStream.forEach(licenses::add);
+                }
 
-            RelativeFileSet existingRelativeFileSet = (RelativeFileSet) this.currentParameter
-                    .getBasicParams().get(APP_RESOURCES);
-            if (existingRelativeFileSet == null) {
-                existingRelativeFileSet = this.currentParameter
-                        .getApp().getNewRelativeFileSetBasedOnExtension(extension);
-                existingRelativeFileSet.getIncludedFiles().add(LICENSE_FILE_NAME);
-                additionalParams.put(APP_RESOURCES, existingRelativeFileSet);
-            } else {
-                existingRelativeFileSet.getIncludedFiles()
-                        .add(LICENSE_FILE_NAME);
+                RelativeFileSet licenseAppResource = new RelativeFileSet(
+                        new File(licenseFolder.toString()), licenses.stream()
+                                .map(Path::toFile).collect(Collectors.toSet()));
+                appResourcesList.add(licenseAppResource);
+                additionalParams.put(APP_RESOURCES_LIST, appResourcesList);
+                additionalParams.put(DUMMY_RELATIVE_FILESET,
+                        licenseAppResource);
             }
-            additionalParams.put(BundleParams.PARAM_APP_RESOURCES, existingRelativeFileSet);
             additionalParams.put(LICENSE_FILE, LICENSE_FILE_NAME);
             return additionalParams;
         };
@@ -79,7 +93,7 @@
 
     @Override
     protected void prepareTestEnvironment() throws Exception {
-        Path licenseFile = null;
+        Path licenseFileInTestAppFolder = null;
         for (ExtensionType extension : getExtensionArray()) {
             if (!isTestCaseApplicableForExtensionType(extension)) {
                 continue;
@@ -88,13 +102,20 @@
                     .get(extension);
             overrideParameters(extension);
             initializeAndPrepareApp();
-            licenseFile = this.currentParameter.getApp()
-                    .getJavaExtensionDirPathBasedonExtension(extension)
-                    .resolve(LICENSE_FILE_NAME);
-            initializeVars();
-            Files.copy(licenseFileSrc, licenseFile);
-            licenseFileContent = new String(Files.readAllBytes(licenseFile),
+            licenseFileSrcInSuite = CONFIG_INSTANCE.getResourceFilePath(LICENSE_FILE_NAME);
+            licenseFileContent = new String(Files.readAllBytes(licenseFileSrcInSuite),
                     "UTF-8");
+
+            if(extension == ExtensionType.NormalJar) {
+                licenseFolder = this.currentParameter.getApp().getJarDir();
+            } else {
+                licenseFolder = this.currentParameter.getApp().getWorkDir()
+                        .resolve("license");
+                Utils.createDir(licenseFolder);
+            }
+
+            licenseFileInTestAppFolder = licenseFolder.resolve(LICENSE_FILE_NAME);
+            Files.copy(licenseFileSrcInSuite, licenseFileInTestAppFolder);
         }
     }
 
@@ -107,7 +128,20 @@
 
     @Override
     protected void executeJavaPackager(BundlingManager bundlingManager,
-            Map<String, Object> allParams) throws IOException {
+            Map<String, Object> allParams, ExtensionType extension) throws IOException {
+
+        if (bundlingManager instanceof JavaApiBundlingManager) {
+            if (allParams.containsKey(DUMMY_RELATIVE_FILESET)
+                    && (extension != ExtensionType.NormalJar)) {
+                RelativeFileSet dummyRelativeFileSet = (RelativeFileSet) allParams
+                        .get(DUMMY_RELATIVE_FILESET);
+                allParams.put("srcdir",
+                        dummyRelativeFileSet.getBaseDirectory().getPath());
+                allParams.put("srcfiles",
+                        dummyRelativeFileSet.getIncludedFiles());
+                allParams.remove(DUMMY_RELATIVE_FILESET);
+            }
+        }
         bundlingManager.execute(allParams, this.currentParameter.getApp(), true);
     }
-}
\ No newline at end of file
+}
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/MacCodesignTest.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/MacCodesignTest.java	Tue Oct 25 09:14:58 2016 +0530
@@ -38,7 +38,7 @@
         // creating fake certificates
         if (Utils.isMacOS()) {
             Map<String, Object> basicParams = this.currentParameter
-                    .getBasicParams();
+                    .createNewBasicParams();
             File certsDir = new File(
                     CONFIG_INSTANCE.getResourceDir() + "/certs");
             certsDir.mkdir();
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/ShortcutMenuHintsTest.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/ShortcutMenuHintsTest.java	Tue Oct 25 09:14:58 2016 +0530
@@ -16,6 +16,7 @@
 import com.oracle.appbundlers.tests.functionality.functionalinterface.VerifiedOptions;
 import com.oracle.appbundlers.utils.BundlerUtils;
 import com.oracle.appbundlers.utils.ExtensionType;
+import com.oracle.tools.packager.StandardBundlerParam;
 
 /**
  * @author Dmitry Ginzburg &lt;dmitry.x.ginzburg@oracle.com&gt;
@@ -33,7 +34,7 @@
  * </ul>
  */
 public class ShortcutMenuHintsTest extends TestBase {
-    private static final String VENDOR_NAME = "SQE_TEST";
+    private static final String VENDOR_NAME = "SHORTCUT_MENU_HINT_TEST";
 
     @Override
     protected BundlerUtils[] getBundlerUtils() {
@@ -46,9 +47,9 @@
     public AdditionalParams getAdditionalParams() {
         return () -> {
             Map<String, Object> additionalParams = new HashMap<>();
-            additionalParams.put(VENDOR, VENDOR_NAME);
-            additionalParams.put(SHORTCUT_HINT, true);
-            additionalParams.put(MENU_HINT, true);
+            additionalParams.put(StandardBundlerParam.VENDOR.getID(), VENDOR_NAME);
+            additionalParams.put(StandardBundlerParam.SHORTCUT_HINT.getID(), true);
+            additionalParams.put(StandardBundlerParam.MENU_HINT.getID(), true);
             return additionalParams;
         };
     }
@@ -56,8 +57,8 @@
     public VerifiedOptions getVerifiedOptions() {
         return () -> {
             Map<String, Object> verifiedOptions = new HashMap<>();
-            verifiedOptions.put(MENU_HINT, VENDOR_NAME);
-            verifiedOptions.put(SHORTCUT_HINT, null);
+            verifiedOptions.put(StandardBundlerParam.MENU_HINT.getID(), VENDOR_NAME);
+            verifiedOptions.put(StandardBundlerParam.SHORTCUT_HINT.getID(), null);
             return verifiedOptions;
         };
     }
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/TestBase.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/TestBase.java	Tue Oct 25 09:14:58 2016 +0530
@@ -206,8 +206,7 @@
         }
 
         try {
-            LOG.log(Level.INFO,"Parameters before passing to execute method {0}", allParams);
-            executeJavaPackager(bundlingManager, allParams);
+            executeJavaPackager(bundlingManager, allParams, bundlingManager.getExtensionType());
             String path = bundlingManager.install(
                     this.currentParameter.getApp(), getResultingAppName(),
                     false);
@@ -216,7 +215,7 @@
             Pair<TimeUnit, Integer> tuple = getDelayAfterInstall();
             tuple.getKey().sleep(tuple.getValue());
             AppWrapper app2 = this.currentParameter.getApp();
-            this.currentParameter.getVerifiedOptions()
+            this.currentParameter.createNewVerifiedOptions()
                     .forEach((name, value) -> bundlingManager.verifyOption(name,
                             value, app2, getResultingAppName()));
         } finally {
@@ -226,7 +225,7 @@
     }
 
     protected void executeJavaPackager(BundlingManager bundlingManager,
-            Map<String, Object> allParams) throws IOException {
+            Map<String, Object> allParams, ExtensionType extension) throws IOException {
         bundlingManager.execute(allParams, this.currentParameter.getApp());
     }
 
@@ -244,6 +243,7 @@
     protected void uninstallApp() throws Exception {
         if (this.bundlingManager != null) {
             String appName = this.bundlingManager.getAppName(getAllParams());
+            LOG.log(Level.INFO, "App Name in uninstallApp is {0}", appName);
             this.bundlingManager.uninstall(this.currentParameter.getApp(), appName);
         }
     }
@@ -262,7 +262,11 @@
                 }
             }
         } else {
-            LOG.log(Level.INFO, "SKIPPED cleaning temporary files and bundles directory");
+            for (Parameters parameters : intermediateToParametersMap.values()) {
+                if(parameters.getApp() != null && parameters.getApp().getWorkDir() != null) {
+                    LOG.log(Level.INFO, "Skipped Removing Directory {0} ",parameters.getApp().getWorkDir());
+                }
+            }
         }
     }
 
@@ -311,19 +315,19 @@
 
     protected Map<String, Object> getAllParams() throws Exception {
         Map<String, Object> basicParams = this.currentParameter
-                .getBasicParams();
+                .createNewBasicParams();
         LOG.log(Level.INFO, "Basic Parameters are {0}", basicParams);
         Map<String, Object> allParams = new HashMap<String, Object>();
         allParams.put(APP_NAME, getResultingAppName());
         allParams.putAll(basicParams);
-        Map<String, Object> additionalParams = this.currentParameter.getAdditionalParams();
+        Map<String, Object> additionalParams = this.currentParameter.createNewAdditionalParams();
         LOG.log(Level.INFO, "Additional Parameters are {0}", additionalParams);
         allParams.putAll(additionalParams);
         return allParams;
     }
 
     public void validate() throws Exception {
-        this.bundlingManager.validate(this.currentParameter.getBasicParams());
+        this.bundlingManager.validate(this.currentParameter.createNewBasicParams());
     }
 
     public Parameters getParameters() {
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/CheckExecutablesAvailableTest.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/CheckExecutablesAvailableTest.java	Tue Oct 25 09:14:58 2016 +0530
@@ -38,11 +38,9 @@
     }
 
     @Override
-    public void overrideParameters(ExtensionType intermediate) {
-        if (intermediate != ExtensionType.NormalJar) {
-            this.currentParameter.setAdditionalParams(getAdditionalParams());
-            this.currentParameter.setVerifiedOptions(getVerifiedOptions());
-        }
+    public void overrideParameters(ExtensionType javaExtensionFormat) {
+        this.currentParameter.setAdditionalParams(getAdditionalParams());
+        this.currentParameter.setVerifiedOptions(getVerifiedOptions());
     }
 }
 
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/JmodExplodedModuleAndModularJarDependencyTest.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/JmodExplodedModuleAndModularJarDependencyTest.java	Tue Oct 25 09:14:58 2016 +0530
@@ -248,7 +248,7 @@
             Pair<TimeUnit, Integer> tuple = getDelayAfterInstall();
             tuple.getKey().sleep(tuple.getValue());
             this.intermediateToParametersMap.get(ExtensionType.NormalJar)
-                    .getVerifiedOptions()
+                    .createNewVerifiedOptions()
                     .forEach((name, value) -> bundlingManager.verifyOption(name,
                             value, app, getResultingAppName(
                                     modulePath.getFileName().toString())));
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleBundledWithAllModules.java	Tue Oct 18 13:17:43 2016 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- */
-package com.oracle.appbundlers.tests.functionality.jdk9test;
-
-import static com.oracle.appbundlers.utils.installers.AbstractBundlerUtils.OUTPUT_CONTAINS;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import com.oracle.appbundlers.tests.functionality.functionalinterface.AdditionalParams;
-import com.oracle.appbundlers.tests.functionality.functionalinterface.VerifiedOptions;
-import com.oracle.appbundlers.utils.ExtensionType;
-
-/**
- *  Named Module App + ALL_MODULEPATH
- *  -m hello.world/HelloWorld -mp hello.world.jar -addmods ALL_MODULEPATH
- *  @author Ramesh BG
- */
-public class NamedModuleBundledWithAllModules extends ModuleTestBase {
-
-    protected VerifiedOptions getVerifiedOptions() {
-        return () -> {
-            Map<String, Object> hashMap = new HashMap<String, Object>();
-            hashMap.put(OUTPUT_CONTAINS, HELLO_WORLD_OUTPUT);
-            /*
-             * TODO verificator needs to check ALL_MODULES in output currently
-             * ALL_MODULEPATH is not working.
-             */
-            hashMap.put(ADD_MODS, ALL_MODULE_PATH);
-            return hashMap;
-        };
-    }
-
-    public AdditionalParams getAdditionalParams() {
-        return () -> {
-            Map<String, Object> hashMap = new HashMap<String, Object>();
-            hashMap.put(ADD_MODS, ALL_MODULE_PATH);
-            return hashMap;
-        };
-    }
-
-    @Override
-    public void overrideParameters(ExtensionType intermediate)
-            throws IOException {
-        if(ExtensionType.NormalJar != intermediate) {
-            currentParameter.setAdditionalParams(getAdditionalParams());
-            currentParameter.setVerifiedOptions(getVerifiedOptions());
-        }
-    }
-}
-
-
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleBundledWithMinimumModulesAnd3rdPartyJarsTest.java	Tue Oct 18 13:17:43 2016 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- */
-package com.oracle.appbundlers.tests.functionality.jdk9test;
-
-import static com.oracle.appbundlers.utils.installers.AbstractBundlerUtils.CHECK_MODULE_IN_JAVA_EXECUTABLE;
-import static com.oracle.appbundlers.utils.installers.AbstractBundlerUtils.OUTPUT_CONTAINS;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import com.oracle.appbundlers.tests.functionality.functionalinterface.AdditionalParams;
-import com.oracle.appbundlers.tests.functionality.functionalinterface.VerifiedOptions;
-import com.oracle.appbundlers.utils.AppWrapper;
-import com.oracle.appbundlers.utils.ExtensionType;
-import com.oracle.appbundlers.utils.SourceFactory;
-import com.oracle.appbundlers.utils.Utils;
-
-/**
- * -srcfiles 3rd.party.jar -m hello.world/HelloWorld -mp hello.world.jar
- * -addmods hello.world
- * Need to check whether this testcase is valid since it's not possible to
- * access package from module.
- * @author Ramesh BG
- */
-public class NamedModuleBundledWithMinimumModulesAnd3rdPartyJarsTest
-        extends ModuleTestBase {
-
-    public VerifiedOptions getVerifiedOptions() {
-        return () -> {
-            Map<String, Object> hashMap = new HashMap<String, Object>();
-            hashMap.put(OUTPUT_CONTAINS, HELLO_WORLD_OUTPUT);
-            hashMap.put(CHECK_MODULE_IN_JAVA_EXECUTABLE,
-                    COM_GREETINGS_MODULE_CUM_PACKAGE_NAME);
-            return hashMap;
-        };
-    }
-
-    public AdditionalParams getAdditionalParams() {
-        return () -> {
-            Map<String, Object> hashMap = new HashMap<String, Object>();
-            hashMap.put(ADD_MODS, getApp().getAllModuleNamesSeparatedByComma());
-            return hashMap;
-        };
-    }
-
-    protected AppWrapper getApp() throws IOException {
-        return new AppWrapper(Utils.getTempSubDir(WORK_DIRECTORY),
-                COM_GREETINGS_APP1_QUALIFIED_CLASS_NAME,
-                SourceFactory.get_test_app_util_unnamed_module(), SourceFactory
-                        .get_com_greetings_module());
-    }
-
-    @Override
-    public void overrideParameters(ExtensionType intermediate)
-            throws IOException {
-        if (ExtensionType.NormalJar != intermediate) {
-            this.currentParameter.setApp(getApp());
-            this.currentParameter.setAdditionalParams(getAdditionalParams());
-            this.currentParameter.setVerifiedOptions(getVerifiedOptions());
-        }
-    }
-}
-
-
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleBundledWithMinimumModulesAnd3rdPartyModulesTest.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleBundledWithMinimumModulesAnd3rdPartyModulesTest.java	Tue Oct 25 09:14:58 2016 +0530
@@ -42,6 +42,7 @@
             Map<String, Object> hashMap = new HashMap<String, Object>();
             hashMap.put(ADD_MODS, this.currentParameter.getApp()
                     .getAllModuleNamesSeperatedByCommaExceptMainmodule());
+            hashMap.put(STRIP_NATIVE_COMMANDS, false);
             return hashMap;
         };
     }
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleWithMinimumModulesTest.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleWithMinimumModulesTest.java	Tue Oct 25 09:14:58 2016 +0530
@@ -11,6 +11,7 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import com.oracle.appbundlers.tests.functionality.functionalinterface.AdditionalParams;
 import com.oracle.appbundlers.tests.functionality.functionalinterface.VerifiedOptions;
 import com.oracle.appbundlers.utils.AppWrapper;
 import com.oracle.appbundlers.utils.ExtensionType;
@@ -19,7 +20,7 @@
 
 /**
  *  Named Module + Minimum modules
- *  -m hello.world/HelloWorld -mp hello.world.jar -addmods hello.world
+ *  -m hello.world/HelloWorld -mp hello.world.jar
  *  checks for existence of module by executing java --list-modules
  *  @author Ramesh BG
  */
@@ -41,11 +42,20 @@
                 SourceFactory.get_com_greetings_module());
     }
 
+    public AdditionalParams getAdditionalParams() {
+        return () -> {
+            Map<String, Object> hashMap = new HashMap<String, Object>();
+            hashMap.put(STRIP_NATIVE_COMMANDS, false);
+            return hashMap;
+        };
+    }
+
     @Override
     public void overrideParameters(ExtensionType javaExtensionType)
             throws IOException {
         if (ExtensionType.NormalJar != javaExtensionType) {
             this.currentParameter.setApp(getApp());
+            this.currentParameter.setAdditionalParams(getAdditionalParams());
             this.currentParameter.setVerifiedOptions(getVerifiedOptions());
         }
     }
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/UnnamedModuleDependsOn3rdPartyModulesBundledWithEntireJreTest.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/UnnamedModuleDependsOn3rdPartyModulesBundledWithEntireJreTest.java	Tue Oct 25 09:14:58 2016 +0530
@@ -70,16 +70,16 @@
 
     @Override
     protected void prepareTestEnvironment() throws Exception {
-        for (ExtensionType intermediate : ExtensionType.getModuleTypes()) {
+        for (ExtensionType javaExtensionFormat : getExtensionArray()) {
             this.currentParameter = this.intermediateToParametersMap
-                    .get(intermediate);
-            overrideParameters(intermediate);
+                    .get(javaExtensionFormat);
+            overrideParameters(javaExtensionFormat);
             initializeAndPrepareApp();
         }
     }
 
     @Override
-    public void overrideParameters(ExtensionType intermediate)
+    public void overrideParameters(ExtensionType javaExtensionFormat)
             throws IOException {
         this.currentParameter.setApp(getApp());
         this.currentParameter.setBasicParams(getBasicParams());
@@ -108,7 +108,7 @@
     public BasicParams getBasicParams() throws IOException {
         /*
          * there is no main module in this test since unnamed module depending
-         * on named module via --add-exports
+         * on named module
          */
         return (AppWrapper app) -> {
             Map<String, Object> basicParams = new HashMap<String, Object>();
@@ -138,8 +138,8 @@
 
     @Override
     protected void executeJavaPackager(BundlingManager bundlingManager,
-            Map<String, Object> allParams) throws IOException {
-        bundlingManager.execute(allParams, this.currentParameter.getApp(), true);
+            Map<String, Object> allParams, ExtensionType extension) throws IOException {
+        bundlingManager.execute(allParams, this.currentParameter.getApp() ,true);
     }
 }
 
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/ExplodedModuleParameters.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/ExplodedModuleParameters.java	Tue Oct 25 09:14:58 2016 +0530
@@ -38,16 +38,16 @@
     }
 
     @Override
-    public Map<String, Object> getBasicParams() throws Exception {
-        Map<String, Object> basicParams = new HashMap<String, Object>();
-        basicParams.putAll(super.getBasicParams());
-        basicParams.put(BundleParams.PARAM_APP_RESOURCES,
+    public Map<String, Object> createNewBasicParams() throws Exception {
+        basicParamsMap = new HashMap<String, Object>();
+        basicParamsMap.putAll(super.createNewBasicParams());
+        basicParamsMap.put(BundleParams.PARAM_APP_RESOURCES,
                 new RelativeFileSet(this.app.getExplodedModsDir().toFile(),
                         app.getExplodedModFileList().stream().map(Path::toFile)
                                 .collect(toSet())));
-        basicParams.put(MODULEPATH, String.join(File.pathSeparator,
+        basicParamsMap.put(MODULEPATH, String.join(File.pathSeparator,
                 JMODS_PATH_IN_JDK, app.getExplodedModsDir().toString()));
-        return requireNonNull(getBasicParamsFunctionalInterface(), basicParams);
+        return requireNonNull(getBasicParamsFunctionalInterface(), basicParamsMap);
     }
 
     @Override
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/GenericModuleParameters.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/GenericModuleParameters.java	Tue Oct 25 09:14:58 2016 +0530
@@ -42,10 +42,10 @@
     }
 
     @Override
-    public Map<String, Object> getBasicParams() throws Exception {
-        Map<String, Object> basicParams = new HashMap<String, Object>();
-        basicParams.put(MAIN_MODULE, String.join("/", app.getMainModuleName(), app.getMainClass()));
-        return basicParams;
+    public Map<String, Object> createNewBasicParams() throws Exception {
+        basicParamsMap = new HashMap<String, Object>();
+        basicParamsMap.put(MAIN_MODULE, String.join("/", app.getMainModuleName(), app.getMainClass()));
+        return basicParamsMap;
     }
 
     public abstract String getModulePath();
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/JmodParameters.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/JmodParameters.java	Tue Oct 25 09:14:58 2016 +0530
@@ -38,16 +38,16 @@
     }
 
     @Override
-    public Map<String, Object> getBasicParams() throws Exception {
-        Map<String, Object> basicParams = new HashMap<String, Object>();
-        basicParams.putAll(super.getBasicParams());
-        basicParams.put(BundleParams.PARAM_APP_RESOURCES,
+    public Map<String, Object> createNewBasicParams() throws Exception {
+        basicParamsMap = new HashMap<String, Object>();
+        basicParamsMap.putAll(super.createNewBasicParams());
+        basicParamsMap.put(BundleParams.PARAM_APP_RESOURCES,
                 new RelativeFileSet(this.app.getJmodsDir().toFile(),
                         app.getJmodFileList().stream().map(Path::toFile)
                                 .collect(toSet())));
-        basicParams.put(MODULEPATH, String.join(File.pathSeparator,
+        basicParamsMap.put(MODULEPATH, String.join(File.pathSeparator,
                 JMODS_PATH_IN_JDK, app.getJmodsDir().toString()));
-        return requireNonNull(getBasicParamsFunctionalInterface(), basicParams);
+        return requireNonNull(getBasicParamsFunctionalInterface(), basicParamsMap);
     }
 
     @Override
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/ModularJarParameters.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/ModularJarParameters.java	Tue Oct 25 09:14:58 2016 +0530
@@ -37,16 +37,16 @@
     public ModularJarParameters() {
     }
 
-    public Map<String, Object> getBasicParams() throws Exception {
-        Map<String, Object> basicParams = new HashMap<String, Object>();
-        basicParams.putAll(super.getBasicParams());
-        basicParams.put(BundleParams.PARAM_APP_RESOURCES,
+    public Map<String, Object> createNewBasicParams() throws Exception {
+        basicParamsMap = new HashMap<String, Object>();
+        basicParamsMap.putAll(super.createNewBasicParams());
+        basicParamsMap.put(BundleParams.PARAM_APP_RESOURCES,
                 new RelativeFileSet(this.app.getModularJarsDir().toFile(),
                         app.getModularJarFileList().stream().map(Path::toFile)
                                 .collect(toSet())));
-        basicParams.put(MODULEPATH, String.join(File.pathSeparator,
+        basicParamsMap.put(MODULEPATH, String.join(File.pathSeparator,
                 JMODS_PATH_IN_JDK, app.getModularJarsDir().toString()));
-        return requireNonNull(getBasicParamsFunctionalInterface(), basicParams);
+        return requireNonNull(getBasicParamsFunctionalInterface(), basicParamsMap);
     }
 
     @Override
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/NormalJarParameters.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/NormalJarParameters.java	Tue Oct 25 09:14:58 2016 +0530
@@ -50,22 +50,22 @@
 
     }
 
-    public Map<String, Object> getBasicParams() throws Exception {
-        Map<String, Object> basicParams = new HashMap<String, Object>();
-        basicParams.put(BundleParams.PARAM_APP_RESOURCES,
+    public Map<String, Object> createNewBasicParams() throws Exception {
+        basicParamsMap = new HashMap<String, Object>();
+        basicParamsMap.put(BundleParams.PARAM_APP_RESOURCES,
                 new RelativeFileSet(this.app.getJarDir().toFile(),
                         app.getJarFilesList().stream().map(Path::toFile)
                                 .collect(toSet())));
-        basicParams.put(MAIN_JAR,
+        basicParamsMap.put(MAIN_JAR,
                 this.app.getMainJarFile().toFile().getName());
-        basicParams.put(CLASSPATH,
+        basicParamsMap.put(CLASSPATH,
                 this.app.getJarFilesList().stream().map(Path::getFileName)
                         .map(Path::toString)
                         .collect(Collectors.joining(File.pathSeparator)));
         String mainClass = StandardBundlerParam.MAIN_CLASS
-                .fetchFrom(basicParams);
-        basicParams.put(APPLICATION_CLASS, mainClass);
-        return requireNonNull(getBasicParamsFunctionalInterface(), basicParams);
+                .fetchFrom(basicParamsMap);
+        basicParamsMap.put(APPLICATION_CLASS, mainClass);
+        return requireNonNull(getBasicParamsFunctionalInterface(), basicParamsMap);
     }
 
     @Override
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/Parameters.java	Tue Oct 18 13:17:43 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/Parameters.java	Tue Oct 25 09:14:58 2016 +0530
@@ -6,6 +6,7 @@
 
 import java.io.IOException;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.Map;
 
 import com.oracle.appbundlers.tests.functionality.functionalinterface.AdditionalParams;
@@ -35,8 +36,15 @@
 
     private VerifiedOptions verifiedOptions;
 
+
+    protected Map<String, Object> basicParamsMap;
+
+    protected Map<String, Object> additionalParamsMap;
+
+
     public Parameters() {
-
+        basicParamsMap = new HashMap<>();
+        additionalParamsMap = new HashMap<>();
     }
 
     public Parameters(BasicParams basicParams,
@@ -73,16 +81,16 @@
         this.verifiedOptions = verifiedOptions;
     }
 
-    public Map<String, Object> getBasicParams() throws Exception {
+    public Map<String, Object> createNewBasicParams() throws Exception {
         return requireNonNull(this.basicParams, Collections.emptyMap());
     }
 
-    public Map<String, Object> getAdditionalParams() throws Exception {
+    public Map<String, Object> createNewAdditionalParams() throws Exception {
         return requireNonNull(this.additionalParams, Collections.emptyMap());
     }
 
-    public Map<String, Object> getVerifiedOptions() throws Exception {
-        return requireNonNull(this.verifiedOptions, getAdditionalParams());
+    public Map<String, Object> createNewVerifiedOptions() throws Exception {
+        return requireNonNull(this.verifiedOptions, createNewAdditionalParams());
     }
 
     protected <T> Map<String, Object> requireNonNull(T obj, Map<String, Object> defaultValue) throws Exception {
@@ -97,5 +105,13 @@
     }
 
     public abstract ExtensionType getExtension();
+
+    public Map<String, Object> getAdditionalParamsMap() {
+        return this.additionalParamsMap;
+    }
+
+    public Map<String, Object> getBasicParamsMap() {
+        return this.basicParamsMap;
+    }
 }