changeset 322:16542d3f79a9

8161451: Code refactoring to remove unneccesary folders created in javapackager testsuite Contributed-by: ramesh.gangadhar@oracle.com Reviewed-by: cbensen
author cbensen
date Fri, 15 Jul 2016 07:59:53 -0700
parents 38b47fad68a9
children a141695f4a7f
files 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/Constants.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/DefaultClassPathTest.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/FileAssociationTest.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/TestBase.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleWithEntireJreTest.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/UnnamedModuleDependsOn3rdPartyModulesBundledWithEntireJreTest.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/UnnamedModuleDependsOnOtherJarsBundledWithEntireJre.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 functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/loading/BundlerLoadingTest.java
diffstat 17 files changed, 295 insertions(+), 170 deletions(-) [+]
line wrap: on
line diff
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/AppBundlersSampleGUI.java	Tue Jul 12 06:58:47 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/AppBundlersSampleGUI.java	Fri Jul 15 07:59:53 2016 -0700
@@ -94,14 +94,14 @@
                 );
                 System.out.println(
                         "Writing app to app directory: " + app.getWorkDir());
-                app.preinstallApp();
+//                app.preinstallApp();
                 app.writeSourcesToAppDirectory();
                 app.compileApp();
-                try {
-                    app.jarApp();
-                } catch (Exception e1) {
-                    e1.printStackTrace();
-                }
+//                try {
+//                    app.jarApp();
+//                } catch (Exception e1) {
+//                    e1.printStackTrace();
+//                }
 
                 System.out
                         .println("Building app with app the suitable Bundlers");
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/GUI.java	Tue Jul 12 06:58:47 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/GUI.java	Fri Jul 15 07:59:53 2016 -0700
@@ -111,15 +111,15 @@
                 }));
                 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();
-                }
+//                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");
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/AppWrapper.java	Tue Jul 12 06:58:47 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/AppWrapper.java	Fri Jul 15 07:59:53 2016 -0700
@@ -43,6 +43,8 @@
 import javax.tools.JavaCompiler;
 import javax.tools.ToolProvider;
 
