changeset 323:a141695f4a7f

8161589: Implementation of UnnamedModuleDependsOn3rdPartyModulesBundledWithEntireJreTest testcase in javapackager test suite. Contributed-by: ramesh.gangadhar@oracle.com Reviewed-by: cbensen
author cbensen
date Mon, 18 Jul 2016 08:53:54 -0700
parents 16542d3f79a9
children 0181e5e6b9bb
files functional/appBundlerTestsJDK9/appBundlerTestsJDK9/build-Copy.xml functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/AppBundlersSampleGUI.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/GUI.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/AppWrapper.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/ConsoleBundlingManager.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/Constants.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/TestBase.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/AddModuleTest.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/ExtensionType.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/LimitModuleTest.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/ListServiceProvidersTest.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/NamedModuleBundledWithMinimumModulesMacroAnd3rdPartyModulesTest.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleWithEntireJreTest.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
diffstat 18 files changed, 179 insertions(+), 667 deletions(-) [+]
line wrap: on
line diff
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/build-Copy.xml	Fri Jul 15 07:59:53 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,187 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- You may freely edit this file. See commented blocks below for -->
-<!-- some examples of how to customize the build. -->
-<!-- (If you delete it and reopen the project it will be recreated.) -->
-<!-- By default, only the Clean and Build commands use this build script. -->
-<!-- Commands such as Run, Debug, and Test only use this build script if -->
-<!-- the Compile on Save feature is turned off for the project. -->
-<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
-<!-- in the project's Project Properties dialog box.-->
-<project name="appBundlerTests" default="default" basedir="." xmlns:unless="ant:unless">
-	<description>Builds, tests, and runs the project appBundlerTests.</description>
-	<import file="nbproject/build-impl.xml"/>
-	<property name="aurora.sentinel" value="http://aurora.ru.oracle.com/feeder-gw/central/system"/>
-	<property name="sandbox" value="build/aurora-sandbox/"/>
-
-	<target name="copy-packager-jars" depends="specify-lib-path-forJDK8andBelow, specify-lib-path-forJDK9andAbove">
-		<echo>libpath is ${libpath}</echo>
-		<echo>base directory is ${basedir}</echo>
-		<copy todir="lib" file="${libpath}/ant-javafx.jar" overwrite="true" />
-		<!--<copy todir="lib" file="${libpath}/packager.jar" overwrite="true" />
-		<copy todir="src/com/oracle/appbundlers/utils/resources" file="lib/packager.jar" overwrite="true" />-->
-	</target>
-
-	<target name="specify-lib-path-forJDK8andBelow" depends="checkJdkVersion"
-			unless="${isJdk9AndAbove}">
-			<property name="libpath" value="${java.home}/../lib" />
-	</target>
-
-	<target name="specify-lib-path-forJDK9andAbove" depends="checkJdkVersion"
-			if="${isJdk9AndAbove}">
-			<property name="libpath" value="${java.home}/lib" />
-	</target>
-
-	<target name="checkJdkVersion">
-		<scriptdef name="split" language="javascript">
-			<attribute name="value" />
-			<attribute name="separator" />
-			<![CDATA[ 
-			            values = attributes.get("value").split(attributes.get("separator"));
-						if(values.length == 1) {
-							// 9 and above.
-							project.setNewProperty("isJdk9AndAbove", true);	
-						} else {
-							project.setNewProperty("isJdk9AndAbove", false);
-				        }
-		     ]]>
-		</scriptdef>
-		<split value="${java.version}" separator="." />
-		<echo>value of java version is ${java.version}</echo>
-		<echo>value of isJdk9AndAbove is ${isJdk9AndAbove}</echo>
-	</target>
-
-	<target name="-post-clean">
-		<delete>
-			<fileset dir="lib" includes="ant-javafx.jar,packager.jar" />
-		</delete>
-	</target>
-
-	<target name="-pre-compile" depends="copy-packager-jars" />
-	<!--
-
-    There exist several targets which are by default empty and which can be 
-    used for execution of your tasks. These targets are usually executed 
-    before and after some main targets. They are: 
-
-      -pre-init:                 called before initialization of project properties
-      -post-init:                called after initialization of project properties
-      -pre-compile:              called before javac compilation
-      -post-compile:             called after javac compilation
-      -pre-compile-single:       called before javac compilation of single file
-      -post-compile-single:      called after javac compilation of single file
-      -pre-compile-test:         called before javac compilation of JUnit tests
-      -post-compile-test:        called after javac compilation of JUnit tests
-      -pre-compile-test-single:  called before javac compilation of single JUnit test
-      -post-compile-test-single: called after javac compilation of single JUunit test
-      -pre-jar:                  called before JAR building
-      -post-jar:                 called after JAR building
-      -post-clean:               called after cleaning build products
-
-    (Targets beginning with '-' are not intended to be called on their own.)
-
-    Example of inserting an obfuscator after compilation could look like this:
-
-        <target name="-post-compile">
-            <obfuscate>
-                <fileset dir="${build.classes.dir}"/>
-            </obfuscate>
-        </target>
-
-    For list of available properties check the imported
-    nbproject/build-impl.xml file. 
-
-
-    Another way to customize the build is by overriding existing main targets.
-    The targets of interest are: 
-
-      -init-macrodef-javac:     defines macro for javac compilation
-      -init-macrodef-junit:     defines macro for junit execution
-      -init-macrodef-debug:     defines macro for class debugging
-      -init-macrodef-java:      defines macro for class execution
-      -do-jar:                  JAR building
-      run:                      execution of project 
-      -javadoc-build:           Javadoc generation
-      test-report:              JUnit report generation
-
-    An example of overriding the target for project execution could look like this:
-
-        <target name="run" depends="appBundlerTests-impl.jar">
-            <exec dir="bin" executable="launcher.exe">
-                <arg file="${dist.jar}"/>
-            </exec>
-        </target>
-
-    Notice that the overridden target depends on the jar target and not only on 
-    the compile target as the regular run target does. Again, for a list of available 
-    properties which you can use, check the target you are overriding in the
-    nbproject/build-impl.xml file. 
-
-    -->
-	<target name="aurora-submit">
-		<get src="${aurora.sentinel}/parser-system.jar" dest="lib/parser-system.jar"/>
-		<get src="${aurora.sentinel}/parser-jre.jar" dest="lib/parser-jre.jar"/>
-		<get src="${aurora.sentinel}/parser-jfx.jar" dest="lib/parser-jfx.jar"/>
-		<get src="${aurora.sentinel}/manual-submit.jar" dest="lib/manual-submit.jar"/>
-
-		<mkdir dir="${sandbox}"/>
-
-		<mkdir dir="${sandbox}/xml-system"/>
-		<mkdir dir="${sandbox}/xml-jre"/>
-		<mkdir dir="${sandbox}/xml-jfx"/>
-
-		<java fork="true" jar="lib/parser-system.jar" dir="${sandbox}/xml-system" />
-		<java fork="true" jar="lib/parser-jre.jar" dir="${sandbox}/xml-jre"/>
-		<java fork="true" jar="lib/parser-jfx.jar" dir="${sandbox}/xml-jfx"/>
-
-		<echo file="${sandbox}/component_info.txt">testbase_location=http://shaman.ru.oracle.com/hg/index.cgi/appBundlerTests
-test_component=deployment/bundlers
-test_suitename=appBundlerTests
-testbase_name=appBundler
-testbase_version=TBD
-test_harness=testng
-</echo>
-
-		<copy file="build/test/results/testng-results.xml" todir="${sandbox}" verbose="true"/>
-
-		<java fork="true" jar="lib/manual-submit.jar" dir="${sandbox}">
-			<arg line="-address=http://aurora.ru.oracle.com"/>
-			<arg line="-batch ManualSubmit"/>
-			<arg line="-userName 0"/>
-			<arg line="-resultDirectory ."/>
-		</java>
-	</target>
-
-	<target name="run-single-test-method">
-
-		<fail unless="class-name" message="Please, specify the class containing tests methods.${line.separator}
-For example -Dclass-name=com.oracle.appbundlers.tests.functionality.SimpleExecutablesTest" />
-		<echo unless:set="installation-package-type">You may want to specify the type of the package:${line.separator}
--Dinstallation-package-type=${line.separator}
-[win_app     | exe | msi |${line.separator}
- linux_app   | deb | rpm |${line.separator}
- mac_app     | dmg | pkg ]${line.separator}</echo>
-
-		<echo unless:set="packager-interface">You may want to specify the way of creating the package:${line.separator}
--Dpackager-interface=[ant | cli | java_api] </echo>
-
-		<property name="run.jvmargs" value="-Dtest-run-mode=single-method -Dinstallation-package-type=${installation-package-type} -Dpackager-interface=${packager-interface} -Dmanual-only=${manual-only}" />
-
-		<antcall target="-do-compile-single">
-			<param  name="javac.includes" value="${class-name}" />
-		</antcall>
-
-		<antcall target="test-single-method">
-			<param  name="test.class" value="${class-name}" />
-			<param  name="test.method" value="runTest" />
-			<param  name="javac.includes" value="${class-name}" />
-			<param  name="test.includes" value="${class-name}" />
-		</antcall>
-	</target>
-
-	<target name="test-manual">
-		<property name="run.jvmargs" value="-Dmanual-only=true" />
-		<antcall target="test">
-			<param name="manual-only" value="true" />
-		</antcall>
-	</target>
-</project>
\ No newline at end of file
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/AppBundlersSampleGUI.java	Fri Jul 15 07:59:53 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/AppBundlersSampleGUI.java	Mon Jul 18 08:53:54 2016 -0700
@@ -4,29 +4,23 @@
  */
 package com.oracle.appbundlers;
 