+import com.oracle.appbundlers.tests.functionality.jdk9test.ExtensionType;
+
 import javafx.util.Pair;
 
 /**
@@ -58,7 +60,7 @@
     private final String mainJar;
     private final String mainClass;
 
-    private String paramsForCompilation;
+    private String paramsForJarsCompilation;
 
     public AppWrapper(Path workDir, String mainClass, Source... source) {
         this.workDir = workDir;
@@ -77,7 +79,7 @@
     public AppWrapper(Path workDir, String mainClass,
             String paramsForCompilation, Source... source) {
         this(workDir, mainClass, source);
-        this.paramsForCompilation = paramsForCompilation;
+        this.paramsForJarsCompilation = paramsForCompilation;
     }
 
     /**
@@ -94,24 +96,22 @@
         return mainClass.substring(mainClass.lastIndexOf('.') + 1);
     }
 
-    public void preinstallApp() throws IOException {
+    public void preinstallApp(ExtensionType extension) throws IOException {
         Utils.createDir(getSrcDir());
         Utils.createDir(getBundlesDir());
+        Utils.createDir(getBinDir());
 
         if (!getJarTempSources().isEmpty()) {
             Utils.createDir(getJarDir());
-            Utils.createDir(getClassesDir());
         }
 
         if (!getModuleTempSources().isEmpty()) {
-            createEachModuleDirInModsDir();
-            Utils.createDir(getExplodedModsDir());
-            Utils.createDir(getJmodsDir());
-            Utils.createDir(getModularJarsDir());
+            Utils.createDir(
+                    Paths.get(getModulePathBasedOnExtension(extension)));
         }
     }
 
-    public List<Source> getJarTempSources() {
+    private List<Source> getJarTempSources() {
         return sources.stream().filter((source) -> !source.isModule())
                 .collect(Collectors.toList());
     }
@@ -136,7 +136,7 @@
         return getWorkDir().resolve(BUNDLES);
     }
 
-    public Path getSrcDir() {
+    private Path getSrcDir() {
         return getWorkDir().resolve(SOURCE);
     }
 
@@ -144,18 +144,14 @@
         return getWorkDir().resolve(JARS);
     }
 
-    public Path getClassesDir() {
-        return getWorkDir().resolve(CLASSES);
+    private Path getBinDir() {
+        return getWorkDir().resolve(BIN);
     }
 
     public Path getMainJarFile() {
         return getJarDir().resolve(mainJar + ".jar");
     }
 
-    public void cleanupApp() {
-        Utils.tryRemoveRecursive(getWorkDir());
-    }
-
     public void writeSourcesToAppDirectory() throws IOException {
         Path appDir = getSrcDir();
         for (Source source : getModuleTempSources()) {
@@ -167,14 +163,17 @@
         }
     }
 
-    public int compileApp(Path... classpath) throws IOException {
-        return compileApp(new String[0], classpath);
+    public int compileApp(ExtensionType extension, Path... classpath)
+            throws IOException {
+        return compileApp(new String[0], extension, classpath);
     }
 
-    public int compileApp(String[] javacOptions, Path... classpath)
-            throws IOException {
-        int resultForModule = compileAppForModules(javacOptions, classpath);
-        int resultForJar = compileAppForJars(javacOptions, classpath);
+    private int compileApp(String[] javacOptions, ExtensionType extension,
+            Path... classpath) throws IOException {
+        int resultForModule = compileAppForModules(javacOptions, extension,
+                classpath);
+        int resultForJar = compileAppForJars(javacOptions, extension,
+                classpath);
         int result = 0;
         if (resultForJar < 0 || resultForModule < 0) {
             result = -1;
@@ -182,8 +181,17 @@
         return result;
     }
 
-    public int compileAppForJars(String[] javacOptions, Path... classpath)
+    public int compileApp(Path... classpath) throws IOException {
+        return compileApp(new String[0], classpath);
+    }
+
+    public int compileApp(String[] javacOptions, Path... classpath)
             throws IOException {
+        return compileApp(javacOptions, null, classpath);
+    }
+
+    private int compileAppForJars(String[] javacOptions,
+            ExtensionType extension, Path[] classpath) throws IOException {
         if (getJarTempSources().isEmpty()) {
             return 0;
         }
@@ -198,8 +206,12 @@
         }
 
         argsList.add("-d");
-        argsList.add(getClassesDir().toString());
+        argsList.add(getBinDir().toString());
+
+        int result = 0;
         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);
@@ -209,34 +221,45 @@
                         BasicFileAttributes attr) {
 
                     if (file.toString().endsWith(".java")) {
-                        argsList.add(file.toString());
+                        newArgs.add(file.toString());
                     }
                     return FileVisitResult.CONTINUE;
                 }
             });
+
+            newArgs.add("-classpath");
+            if (classpath.length != 0) {
+                newArgs.add(Stream.of(classpath)
+                        .map(eachPath -> eachPath.toAbsolutePath().toString())
+                        .collect(joining(File.pathSeparator)));
+            } else {
+                newArgs.add(getBinDir().toString());
+            }
+
+            if (paramsForJarsCompilation != null) {
+                newArgs.add(this.paramsForJarsCompilation);
+            }
+
+            if (extension != null) {
+                newArgs.add("-mp");
+                newArgs.add(String.join(File.pathSeparator, getModulePathBasedOnExtension(extension), JMODS_PATH_IN_JDK));
+            }
+
+            ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+            System.out.println(
+                    "====================COMPILATION STARTS===========================");
+            System.out.println("compilation command for jars is " + newArgs);
+            result = compiler.run(System.in, outputStream, System.err,
+                    newArgs.toArray(new String[newArgs.size()]));
+            System.out.println(
+                    "===================COMPILATION ENDS===============================");
+            System.out.println();
         }
-
-        if (classpath.length != 0) {
-            argsList.add("-classpath");
-            argsList.add(Stream.of(classpath)
-                    .map(path -> path.toAbsolutePath().toString())
-                    .collect(joining(File.pathSeparator)));
-        }
-
-        if (paramsForCompilation != null) {
-            argsList.add(this.paramsForCompilation);
-        }
-
-        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-        System.out.println("compilation command for jars is " + argsList);
-        int result = compiler.run(System.in, outputStream, System.err,
-                argsList.toArray(new String[argsList.size()]));
-
         return result;
     }
 
-    public int compileAppForModules(String[] javacOptions, Path... classpath)
-            throws IOException {
+    private int compileAppForModules(String[] javacOptions,
+            ExtensionType extension, Path... classpath) throws IOException {
         if (getModuleTempSources().isEmpty()) {
             return 0;
         }
@@ -253,11 +276,13 @@
             }
 
             argsList.add("-mp");
-            argsList.add(getExplodedModsDir().toString());
+            argsList.add(String.join(File.pathSeparator, getBinDir().toString(), JMODS_PATH_IN_JDK));
             argsList.add("-d");
-            argsList.add(String.join(File.separator, getExplodedModsDir().toString(), source.getModuleName()));
+            argsList.add(String.join(File.separator, getBinDir().toString(),
+                    source.getModuleName()));
             Files.walkFileTree(
-                    Paths.get(String.join(File.separator, getSrcDir().toString() , source.getModuleName())),
+                    Paths.get(String.join(File.separator,
+                            getSrcDir().toString(), source.getModuleName())),
                     new SimpleFileVisitor<Path>() {
                         public FileVisitResult visitFile(Path file,
                                 BasicFileAttributes attr) {
@@ -274,19 +299,23 @@
                         .collect(joining(File.pathSeparator)));
             }
             ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-            System.out
-                    .println("compilation command for modules is " + argsList);
+            System.out.println(
+                    "====================COMPILATION STARTS===========================");
+            System.out.println(
+                    "compilation command for " + extension + " is " + argsList);
+
             int tempResult = compiler.run(System.in, outputStream, System.err,
                     argsList.toArray(new String[argsList.size()]));
             if (tempResult != 0) {
                 result = tempResult;
             }
-            // TODO: Improve output?
             String out = outputStream.toString();
             if (!out.trim().isEmpty()) {
                 LOG.log(Level.INFO, out);
             }
-
+            System.out.println(
+                    "===================COMPILATION ENDS===============================");
+            System.out.println();
         }
         return result;
     }
@@ -345,7 +374,7 @@
 
     private void add(JarOutputStream jarStream, Set<Source> sources)
             throws IOException {
-        Path classesDir = getClassesDir();
+        Path classesDir = getBinDir();
         for (Source src : sources) {
             Path packageDir = classesDir
                     .resolve(src.getPackageName().replace('.', '/'));
@@ -363,23 +392,15 @@
         }
     }
 
-    public Path getExplodedModsDir() {
-        return getWorkDir().resolve(EXPLODED_MODS_DIR_IN_SRC);
-    }
-
-    private void createEachModuleDirInModsDir() throws IOException {
-        for (Source source : getModuleTempSources()) {
-            String directoryToCreate = String.join(File.separator,
-                    getExplodedModsDir().toString(), source.getModuleName());
-            Utils.createDir(Paths.get(directoryToCreate));
-        }
-    }
-
     public List<Source> getModuleTempSources() {
         return sources.stream().filter((source) -> source.isModule())
                 .collect(Collectors.toList());
     }
 
+    public Path getExplodedModsDir() {
+        return getBinDir();
+    }
+
     public Path getJmodsDir() {
         return getWorkDir().resolve(JMODS_DIR);
     }
@@ -419,9 +440,24 @@
         }
     }
 
-    public void jarApp() throws IOException, ExecutionException {
-        createSimpleJar(Collections.emptyList(), false);
-        createModularJar(Collections.emptyList(), false);
+    public void jarApp(ExtensionType extension)
+            throws IOException, ExecutionException {
+        switch (extension) {
+        case NormalJar:
+            createSimpleJar(Collections.emptyList(), false);
+            break;
+        case ModularJar:
+            createModularJar(Collections.emptyList(), false);
+            break;
+        case ExplodedModules: /******************************************
+                               * bin directory itself is exploded modules
+                               * directory
+                               ******************************************/
+            break;
+        case Jmods:
+            createJmod();
+            break;
+        }
     }
 
     public void jarApp(List<Pair<String, String>> services,
@@ -430,23 +466,28 @@
         createModularJar(services, crossClassPath);
     }
 
-    public void createJmod() throws IOException, ExecutionException {
+    private void createJmod() throws IOException, ExecutionException {
         for (Source source : getModuleTempSources()) {
             List<String> command = new ArrayList<String>();
             command.add("jmod");
             command.add("create");
             command.add("--class-path");
-            command.add(getModularJarsDir() + File.separator + source.getJarName()
-                    + ".jar");
+            command.add(getBinDir().toString() + File.separator
+                    + source.getModuleName());
             command.add("--main-class");
             command.add(source.getFullName());
             command.add(getJmodsDir() + File.separator + source.getModuleName()
                     + ".jmod");
+            System.out.println(
+                    "=========================JMOD CREATION STARTS=========================");
             Utils.runCommand(command, CONFIG_INSTANCE.getInstallTimeout());
+            System.out.println(
+                    "=========================JMOD CREATION ENDS===========================");
+            System.out.println();
         }
     }
 
-    public void createModularJar(List<Pair<String, String>> services,
+    private void createModularJar(List<Pair<String, String>> services,
             boolean crossClassPath) throws IOException, ExecutionException {
 
         if (getModuleTempSources().isEmpty()) {
@@ -579,11 +620,15 @@
                 }
                 command.add("-C");
                 String moduleAbsouleDirectoryPath = String.join(File.separator,
-                        getExplodedModsDir().toString(),
-                        source.getModuleName());
+                        getBinDir().toString(), source.getModuleName());
                 command.add(moduleAbsouleDirectoryPath);
                 command.add(".");
+                System.out.println(
+                        "====================MODULAR JAR CREATION STARTS==================");
                 Utils.runCommand(command, CONFIG_INSTANCE.getInstallTimeout());
+                System.out.println(
+                        "====================MODULAR JAR CREATION ENDS====================");
+                System.out.println();
             }
         }
     }