-import static java.util.stream.Collectors.toSet;
-
 import java.io.File;
-import java.io.IOException;
-import java.nio.file.Path;
-import java.util.Arrays;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Map;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import java.util.stream.Collectors;
 
+import com.oracle.appbundlers.tests.functionality.parameters.ExplodedModuleParameters;
+import com.oracle.appbundlers.tests.functionality.parameters.JmodParameters;
+import com.oracle.appbundlers.tests.functionality.parameters.ModularJarParameters;
+import com.oracle.appbundlers.tests.functionality.parameters.NormalJarParameters;
 import com.oracle.appbundlers.utils.AppWrapper;
 import com.oracle.appbundlers.utils.Constants;
-import com.oracle.appbundlers.utils.Source;
-import com.oracle.appbundlers.utils.Utils;
 import com.oracle.tools.packager.Bundlers;
 import com.oracle.tools.packager.ConfigException;
-import com.oracle.tools.packager.RelativeFileSet;
 import com.oracle.tools.packager.UnsupportedPlatformException;
 import com.sun.javafx.tools.packager.Log;
-import com.sun.javafx.tools.packager.bundlers.BundleParams;
 
 import javafx.application.Application;
 import javafx.application.Platform;
@@ -45,16 +39,18 @@
     private final Logger LOG = Logger
             .getLogger(AppBundlersSampleGUI.class.getName());
 
+    private AppWrapper app;
+
+    private Map<String, Object> params;
+
     @Override
     public void start(Stage primaryStage) {
-        final CheckBox fxAppCheckBox = new CheckBox("JavaFX App");
-        final CheckBox utilClassCheckBox = new CheckBox("Utility class used");
+        final CheckBox fxAppCheckBox = new CheckBox("Java App");
         final Button buildButton = new Button("Build application");
         final CheckBox verbose = new CheckBox("Verbose output/Debug");
 
         final VBox root = new VBox();
-        root.getChildren().addAll(fxAppCheckBox, utilClassCheckBox, verbose,
-                buildButton);
+        root.getChildren().addAll(fxAppCheckBox, verbose, buildButton);
         root.setPadding(new Insets(10, 10, 10, 10));
         root.setSpacing(5);
 
@@ -66,63 +62,25 @@
                     Log.setLogger(new Log.Logger(true));
                     Log.setDebug(true);
                 }
-                String workDir = "test"
-                        + (fxAppCheckBox.isSelected() ? "Fx" : "") + "App"
-                        + (utilClassCheckBox.isSelected() ? "WithUtil" : "");
-                String outputCommand = utilClassCheckBox.isSelected()
-                        ? "testapp.util.Util.println" : SYSTEM_OUT_PRINTLN;
-                @SuppressWarnings("serial")
-                AppWrapper app = new AppWrapper(Utils.getTempSubDir(workDir),
-                        "testapp.App1",
-                        new Source("testapp.App1", FXAPP_JAVA_TEMPLATE, workDir,
-                                new HashMap<String, String>() {
-                    {
-                        put(PRINTLN_STATEMENT, outputCommand);
-                        put(APP_NAME_REPLACEMENT_STATEMENT, "App1");
-                        put(PASS_STRING_REPLACEMENT_STATEMENT, PASS_1);
-                    }
-                }), new Source("testapp.App2", FXAPP_JAVA_TEMPLATE, workDir,
-                        new HashMap<String, String>() {
-                    {
-                        put(PRINTLN_STATEMENT, outputCommand);
-                        put(APP_NAME_REPLACEMENT_STATEMENT, "App2");
-                        put(PASS_STRING_REPLACEMENT_STATEMENT, "PASS_2");
-                    }
-                })
-                // ,new TempSource("testapp.util.Util", "Util.java.template",
-                // CUSTOM_UTIL_CLASS_SIMPLE_NAME)
-                );
-                System.out.println(
-                        "Writing app to app directory: " + app.getWorkDir());
-//                app.preinstallApp();
-                app.writeSourcesToAppDirectory();
-                app.compileApp();
-//                try {
-//                    app.jarApp();
-//                } catch (Exception e1) {
-//                    e1.printStackTrace();
-//                }
+                createParametersAndExecuteAppBundler(new NormalJarParameters());
+                createParametersAndExecuteAppBundler(
+                        new ExplodedModuleParameters());
+                createParametersAndExecuteAppBundler(
+                        new ModularJarParameters());
+                createParametersAndExecuteAppBundler(new JmodParameters());
+            } finally {
+                Platform.exit();
+            }
+        });
 