@@ -623,4 +668,20 @@
     public boolean isAppContainsModules() {
         return !getModuleTempSources().isEmpty();
     }
+
+    private String getModulePathBasedOnExtension(ExtensionType extension) {
+        if (extension == null) {
+            throw new NullPointerException("Extension cannot be null");
+        }
+        switch (extension) {
+        case ModularJar:
+            return getModularJarsDir().toString();
+        case ExplodedModules:
+            return getExplodedModsDir().toString();
+        case Jmods:
+            return getJmodsDir().toString();
+        default:
+            return getJarDir().toString();
+        }
+    }
 }
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/Constants.java	Tue Jul 12 06:58:47 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/Constants.java	Fri Jul 15 07:59:53 2016 -0700
@@ -47,7 +47,7 @@
     String MAC_CATEGORY = "mac.category";
     String MAC_CF_BUNDLE_NAME = "mac.CFBundleName";
     String SIGNING_KEY_USER = "mac.signing-key-user-name";
-    String LinuxDebBundler_BUNDLE_NAME = "";
+    String LinuxDebBundler_BUNDLE_NAME = "linux.bundleName";
     String MAINTAINER = "";
     String LinuxRpmBundler_BUNDLE_NAME = "linux.bundleName";
     String MSI_SYSTEM_WIDE = "systemWide";
@@ -104,8 +104,7 @@
     String COM_GREETINGS_APP1_QUALIFIED_CLASS_NAME = "com.greetings.App1";
     String COM_GREETINGS_APP2_QUALIFIED_CLASS_NAME = "com.greetings.App2";
     String COM_GREETINGS_JAR_NAME = "com.greetings";
-    String JMODS_PATH_IN_JDK = System.getProperty("java.home") + File.separator
-            + "jmods";
+    String JMODS_PATH_IN_JDK = String.join(File.separator, System.getProperty("java.home"), "jmods");
     String COM_GREETINGS_MODULE_INFO_TEMPLATE = "com.greetings.module.info.template";
     String SYSTEM_OUT_PRINTLN = "System.out.println";
     String COM_GREETINGS_MODULE_CUM_PACKAGE_NAME = "com.greetings";
@@ -127,7 +126,7 @@
     String CUSTOM_UTIL_UNNAMED_MODULE_FULLY_QUALIFIED_CLASS_NAME = "testapp.util.Util";
     String CUSTOM_UTIL_UNNAMED_MODULE_PACKAGE_STATEMENT = "testapp.util";
     String INSTALLDIR_CHOOSER = "installdirChooser";
-    String CUSTOM_UTIL_APPEND_CLASS_NAME_PRINT_METHOD = "testapp.Util.appendClassNameToPrint";
+    String CUSTOM_UTIL_APPEND_CLASS_NAME_PRINT_METHOD = "testapp.util.Util.appendClassNameToPrint";
     String MAIN_MODULE = "module";
     String APP1_NAME = "App1";
     String APP_RESOURCES = "appResources";
@@ -141,9 +140,9 @@
      */
     String BUNDLES = "bundles";
     String SOURCE = "src";
-    String CLASSES = "build" + File.separator + "classes";
+    String BIN = "bin";
     String JARS = "jars";
-    String EXPLODED_MODS_DIR_IN_SRC = "explodedmods";
+    String EXPLODED_MODS_DIR = "explodedmods";
     String JMODS_DIR = "jmods";
     String MODULAR_JARS_DIR = "modjars";
     String APP1_FULLNAME = packageName + "." + APP1_NAME;
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/DefaultClassPathTest.java	Tue Jul 12 06:58:47 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/DefaultClassPathTest.java	Fri Jul 15 07:59:53 2016 -0700
@@ -48,9 +48,9 @@
     }
 
     @Override
-    protected void prepareApp(AppWrapper app)
+    protected void prepareApp(AppWrapper app, ExtensionType extension)
             throws IOException, ExecutionException {
-        app.preinstallApp();
+        app.preinstallApp(extension);
         app.writeSourcesToAppDirectory();
         app.compileApp();
         app.jarApp(Collections.emptyList(), true);
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/FileAssociationTest.java	Tue Jul 12 06:58:47 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/FileAssociationTest.java	Fri Jul 15 07:59:53 2016 -0700
@@ -116,12 +116,12 @@
     }
 
     @Override
-    protected void prepareApp(AppWrapper app) throws IOException, ExecutionException {
+    protected void prepareApp(AppWrapper app, ExtensionType extension) throws IOException, ExecutionException {
         final String makeJavacReadClassesFromRtJar = "-XDignore.symbol.file=true";
-        app.preinstallApp();
+        app.preinstallApp(extension);
         app.writeSourcesToAppDirectory();
         app.compileApp(new String[] { makeJavacReadClassesFromRtJar });
-        app.jarApp();
+        app.jarApp(extension);
     }
 
     @Override
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/TestBase.java	Tue Jul 12 06:58:47 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/TestBase.java	Fri Jul 15 07:59:53 2016 -0700
@@ -49,9 +49,6 @@
 import org.testng.annotations.Test;
 
 import com.oracle.appbundlers.tests.BundlerProvider;
-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.jdk9test.ExtensionType;
 import com.oracle.appbundlers.tests.functionality.parameters.ExplodedModuleParameters;
 import com.oracle.appbundlers.tests.functionality.parameters.JmodParameters;
@@ -95,13 +92,6 @@
         }
     };
 
-    /*
-     * Functional Interface References
-     */
-    protected AdditionalParams additionalParams;
-    protected BasicParams basicParams;
-    protected VerifiedOptions verifiedOptions;
-
     private static final Logger LOG = Logger
             .getLogger(TestBase.class.getName());
 