-                System.out
-                        .println("Building app with app the suitable Bundlers");
-                Map<String, Object> params = new HashMap<>();
-                params.put(BundleParams.PARAM_APP_RESOURCES,
-                        new RelativeFileSet(app.getJarDir().toFile(),
-                                app.getJarFilesList().stream().map(Path::toFile)
-                                        .collect(toSet())));
-                params.put(MAIN_JAR,
-                        new RelativeFileSet(app.getJarDir()
-                                .toFile(),
-                        new HashSet<>(
-                                Arrays.asList(app.getMainJarFile().toFile()))));
-                params.put(CLASSPATH, app.getJarFilesList().stream()
-                        .map(Path::getFileName).map(Path::toString)
-                        .collect(Collectors.joining(File.pathSeparator)));
+        primaryStage.setTitle("AppBundlers Sample GUI");
+        primaryStage.setScene(scene);
+        primaryStage.show();
+    }
 
-                System.out.println(params);
-
-                Bundlers.createBundlersInstance().getBundlers().stream()
-                        .filter((bundler) -> {
+    private void executeAppBundler() {
+        Bundlers.createBundlersInstance().getBundlers().stream()
+                .filter((bundler) -> {
                     try {
                         bundler.validate(params);
                         return true;
@@ -148,17 +106,6 @@
                             app.getBundlesDir().toFile());
                     LOG.log(Level.INFO, "Finished with result: {0}", result);
                 });
-            } catch (IOException ex) {
-                LOG.log(Level.SEVERE, "Failed to create application files: {0}",
-                        ex.getMessage());
-            } finally {
-                Platform.exit();
-            }
-        });
-
-        primaryStage.setTitle("AppBundlers Sample GUI");
-        primaryStage.setScene(scene);
-        primaryStage.show();
     }
 
     /**
@@ -169,4 +116,34 @@
         launch(args);
     }
 
+    private void createParametersAndExecuteAppBundler(
+            com.oracle.appbundlers.tests.functionality.parameters.Parameters parameters) {
+        try {
+            parameters.initializeDefaultApp();
+            this.app = parameters.getApp();
+            System.out.println(
+                    "Writing app to app directory: " + app.getWorkDir());
+            this.app.preinstallApp(parameters.getExtension());
+            this.app.writeSourcesToAppDirectory();
+            this.app.compileApp();
+            this.app.jarApp(parameters.getExtension());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        Map<String, Object> basicParams = null;
+        Map<String, Object> additionalParams = null;
+        try {
+            basicParams = parameters.getBasicParams();
+            additionalParams = parameters.getAdditionalParams();
+        } catch (Exception exp) {
+            exp.printStackTrace();
+        }
+
+        this.params = new HashMap<>();
+        this.params.putAll(basicParams);
+        this.params.putAll(additionalParams);
+
+        executeAppBundler();
+    }
 }
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/GUI.java	Fri Jul 15 07:59:53 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,194 +0,0 @@
-/*
- * Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- */
-package com.oracle.appbundlers;
-
-import static java.util.stream.Collectors.toSet;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.file.Path;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import java.util.stream.Collectors;
-
-import com.oracle.appbundlers.utils.AppWrapper;
-import com.oracle.appbundlers.utils.Constants;
-import com.oracle.appbundlers.utils.Source;
-import com.oracle.appbundlers.utils.Utils;
-import com.oracle.tools.packager.Bundler;
-import com.oracle.tools.packager.Bundlers;
-import com.oracle.tools.packager.ConfigException;
-import com.oracle.tools.packager.RelativeFileSet;
-import com.oracle.tools.packager.UnsupportedPlatformException;
-import com.sun.javafx.tools.packager.Log;
-import com.sun.javafx.tools.packager.bundlers.BundleParams;
-
-import javafx.application.Application;
-import javafx.application.Platform;
-import javafx.geometry.Insets;
-import javafx.scene.Scene;
-import javafx.scene.control.Button;
-import javafx.scene.control.CheckBox;
-import javafx.scene.layout.VBox;
-import javafx.stage.Stage;
-
-/**
- * @author Dmitry Ginzburg &lt;dmitry.x.ginzburg@oracle.com&gt;
- */
-public class GUI extends Application implements Constants {
-
-    private final Logger LOG = Logger.getLogger(GUI.class.getName());
-
-    @Override
-    public void start(Stage primaryStage) {
-        final CheckBox fxAppCheckBox = new CheckBox("JavaFX App");
-        final CheckBox utilClassCheckBox = new CheckBox("Utility class used");
-        final Button buildButton = new Button("Build application");
-        final CheckBox verbose = new CheckBox("Verbose output/Debug");
-
-        final VBox root = new VBox();
-        root.getChildren().addAll(fxAppCheckBox, utilClassCheckBox, verbose,
-                buildButton);
-        root.setPadding(new Insets(10, 10, 10, 10));
-        root.setSpacing(5);
-
-        final Scene scene = new Scene(root);
-
-        buildButton.setOnAction((ev) -> {
-            try {
-                if (verbose.isSelected()) {
-                    Log.setLogger(new Log.Logger(true));
-                    Log.setDebug(true);
-                }
-                String workDir = "test"
-                        + (fxAppCheckBox.isSelected() ? "Fx" : "") + "App"
-                        + (utilClassCheckBox.isSelected() ? "WithUtil" : "");
-                String outputCommand = utilClassCheckBox.isSelected()
-                        ? "testapp.util.Util.println" : SYSTEM_OUT_PRINTLN;
-                @SuppressWarnings("serial")
-                AppWrapper app = new AppWrapper(Utils.getTempSubDir(workDir),
-                        COM_GREETINGS_APP1_QUALIFIED_CLASS_NAME,
-                        new Source("custom.util", "util.module.template",
-                                new HashMap<String, String>() {
-                    {
-                        put("Util.java.template", "testapp.util.Util");
-                    }
-                }, "custom.util.testapp.Util", CUSTOM_UTIL_CLASS_SIMPLE_NAME,
-                                new HashMap<String, String>() {
-                    {
-                        put(PRINTLN_STATEMENT, outputCommand);
-                        put(APP_NAME_REPLACEMENT_STATEMENT, "App1");
-                        put(PASS_STRING_REPLACEMENT_STATEMENT, PASS_1);
-                        put(PACKAGE_NAME_STATEMENT, "testapp.util");
-                        put(CLASS_NAME_STATEMENT,
-                                CUSTOM_UTIL_CLASS_SIMPLE_NAME);
-                    }
-                }),
-
-                new Source(COM_GREETINGS_MODULE_CUM_PACKAGE_NAME,
-                        COM_GREETINGS_MODULE_INFO_TEMPLATE,
-                        new HashMap<String, String>() {
-                    {
-                        put(FXAPP_JAVA_TEMPLATE,
-                                COM_GREETINGS_APP1_QUALIFIED_CLASS_NAME);
-                    }
-                }, COM_GREETINGS_APP1_QUALIFIED_CLASS_NAME,
-                        COM_GREETINGS_JAR_NAME, new HashMap<String, String>() {
-                    {
-                        put(PRINTLN_STATEMENT, outputCommand);
-                        put(APP_NAME_REPLACEMENT_STATEMENT, "App1");
-                        put(PASS_STRING_REPLACEMENT_STATEMENT, PASS_1);
-                        put(PACKAGE_NAME_STATEMENT,
-                                COM_GREETINGS_MODULE_CUM_PACKAGE_NAME);
-                    }
-                }));
-                System.out.println(
-                        "Writing app to app directory: " + app.getWorkDir());
-//                app.preinstallApp();
-//                app.writeSourcesToAppDirectory();
-//                app.compileApp();
-//                try {
-//                    app.jarApp();
-//                } catch (Exception e1) {
-//                    // TODO Auto-generated catch block
-//                    e1.printStackTrace();
-//                }
-
-                System.out
-                        .println("Building app with app the suitable Bundlers");
-                Map<String, Object> params = new HashMap<>();
-                params.put(BundleParams.PARAM_APP_RESOURCES,
-                        new RelativeFileSet(app.getJarDir().toFile(),
-                                app.getJarFilesList().stream().map(Path::toFile)
-                                        .collect(toSet())));
-                params.put(MAIN_JAR,
-                        new RelativeFileSet(app.getJarDir()
-                                .toFile(),
-                        new HashSet<>(
-                                Arrays.asList(app.getMainJarFile().toFile()))));
-                params.put(CLASSPATH, app.getJarFilesList().stream()
-                        .map(Path::getFileName).map(Path::toString)
-                        .collect(Collectors.joining(File.pathSeparator)));
-                // params.put(MODULEPATH, JMODS_PATH_IN_JDK);
-
-                System.out.println(params);
-
-                Collection<Bundler> bundlers2 = Bundlers
-                        .createBundlersInstance().getBundlers("INSTALLER");
-                System.out.println("value of bundler2 is " + bundlers2);
-
-                bundlers2.stream().filter((bundler) -> {
-                    try {
-                        bundler.validate(params);
-                        return true;
-                    } catch (ConfigException ex) {
-                        LOG.log(Level.SEVERE,
-                                "Failed to create bundler \"{0}\": {1}.",
-                                new Object[] { bundler.getID(), ex });
-                        return false;
-                    } catch (UnsupportedPlatformException ex) {
-                        LOG.log(Level.INFO,
-                                "Current platform is not supported by \"{0}\".",
-                                bundler.getID());
-                        return false;
-                    }
-                }).forEach((bundler) -> {
-                    String paramStr = params.entrySet().stream()
-                            .map((e) -> String.format("%s = %s", e.getKey(),
-                                    e.getValue()))
-                            .collect(Collectors.joining("\n"));
-                    LOG.log(Level.INFO, "Executing bundler: {0}, params:\n{1}",
-                            new Object[] { bundler.getID(), paramStr });
-                    File result = bundler.execute(params,
-                            app.getBundlesDir().toFile());
-                    LOG.log(Level.INFO, "Finished with result: {0}", result);
-
-                });
-            } catch (IOException ex) {
-                LOG.log(Level.SEVERE, "Failed to create application files: {0}",
-                        ex.getMessage());
-            } finally {
-                Platform.exit();
-            }
-        });
-
-        primaryStage.setTitle("AppBundlers Sample GUI");
-        primaryStage.setScene(scene);
-        primaryStage.show();
-    }
-
-    /**
-     * @param args
-     *            the command line arguments
-     */
-    public static void main(String[] args) {
-        launch(args);
-    }
-}
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/AppWrapper.java	Fri Jul 15 07:59:53 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/AppWrapper.java	Mon Jul 18 08:53:54 2016 -0700
@@ -97,9 +97,7 @@
     }
 
     public void preinstallApp(ExtensionType extension) throws IOException {
-        Utils.createDir(getSrcDir());
-        Utils.createDir(getBundlesDir());
-        Utils.createDir(getBinDir());
+        createSrcBundleAndBinDirs();
 
         if (!getJarTempSources().isEmpty()) {
             Utils.createDir(getJarDir());
@@ -111,6 +109,21 @@
         }
     }
 