@@ -111,12 +101,10 @@
     // all these implementations are just "default-values"
     protected BundlerUtils[] getBundlerUtils() {
         return BundlerUtils.values();
-//        return new BundlerUtils[] { BundlerUtils.EXE};
     }
 
     protected BundlingManagers[] getBundlingManagers() {
         return BundlingManagers.values();
-//        return new BundlingManagers[] { BundlingManagers.CLI};
     }
 
     /**
@@ -130,13 +118,12 @@
         return false;
     }
 
-    protected void prepareApp(final AppWrapper app)
+    protected void prepareApp(final AppWrapper app, ExtensionType extension)
             throws IOException, ExecutionException {
-        app.preinstallApp();
+        app.preinstallApp(extension);
         app.writeSourcesToAppDirectory();
         app.compileApp();
-        app.jarApp();
-        app.createJmod();
+        app.jarApp(extension);
     }
 
     @BeforeClass
@@ -158,12 +145,12 @@
         }
     }
 
-    private void initializeAndPrepareApp()
-            throws Exception {
+    private void initializeAndPrepareApp() throws Exception {
         if (this.currentParameter.getApp() == null) {
             this.currentParameter.initializeDefaultApp();
         }
-        prepareApp(this.currentParameter.getApp());
+        prepareApp(this.currentParameter.getApp(),
+                this.currentParameter.getExtension());
     }
 
     @BeforeMethod
@@ -173,15 +160,15 @@
 
     @Test(dataProvider = "getBundlers")
     public void runTest(BundlingManager bundlingManager) throws Exception {
-        for (ExtensionType intermediate : ExtensionType.values()) {
+        for (ExtensionType extension : ExtensionType.values()) {
             this.currentParameter = intermediateToParametersMap
-                    .get(intermediate);
+                    .get(extension);
 
-            if (!isTestCaseApplicableForExtensionType(intermediate)) {
+            if (!isTestCaseApplicableForExtensionType(extension)) {
                 continue;
             }
 
-            Map<String, Object> allParams = getAllParams(intermediate);
+            Map<String, Object> allParams = getAllParams(extension);
             String testName = this.getClass().getName() + "::"
                     + testMethod.getName() + "$" + bundlingManager.toString();
             this.bundlingManager = bundlingManager;
@@ -217,7 +204,7 @@
                         (name, value) -> bundlingManager.verifyOption(name,
                                 value, app2, getResultingAppName()));
             } finally {
-                uninstallApp(intermediate);
+                uninstallApp(extension);
                 LOG.log(Level.INFO, "Finished test: {0}", testName);
             }
         }
@@ -228,7 +215,7 @@
         return true;
     }
 
-    private void uninstallApp(ExtensionType intermediate) throws Exception {
+    protected void uninstallApp(ExtensionType intermediate) throws Exception {
         if (bundlingManager != null) {
             String appName = bundlingManager
                     .getAppName(getAllParams(intermediate));
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleWithEntireJreTest.java	Tue Jul 12 06:58:47 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleWithEntireJreTest.java	Fri Jul 15 07:59:53 2016 -0700
@@ -42,12 +42,10 @@
     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, getApp().addAllModules());
+            hashMap.put(ADD_MODS, this.currentParameter.getApp().addAllModules());
             return hashMap;
         };
     }
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/UnnamedModuleDependsOn3rdPartyModulesBundledWithEntireJreTest.java	Tue Jul 12 06:58:47 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/UnnamedModuleDependsOn3rdPartyModulesBundledWithEntireJreTest.java	Fri Jul 15 07:59:53 2016 -0700
@@ -10,14 +10,25 @@
 import java.io.IOException;
 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 com.oracle.appbundlers.tests.functionality.TestBase;
 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.BundlingManager;
 import com.oracle.appbundlers.utils.SourceFactory;
 import com.oracle.appbundlers.utils.Utils;
+import com.oracle.tools.packager.ConfigException;
+
+import javafx.util.Pair;
 
 /**
  * @author Ramesh BG Example 3 in chris list Example 3: Unnamed Module + Entire
@@ -28,6 +39,8 @@
 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,
@@ -61,7 +74,7 @@
                     .getModulePath());
             hashMap.put(APPLICATION_CLASS,
                     COM_GREETINGS_APP1_QUALIFIED_CLASS_NAME);
-            hashMap.put(ADD_MODS, getApp().addAllModules());
+            hashMap.put(ADD_MODS, this.currentParameter.getApp().addAllModules());
             return hashMap;
         };
     }
@@ -81,4 +94,73 @@
             ExtensionType extensionType) {
         return ExtensionType.NormalJar != extensionType;
     }
+
+    @Override
+    protected void prepareApp(AppWrapper app, ExtensionType extension)
+            throws IOException, ExecutionException {
+        app.preinstallApp(extension);
+        app.writeSourcesToAppDirectory();
+        app.compileApp();
+        app.jarApp(extension);
+    }
+
+    @Test(dataProvider = "getBundlers")
+    public void runTest(BundlingManager bundlingManager) throws Exception {
+        /*
+         * 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
+         */
+        for (ExtensionType extension : ExtensionType.values()) {
+            this.currentParameter = intermediateToParametersMap
+                    .get(extension);
+
+            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);
+            }
+        }
+    }
 }
\ No newline at end of file
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/UnnamedModuleDependsOnOtherJarsBundledWithEntireJre.java	Tue Jul 12 06:58:47 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/UnnamedModuleDependsOnOtherJarsBundledWithEntireJre.java	Fri Jul 15 07:59:53 2016 -0700
@@ -34,6 +34,7 @@
     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_app_unnamed_module(
                         new HashMap<String, String>() {
                             /**
@@ -45,8 +46,8 @@
                                 put(PRINTLN_STATEMENT,
                                         CUSTOM_UTIL_APPEND_CLASS_NAME_PRINT_METHOD);
                             }
-                        }),
-                SourceFactory.get_test_app_util_unnamed_module());
+                        })
+                );
     }
 
     protected VerifiedOptions getVerifiedOptions() {
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/ExplodedModuleParameters.java	Tue Jul 12 06:58:47 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/ExplodedModuleParameters.java	Fri Jul 15 07:59:53 2016 -0700
@@ -4,19 +4,14 @@
  */
 package com.oracle.appbundlers.tests.functionality.parameters;
 
-import static java.util.stream.Collectors.toSet;
-
 import java.io.File;
-import java.nio.file.Path;
 import java.util.HashMap;
 import java.util.Map;
 
 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.utils.AppWrapper;
-import com.oracle.tools.packager.RelativeFileSet;
-import com.sun.javafx.tools.packager.bundlers.BundleParams;
+import com.oracle.appbundlers.tests.functionality.jdk9test.ExtensionType;
 
 /**
  * @author Ramesh BG
@@ -33,13 +28,10 @@
     public ExplodedModuleParameters() {
     }
 
-    public Map<String, Object> getBasicParams(AppWrapper app) throws Exception {
+    @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,
-                new RelativeFileSet(app.getExplodedModsDir().toFile(),
-                        app.getExplodedModFileList().stream().map(Path::toFile)
-                                .collect(toSet())));
         basicParams.put(MODULEPATH, String.join(File.pathSeparator,
                 JMODS_PATH_IN_JDK, app.getExplodedModsDir().toString()));
         return requireNonNull(getBasicParamsFunctionalInterface(), basicParams);
@@ -49,4 +41,9 @@
     public String getModulePath() {
         return app.getExplodedModsDir().toString();
     }
+
+    @Override
+    public ExtensionType getExtension() {
+        return ExtensionType.ExplodedModules;
+    }
 }
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/GenericModuleParameters.java	Tue Jul 12 06:58:47 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/GenericModuleParameters.java	Fri Jul 15 07:59:53 2016 -0700
@@ -40,8 +40,7 @@
     @Override
     public Map<String, Object> getBasicParams() throws Exception {
         Map<String, Object> basicParams = new HashMap<String, Object>();
-        basicParams.put(MAIN_MODULE,
-                app.getMainModuleName() + "/" + app.getMainClass());
+        basicParams.put(MAIN_MODULE, String.join("/", app.getMainModuleName(), app.getMainClass()));
         return basicParams;
     }
 
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/JmodParameters.java	Tue Jul 12 06:58:47 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/JmodParameters.java	Fri Jul 15 07:59:53 2016 -0700
@@ -4,19 +4,14 @@
  */
 package com.oracle.appbundlers.tests.functionality.parameters;
 
-import static java.util.stream.Collectors.toSet;
-
 import java.io.File;
-import java.nio.file.Path;
 import java.util.HashMap;
 import java.util.Map;
 
 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.utils.AppWrapper;
-import com.oracle.tools.packager.RelativeFileSet;
-import com.sun.javafx.tools.packager.bundlers.BundleParams;
+import com.oracle.appbundlers.tests.functionality.jdk9test.ExtensionType;
 
 /**
  * @author Ramesh BG
@@ -33,13 +28,10 @@
     public JmodParameters() {
     }
 
-    public Map<String, Object> getBasicParams(AppWrapper app) throws Exception {
+    @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,
-                new RelativeFileSet(app.getJmodsDir().toFile(),
-                        app.getJmodFileList().stream().map(Path::toFile)
-                                .collect(toSet())));
         basicParams.put(MODULEPATH, String.join(File.pathSeparator,
                 JMODS_PATH_IN_JDK, app.getJmodsDir().toString()));
         return requireNonNull(getBasicParamsFunctionalInterface(), basicParams);
@@ -49,4 +41,9 @@
     public String getModulePath() {
         return app.getJmodsDir().toString();
     }
+
+    @Override
+    public ExtensionType getExtension() {
+        return ExtensionType.Jmods;
+    }
 }
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/ModularJarParameters.java	Tue Jul 12 06:58:47 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/ModularJarParameters.java	Fri Jul 15 07:59:53 2016 -0700
@@ -4,18 +4,14 @@
  */
 package com.oracle.appbundlers.tests.functionality.parameters;
 
-import static java.util.stream.Collectors.toSet;
-
 import java.io.File;
-import java.nio.file.Path;
 import java.util.HashMap;
 import java.util.Map;
 
 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.tools.packager.RelativeFileSet;
-import com.sun.javafx.tools.packager.bundlers.BundleParams;
+import com.oracle.appbundlers.tests.functionality.jdk9test.ExtensionType;
 
 /**
  * @author Ramesh BG
@@ -35,10 +31,6 @@
     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,
-                new RelativeFileSet(app.getModularJarsDir().toFile(),
-                        app.getModularJarFileList().stream().map(Path::toFile)
-                                .collect(toSet())));
         basicParams.put(MODULEPATH, String.join(File.pathSeparator,
                 JMODS_PATH_IN_JDK, app.getModularJarsDir().toString()));
         return requireNonNull(getBasicParamsFunctionalInterface(), basicParams);
@@ -48,4 +40,9 @@
     public String getModulePath() {
         return app.getModularJarsDir().toString();
     }
+
+    @Override
+    public ExtensionType getExtension() {
+        return ExtensionType.ModularJar;
+    }
 }
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/NormalJarParameters.java	Tue Jul 12 06:58:47 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/NormalJarParameters.java	Fri Jul 15 07:59:53 2016 -0700
@@ -18,6 +18,7 @@
 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.jdk9test.ExtensionType;
 import com.oracle.appbundlers.utils.AppWrapper;
 import com.oracle.appbundlers.utils.SourceFactory;
 import com.oracle.appbundlers.utils.Utils;
@@ -40,9 +41,7 @@
     public void initializeDefaultApp() throws IOException {
         setApp(new AppWrapper(Utils.getTempSubDir(WORK_DIRECTORY),
                 COM_GREETINGS_APP1_QUALIFIED_CLASS_NAME,
-                SourceFactory
-                        .get_com_greetings_app_unnamed_module()
-                ));
+                SourceFactory.get_com_greetings_app_unnamed_module()));
     }
 
     public NormalJarParameters() {
@@ -69,4 +68,9 @@
         basicParams.put(APPLICATION_CLASS, mainClass);
         return requireNonNull(getBasicParamsFunctionalInterface(), basicParams);
     }
+
+    @Override
+    public ExtensionType getExtension() {
+        return ExtensionType.NormalJar;
+    }
 }
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/Parameters.java	Tue Jul 12 06:58:47 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/parameters/Parameters.java	Fri Jul 15 07:59:53 2016 -0700
@@ -11,6 +11,7 @@
 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.jdk9test.ExtensionType;
 import com.oracle.appbundlers.utils.AppWrapper;
 import com.oracle.appbundlers.utils.Constants;
 
@@ -91,4 +92,6 @@
         }
         return defaultValue;
     }
+
+    public abstract ExtensionType getExtension();
 }
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/loading/BundlerLoadingTest.java	Tue Jul 12 06:58:47 2016 -0700
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/loading/BundlerLoadingTest.java	Fri Jul 15 07:59:53 2016 -0700
@@ -77,10 +77,10 @@
 //                fullName,
 //                new Source(fullName, implClass + ".java.template", implClass)
 //        );
-        app.cleanupApp();
-        app.preinstallApp();
-        app.writeSourcesToAppDirectory();
-        app.compileApp();
+//        app.cleanupApp();
+//        app.preinstallApp();
+//        app.writeSourcesToAppDirectory();
+//        app.compileApp();
 //        app.jarApp(Arrays.asList(new Pair<>(interfaceClass, fullName)));
         return app;
     }