+    private void createSrcBundleAndBinDirs() throws IOException {
+        Utils.createDir(getSrcDir());
+        Utils.createDir(getBundlesDir());
+        Utils.createDir(getBinDir());
+    }
+
+    public void preinstallApp(ExtensionType[] extensionArray) throws IOException {
+        createSrcBundleAndBinDirs();
+
+        for (ExtensionType extension : extensionArray) {
+            Utils.createDir(Paths.get(getModulePathBasedOnExtension(extension)));
+        }
+    }
+
+
     private List<Source> getJarTempSources() {
         return sources.stream().filter((source) -> !source.isModule())
                 .collect(Collectors.toList());
@@ -190,6 +203,14 @@
         return compileApp(javacOptions, null, classpath);
     }
 
+    public int compileAndCreateExtensionEndProduct(ExtensionType extension, Path... classpath) throws IOException, ExecutionException  {
+        int resultForModule = compileAppForModules(new String[0], extension, classpath);
+        jarApp(extension);
+        compileAppForJars(new String[0], extension, classpath);
+        jarApp(ExtensionType.NormalJar);
+        return resultForModule;
+    }
+
     private int compileAppForJars(String[] javacOptions,
             ExtensionType extension, Path[] classpath) throws IOException {
         if (getJarTempSources().isEmpty()) {
@@ -212,20 +233,7 @@
         for (Source tempSource : getJarTempSources()) {
             List<String> newArgs = new ArrayList<String>();
             newArgs.addAll(argsList);
-            String string = getSrcDir() + File.separator
-                    + tempSource.getPackageName().replace(".", File.separator);
-            Path path = Paths.get(string);
-            Files.walkFileTree(path, new SimpleFileVisitor<Path>() {
-                @Override
-                public FileVisitResult visitFile(Path file,
-                        BasicFileAttributes attr) {
 
-                    if (file.toString().endsWith(".java")) {
-                        newArgs.add(file.toString());
-                    }
-                    return FileVisitResult.CONTINUE;
-                }
-            });
 
             newArgs.add("-classpath");
             if (classpath.length != 0) {
@@ -243,8 +251,26 @@
             if (extension != null) {
                 newArgs.add("-mp");
                 newArgs.add(String.join(File.pathSeparator, getModulePathBasedOnExtension(extension), JMODS_PATH_IN_JDK));
+            } else {
+                newArgs.add("-mp");
+                newArgs.add(getBinDir().toString());
             }
 
+            String string = getSrcDir() + File.separator
+                    + tempSource.getPackageName().replace(".", File.separator);
+            Path path = Paths.get(string);
+            Files.walkFileTree(path, new SimpleFileVisitor<Path>() {
+                @Override
+                public FileVisitResult visitFile(Path file,
+                        BasicFileAttributes attr) {
+
+                    if (file.toString().endsWith(".java")) {
+                        newArgs.add(file.toString());
+                    }
+                    return FileVisitResult.CONTINUE;
+                }
+            });
+
             ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
             System.out.println(
                     "====================COMPILATION STARTS===========================");
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/ConsoleBundlingManager.java	Fri Jul 15 07:59:53 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/ConsoleBundlingManager.java	Mon Jul 18 08:53:54 2016 -0700
@@ -156,7 +156,6 @@
     @SuppressWarnings("unchecked")
     private List<Pair<String, Collection<String>>> toConsole(
             Map<String, Object> params) {
-        System.out.println("toConsole method entry parameters are " + params);
         List<Pair<String, Collection<String>>> key2Value = new ArrayList<>();
         for (Map.Entry<String, Object> entry : params.entrySet()) {
             String key = entry.getKey();
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/Constants.java	Fri Jul 15 07:59:53 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/Constants.java	Mon Jul 18 08:53:54 2016 -0700
@@ -98,7 +98,7 @@
     String COM_SHAPE_SERVICEPROVIDER_RECTANGLE_CLASS_NAME = "com.shape.serviceprovider.rectangle.Rectangle";
     String COM_SHAPE_SERVICEINTERFACE_SHAPEMAINCLASS_TEMPLATE = "com.shape.serviceinterface.ShapeMainClass.template";
     String RECTANGLE_OUTPUT = "This is Rectangle";
-    String ALL_MODULEPATH = "ALL_MODULEPATH";
+    String ALL_MODULE_PATH = "ALL-MODULE-PATH";
     String MINIMUM_MODULES = "MINIMUM_MODULES";
     String FXAPP_JAVA_TEMPLATE = "FXApp.java.template";
     String COM_GREETINGS_APP1_QUALIFIED_CLASS_NAME = "com.greetings.App1";
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/TestBase.java	Fri Jul 15 07:59:53 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/TestBase.java	Mon Jul 18 08:53:54 2016 -0700
@@ -145,7 +145,7 @@
         }
     }
 
-    private void initializeAndPrepareApp() throws Exception {
+    protected void initializeAndPrepareApp() throws Exception {
         if (this.currentParameter.getApp() == null) {
             this.currentParameter.initializeDefaultApp();
         }
@@ -160,10 +160,10 @@
 
     @Test(dataProvider = "getBundlers")
     public void runTest(BundlingManager bundlingManager) throws Exception {
-        for (ExtensionType extension : ExtensionType.values()) {
+        for (ExtensionType extension : getExtensionArray()) {
             this.currentParameter = intermediateToParametersMap
                     .get(extension);
-
+            System.out.println("Extension "+extension+" bundling manager is "+bundlingManager);
             if (!isTestCaseApplicableForExtensionType(extension)) {
                 continue;
             }
@@ -203,7 +203,9 @@
                 this.currentParameter.getVerifiedOptions().forEach(
                         (name, value) -> bundlingManager.verifyOption(name,
                                 value, app2, getResultingAppName()));
-            } finally {
+            }
+
+            finally {
                 uninstallApp(extension);
                 LOG.log(Level.INFO, "Finished test: {0}", testName);
             }
@@ -215,6 +217,10 @@
         return true;
     }
 
+    public ExtensionType[] getExtensionArray() {
+        return ExtensionType.values();
+    }
+
     protected void uninstallApp(ExtensionType intermediate) throws Exception {
         if (bundlingManager != null) {
             String appName = bundlingManager
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/AddModuleTest.java	Fri Jul 15 07:59:53 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/AddModuleTest.java	Mon Jul 18 08:53:54 2016 -0700
@@ -11,7 +11,6 @@
 
 import com.oracle.appbundlers.tests.functionality.functionalinterface.AdditionalParams;
 import com.oracle.appbundlers.tests.functionality.functionalinterface.VerifiedOptions;
-import com.oracle.appbundlers.tests.functionality.parameters.GenericModuleParameters;
 
 /**
  * @author Ramesh BG Aim: add all modules available in application mods dir and
@@ -24,9 +23,6 @@
             Map<String, Object> hashMap = new HashMap<String, Object>();
             hashMap.put(ADD_MODS, AddModuleTest.this.getParameters().getApp()
                     .addAllModules());
-            hashMap.put(MODULEPATH,
-                    ((GenericModuleParameters) this.currentParameter)
-                            .getModulePath());
             return hashMap;
         };
     }
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/ExtensionType.java	Fri Jul 15 07:59:53 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/ExtensionType.java	Mon Jul 18 08:53:54 2016 -0700
@@ -12,4 +12,8 @@
  */
 public enum ExtensionType implements Constants {
     NormalJar, ModularJar, ExplodedModules, Jmods;
+
+    public static ExtensionType[] getModuleTypes() {
+        return new ExtensionType[] { ModularJar, ExplodedModules, Jmods };
+    }
 }
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/LimitModuleTest.java	Fri Jul 15 07:59:53 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/LimitModuleTest.java	Mon Jul 18 08:53:54 2016 -0700
@@ -11,7 +11,6 @@
 
 import com.oracle.appbundlers.tests.functionality.functionalinterface.AdditionalParams;
 import com.oracle.appbundlers.tests.functionality.functionalinterface.VerifiedOptions;
-import com.oracle.appbundlers.tests.functionality.parameters.GenericModuleParameters;
 import com.oracle.appbundlers.utils.AppWrapper;
 import com.oracle.appbundlers.utils.SourceFactory;
 import com.oracle.appbundlers.utils.Utils;
@@ -26,15 +25,11 @@
     public AdditionalParams getAdditionalParams() {
         return () -> {
             Map<String, Object> hashMap = new HashMap<String, Object>();
-            hashMap.put(MODULEPATH,
-                    ((GenericModuleParameters) this.currentParameter)
-                            .getModulePath());
             /*
              * Do not include Rectangle module name for Limit Mods
              */
             hashMap.put(LIMIT_MODS,
                     COM_SHAPE_SERVICEPROVIDER_CIRCLE_MODULENAME);
-            hashMap.put(APPLICATION_CLASS, COM_SHAPE_TEST_LIMITMODSMAINCLASS);
             return hashMap;
         };
     }
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/ListServiceProvidersTest.java	Fri Jul 15 07:59:53 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/ListServiceProvidersTest.java	Mon Jul 18 08:53:54 2016 -0700
@@ -10,7 +10,6 @@
 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.SourceFactory;
@@ -23,16 +22,6 @@
  */
 public class ListServiceProvidersTest extends ModuleTestBase {
 
-    public AdditionalParams getAdditionalParams() {
-        return () -> {
-            Map<String, Object> hashMap = new HashMap<String, Object>();
-            hashMap.put(MODULEPATH, getApp().getModularJarsDir());
-            hashMap.put(APPLICATION_CLASS,
-                    COM_SHAPE_SERVICEINTERFACE_SHAPEMAINCLASS);
-            return hashMap;
-        };
-    }
-
     public AppWrapper getApp() throws IOException {
 
         Map<String, String> hashMap = new HashMap<String, String>();
@@ -62,9 +51,8 @@
     public void overrideParameters(ExtensionType intermediate)
             throws IOException {
         if (intermediate != ExtensionType.NormalJar) {
-            currentParameter.setAdditionalParams(getAdditionalParams());
-            currentParameter.setVerifiedOptions(getVerifiedOptions());
-            currentParameter.setApp(getApp());
+            this.currentParameter.setApp(getApp());
+            this.currentParameter.setVerifiedOptions(getVerifiedOptions());
         }
     }
 }
\ No newline at end of file
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleBundledWithAllModules.java	Fri Jul 15 07:59:53 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleBundledWithAllModules.java	Mon Jul 18 08:53:54 2016 -0700
@@ -12,10 +12,6 @@
 
 import com.oracle.appbundlers.tests.functionality.functionalinterface.AdditionalParams;
 import com.oracle.appbundlers.tests.functionality.functionalinterface.VerifiedOptions;
-import com.oracle.appbundlers.tests.functionality.parameters.GenericModuleParameters;
-import com.oracle.appbundlers.utils.AppWrapper;
-import com.oracle.appbundlers.utils.SourceFactory;
-import com.oracle.appbundlers.utils.Utils;
 
 /**
  * @author Ramesh BG
@@ -28,13 +24,12 @@
     protected VerifiedOptions getVerifiedOptions() {
         return () -> {
             Map<String, Object> hashMap = new HashMap<String, Object>();
-            hashMap.put(APPCLASS, COM_GREETINGS_APP1_QUALIFIED_CLASS_NAME);
             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_MODULEPATH);
+            hashMap.put(ADD_MODS, ALL_MODULE_PATH);
             return hashMap;
         };
     }
@@ -42,26 +37,17 @@
     public AdditionalParams getAdditionalParams() {
         return () -> {
             Map<String, Object> hashMap = new HashMap<String, Object>();
-            hashMap.put(ADD_MODS, ALL_MODULEPATH);
-            hashMap.put(MODULEPATH, ((GenericModuleParameters) this.currentParameter)
-                    .getModulePath());
+            hashMap.put(ADD_MODS, ALL_MODULE_PATH);
             return hashMap;
         };
     }
 
-    public AppWrapper getApp() throws IOException {
-        return new AppWrapper(Utils.getTempSubDir(WORK_DIRECTORY),
-                    COM_GREETINGS_APP1_QUALIFIED_CLASS_NAME,
-            SourceFactory.get_com_greetings_module());
-    }
-
     @Override
     public void overrideParameters(ExtensionType intermediate)
             throws IOException {
         if(ExtensionType.NormalJar != intermediate) {
             currentParameter.setAdditionalParams(getAdditionalParams());
             currentParameter.setVerifiedOptions(getVerifiedOptions());
-            currentParameter.setApp(getApp());
         }
     }
 }
\ No newline at end of file
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleBundledWithMinimumModulesAnd3rdPartyJarsTest.java	Fri Jul 15 07:59:53 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleBundledWithMinimumModulesAnd3rdPartyJarsTest.java	Mon Jul 18 08:53:54 2016 -0700
@@ -13,7 +13,6 @@
 
 import com.oracle.appbundlers.tests.functionality.functionalinterface.AdditionalParams;
 import com.oracle.appbundlers.tests.functionality.functionalinterface.VerifiedOptions;
-import com.oracle.appbundlers.tests.functionality.parameters.GenericModuleParameters;
 import com.oracle.appbundlers.utils.AppWrapper;
 import com.oracle.appbundlers.utils.SourceFactory;
 import com.oracle.appbundlers.utils.Utils;
@@ -39,11 +38,6 @@
     public AdditionalParams getAdditionalParams() {
         return () -> {
             Map<String, Object> hashMap = new HashMap<String, Object>();
-            hashMap.put(APPLICATION_CLASS,
-                    COM_GREETINGS_APP1_QUALIFIED_CLASS_NAME);
-            hashMap.put(MODULEPATH,
-                    ((GenericModuleParameters) this.currentParameter)
-                            .getModulePath());
             hashMap.put(ADD_MODS, getApp().addAllModules());
             return hashMap;
         };
@@ -52,8 +46,8 @@
     protected AppWrapper getApp() throws IOException {
         return new AppWrapper(Utils.getTempSubDir(WORK_DIRECTORY),
                 COM_GREETINGS_APP1_QUALIFIED_CLASS_NAME,
-                SourceFactory.get_custom_util_module(), SourceFactory
-                        .get_com_greetings_module_depends_on_custom_util_module());
+                SourceFactory.get_test_app_util_unnamed_module(), SourceFactory
+                        .get_com_greetings_module());
     }
 
     @Override
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleBundledWithMinimumModulesAnd3rdPartyModulesTest.java	Fri Jul 15 07:59:53 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleBundledWithMinimumModulesAnd3rdPartyModulesTest.java	Mon Jul 18 08:53:54 2016 -0700
@@ -13,10 +13,6 @@
 
 import com.oracle.appbundlers.tests.functionality.functionalinterface.AdditionalParams;
 import com.oracle.appbundlers.tests.functionality.functionalinterface.VerifiedOptions;
-import com.oracle.appbundlers.tests.functionality.parameters.GenericModuleParameters;
-import com.oracle.appbundlers.utils.AppWrapper;
-import com.oracle.appbundlers.utils.SourceFactory;
-import com.oracle.appbundlers.utils.Utils;
 
 /**
  * @author Ramesh BG Example 9 in chris list. Example 9: Named Module, Minimum
@@ -40,29 +36,15 @@
     public AdditionalParams getAdditionalParams() {
         return () -> {
             Map<String, Object> hashMap = new HashMap<String, Object>();
-            hashMap.put(APPLICATION_CLASS,
-                    COM_GREETINGS_APP1_QUALIFIED_CLASS_NAME);
-
-            hashMap.put(MODULEPATH,
-                    ((GenericModuleParameters) this.currentParameter)
-                            .getModulePath());
-            hashMap.put(ADD_MODS, getApp().addAllModules());
+            hashMap.put(ADD_MODS, this.currentParameter.getApp().addAllModules());
             return hashMap;
         };
     }
 
-    protected AppWrapper getApp() throws IOException {
-        return new AppWrapper(Utils.getTempSubDir(WORK_DIRECTORY),
-                COM_GREETINGS_APP1_QUALIFIED_CLASS_NAME,
-                SourceFactory.get_custom_util_module(), SourceFactory
-                        .get_com_greetings_module_depends_on_custom_util_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/NamedModuleBundledWithMinimumModulesMacroAnd3rdPartyModulesTest.java	Fri Jul 15 07:59:53 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleBundledWithMinimumModulesMacroAnd3rdPartyModulesTest.java	Mon Jul 18 08:53:54 2016 -0700
@@ -13,10 +13,6 @@
 
 import com.oracle.appbundlers.tests.functionality.functionalinterface.AdditionalParams;
 import com.oracle.appbundlers.tests.functionality.functionalinterface.VerifiedOptions;
-import com.oracle.appbundlers.tests.functionality.parameters.GenericModuleParameters;
-import com.oracle.appbundlers.utils.AppWrapper;
-import com.oracle.appbundlers.utils.SourceFactory;
-import com.oracle.appbundlers.utils.Utils;
 
 /**
  * @author Ramesh BG Example 10 in chris list Example 10: Named Module, Minimum
@@ -41,30 +37,17 @@
     protected AdditionalParams getAdditionalParams() {
         return () -> {
             Map<String, Object> hashMap = new HashMap<String, Object>();
-            hashMap.put(APPLICATION_CLASS,
-                    COM_GREETINGS_APP1_QUALIFIED_CLASS_NAME);
-            hashMap.put(MODULEPATH,
-                    ((GenericModuleParameters) this.currentParameter)
-                            .getModulePath());
             hashMap.put(ADD_MODS, MINIMUM_MODULES);
             return hashMap;
         };
     }
 
-    protected AppWrapper getApp() throws IOException {
-        return new AppWrapper(Utils.getTempSubDir(WORK_DIRECTORY),
-                COM_GREETINGS_APP1_QUALIFIED_CLASS_NAME,
-                SourceFactory.get_custom_util_module(), SourceFactory
-                        .get_com_greetings_module_depends_on_custom_util_module());
-    }
-
     @Override
     public void overrideParameters(ExtensionType intermediate)
             throws IOException {
         if (ExtensionType.NormalJar != intermediate) {
             this.currentParameter.setAdditionalParams(getAdditionalParams());
             this.currentParameter.setVerifiedOptions(getVerifiedOptions());
-            this.currentParameter.setApp(getApp());
         }
     }
 }
\ No newline at end of file
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleWithEntireJreTest.java	Fri Jul 15 07:59:53 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleWithEntireJreTest.java	Mon Jul 18 08:53:54 2016 -0700
@@ -13,7 +13,6 @@
 
 import com.oracle.appbundlers.tests.functionality.functionalinterface.AdditionalParams;
 import com.oracle.appbundlers.tests.functionality.functionalinterface.VerifiedOptions;
-import com.oracle.appbundlers.tests.functionality.parameters.GenericModuleParameters;
 import com.oracle.appbundlers.utils.AppWrapper;
 import com.oracle.appbundlers.utils.SourceFactory;
 import com.oracle.appbundlers.utils.Utils;
@@ -42,9 +41,6 @@
     protected AdditionalParams getAdditionalParams() {
         return () -> {
             Map<String, Object> hashMap = new HashMap<String, Object>();
-            hashMap.put(MODULEPATH,
-                    ((GenericModuleParameters) this.currentParameter)
-                            .getModulePath());
             hashMap.put(ADD_MODS, this.currentParameter.getApp().addAllModules());
             return hashMap;
         };
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleWithMinimumModulesTest.java	Fri Jul 15 07:59:53 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleWithMinimumModulesTest.java	Mon Jul 18 08:53:54 2016 -0700
@@ -8,13 +8,11 @@
 import static com.oracle.appbundlers.utils.installers.AbstractBundlerUtils.OUTPUT_CONTAINS;
 
 import java.io.IOException;
-import java.util.Collections;
 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.tests.functionality.parameters.GenericModuleParameters;
 import com.oracle.appbundlers.utils.AppWrapper;
 import com.oracle.appbundlers.utils.SourceFactory;
 import com.oracle.appbundlers.utils.Utils;
@@ -29,7 +27,6 @@
     public VerifiedOptions getVerifiedOptions() {
         return () -> {
             Map<String, Object> hashMap = new HashMap<String, Object>();
-            hashMap.put(APPCLASS, COM_GREETINGS_APP1_QUALIFIED_CLASS_NAME);
             hashMap.put(OUTPUT_CONTAINS, HELLO_WORLD_OUTPUT);
             hashMap.put(CHECK_MODULE_IN_JAVA_EXECUTABLE,
                     COM_GREETINGS_MODULE_CUM_PACKAGE_NAME);
@@ -41,20 +38,14 @@
         return () -> {
             HashMap<String, Object> hashMap = new HashMap<String, Object>();
             hashMap.put(ADD_MODS, COM_GREETINGS_MODULE_CUM_PACKAGE_NAME);
-            hashMap.put(MODULEPATH, ((GenericModuleParameters) this.currentParameter)
-                    .getModulePath());
             return hashMap;
         };
     }
 
     protected AppWrapper getApp() throws IOException {
-
-        Map<String, String> replacementsInSourceCode = new HashMap<String, String>();
-        replacementsInSourceCode.put(DEPENDENT_MODULE, "");
         return new AppWrapper(Utils.getTempSubDir(WORK_DIRECTORY),
                 COM_GREETINGS_APP1_QUALIFIED_CLASS_NAME,
-                SourceFactory.get_com_greetings_module(
-                        Collections.emptyMap(), replacementsInSourceCode));
+                SourceFactory.get_com_greetings_module());
     }
 
     @Override
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/UnnamedModuleDependsOn3rdPartyModulesBundledWithEntireJreTest.java	Fri Jul 15 07:59:53 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/UnnamedModuleDependsOn3rdPartyModulesBundledWithEntireJreTest.java	Mon Jul 18 08:53:54 2016 -0700
@@ -6,29 +6,26 @@
 
 import static com.oracle.appbundlers.utils.installers.AbstractBundlerUtils.CHECK_MODULE_IN_JAVA_EXECUTABLE;
 import static com.oracle.appbundlers.utils.installers.AbstractBundlerUtils.OUTPUT_CONTAINS;
+import static java.util.stream.Collectors.toSet;
 
+import java.io.File;
 import java.io.IOException;
+import java.nio.file.Path;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.testng.Assert;
-import org.testng.annotations.Test;
+import java.util.stream.Collectors;
 
 import com.oracle.appbundlers.tests.functionality.TestBase;
 import com.oracle.appbundlers.tests.functionality.functionalinterface.AdditionalParams;
+import com.oracle.appbundlers.tests.functionality.functionalinterface.BasicParams;
 import com.oracle.appbundlers.tests.functionality.functionalinterface.VerifiedOptions;
 import com.oracle.appbundlers.tests.functionality.parameters.GenericModuleParameters;
 import com.oracle.appbundlers.utils.AppWrapper;
-import com.oracle.appbundlers.utils.BundlingManager;
 import com.oracle.appbundlers.utils.SourceFactory;
 import com.oracle.appbundlers.utils.Utils;
-import com.oracle.tools.packager.ConfigException;
-
-import javafx.util.Pair;
+import com.oracle.tools.packager.RelativeFileSet;
+import com.sun.javafx.tools.packager.bundlers.BundleParams;
 
 /**
  * @author Ramesh BG Example 3 in chris list Example 3: Unnamed Module + Entire
@@ -39,12 +36,11 @@
 public class UnnamedModuleDependsOn3rdPartyModulesBundledWithEntireJreTest
         extends TestBase {
 
-    private static final Logger LOG = Logger.getLogger(UnnamedModuleDependsOn3rdPartyModulesBundledWithEntireJreTest.class.getName());
-
     protected AppWrapper getApp() throws IOException {
         return new AppWrapper(Utils.getTempSubDir(WORK_DIRECTORY),
                 COM_GREETINGS_APP1_QUALIFIED_CLASS_NAME,
                 "-XaddExports:custom.util/testapp.util=ALL-UNNAMED",
+                SourceFactory.get_custom_util_module(),
                 SourceFactory.get_com_greetings_app_unnamed_module(
                         new HashMap<String, String>() {
                             private static final long serialVersionUID = 2076100253408663958L;
@@ -53,8 +49,7 @@
                                 put(PRINTLN_STATEMENT,
                                         CUSTOM_UTIL_PRINTLN_STATEMENT);
                             }
-                        }),
-                SourceFactory.get_custom_util_module());
+                        }));
     }
 
     public VerifiedOptions getVerifiedOptions() {
@@ -70,97 +65,72 @@
     public AdditionalParams getAdditionalParams() {
         return () -> {
             Map<String, Object> hashMap = new HashMap<String, Object>();
-            hashMap.put(MODULEPATH, ((GenericModuleParameters) this.currentParameter)
-                    .getModulePath());
-            hashMap.put(APPLICATION_CLASS,
-                    COM_GREETINGS_APP1_QUALIFIED_CLASS_NAME);
-            hashMap.put(ADD_MODS, this.currentParameter.getApp().addAllModules());
+            hashMap.put(ADD_MODS,
+                    this.currentParameter.getApp().addAllModules());
             return hashMap;
         };
     }
 
     @Override
-    public void overrideParameters(ExtensionType intermediate)
-            throws IOException {
-        if (ExtensionType.NormalJar == intermediate) {
-            this.currentParameter.setAdditionalParams(getAdditionalParams());
-            this.currentParameter.setVerifiedOptions(getVerifiedOptions());
-            this.currentParameter.setApp(getApp());
+    protected void prepareTestEnvironment() throws Exception {
+        for (ExtensionType intermediate : ExtensionType.getModuleTypes()) {
+            this.currentParameter = this.intermediateToParametersMap
+                    .get(intermediate);
+            overrideParameters(intermediate);
+            initializeAndPrepareApp();
         }
     }
 
     @Override
-    public boolean isTestCaseApplicableForExtensionType(
-            ExtensionType extensionType) {
-        return ExtensionType.NormalJar != extensionType;
+    public void overrideParameters(ExtensionType intermediate)
+            throws IOException {
+        this.currentParameter.setApp(getApp());
+        this.currentParameter.setBasicParams(getBasicParams());
+        this.currentParameter.setAdditionalParams(getAdditionalParams());
+        this.currentParameter.setVerifiedOptions(getVerifiedOptions());
     }
 
     @Override
     protected void prepareApp(AppWrapper app, ExtensionType extension)
             throws IOException, ExecutionException {
-        app.preinstallApp(extension);
+        app.preinstallApp(
+                new ExtensionType[] { extension, ExtensionType.NormalJar });
         app.writeSourcesToAppDirectory();
-        app.compileApp();
-        app.jarApp(extension);
+        app.compileAndCreateExtensionEndProduct(extension);
     }
 
-    @Test(dataProvider = "getBundlers")
-    public void runTest(BundlingManager bundlingManager) throws Exception {
+    @Override
+    protected void initializeAndPrepareApp() throws Exception {
+        prepareApp(this.currentParameter.getApp(),
+                this.currentParameter.getExtension());
+    }
+
+    public BasicParams getBasicParams() throws IOException {
         /*
-         * change the implementation
-         * @TODO
-         * Need to implement the following in this testcase.
-         * normal jar file depending on modular jar
-         * normal jar file depending on jmod
-         * normal jar file depending on exploded mods
+         * there is no main module in this test since unnamed module depending
+         * on named module via -XaddExports
          */
-        for (ExtensionType extension : ExtensionType.values()) {
-            this.currentParameter = intermediateToParametersMap
-                    .get(extension);
+        return (AppWrapper app) -> {
+            Map<String, Object> basicParams = new HashMap<String, Object>();
+            basicParams.put(BundleParams.PARAM_APP_RESOURCES,
+                    new RelativeFileSet(
+                            this.currentParameter.getApp().getJarDir().toFile(),
+                            app.getJarFilesList().stream().map(Path::toFile)
+                                    .collect(toSet())));
+            basicParams.put(APPLICATION_CLASS,
+                    this.currentParameter.getApp().getMainClass());
+            basicParams.put(CLASSPATH,
+                    this.currentParameter.getApp().getJarFilesList().stream()
+                            .map(Path::getFileName).map(Path::toString)
+                            .collect(Collectors.joining(File.pathSeparator)));
+            basicParams.put(MODULEPATH, String.join(File.pathSeparator,
+                    JMODS_PATH_IN_JDK, ((GenericModuleParameters) this.currentParameter).getModulePath()));
+            return basicParams;
+        };
+    }
 
-            if (!isTestCaseApplicableForExtensionType(extension)) {
-                continue;
-            }
-
-            Map<String, Object> allParams = getAllParams(extension);
-            String testName = this.getClass().getName() + "::"
-                    + testMethod.getName() + "$" + bundlingManager.toString();
-            this.bundlingManager = bundlingManager;
-            LOG.log(Level.INFO, "Starting test \"{0}\".", testName);
-            try {
-                validate();
-                if (isConfigExceptionExpected(bundlingManager.getBundler())) {
-                    Assert.fail(
-                            "ConfigException is expected, but isn't thrown");
-                }
-            } catch (ConfigException ex) {
-                if (isConfigExceptionExpected(bundlingManager.getBundler())) {
-                    return;
-                } else {
-                    LOG.log(Level.SEVERE, "Configuration error: {0}.",
-                            new Object[] { ex });
-                    throw ex;
-                }
-            }
-
-            try {
-                bundlingManager.execute(allParams,
-                        this.currentParameter.getApp());
-                String path = bundlingManager.install(
-                        this.currentParameter.getApp(), getResultingAppName(),
-                        false);
-                LOG.log(Level.INFO, "Installed at: {0}", path);
-
-                Pair<TimeUnit, Integer> tuple = getDelayAfterInstall();
-                tuple.getKey().sleep(tuple.getValue());
-                AppWrapper app2 = this.currentParameter.getApp();
-                this.currentParameter.getVerifiedOptions().forEach(
-                        (name, value) -> bundlingManager.verifyOption(name,
-                                value, app2, getResultingAppName()));
-            } finally {
-                uninstallApp(extension);
-                LOG.log(Level.INFO, "Finished test: {0}", testName);
-            }
-        }
+    @Override
+    public ExtensionType[] getExtensionArray() {
+        return ExtensionType.getModuleTypes();
     }
-}
\ No newline at end of file
+}