changeset 349:0b702e5db31c

8171967: javapackager testsuite issues in jdk9 Reviewed-by: cbensen
author rgangadhar
date Tue, 03 Jan 2017 21:28:20 +0530
parents 917b77e1b81f
children c6b7a1a88875
files functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/AppWrapper.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/BundlingManager.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/installers/LinuxAbstractBundlerUtils.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/installers/MacAbstractBundlerUtils.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/installers/WinAbstractBundlerUtils.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/resources/testapp.examplebundler.module.info.template functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/resources/testapp.examplebundlers.module.info.template functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/UserFriendlyJvmOptionsTest.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/AddModuleTest.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/JmodExplodedModuleAndModularJarDependencyTest.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/NamedModuleBundledWithMinimumModulesAnd3rdPartyModulesTest.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleDependsOn3rdPartyModulesTest.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/UnNamedModuleDependsOn3rdPartyModulesTest.java functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/UnNamedModuleDependsOnOtherJarsTest.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/loading/BundlerLoadingTest.java
diffstat 21 files changed, 627 insertions(+), 511 deletions(-) [+]
line wrap: on
line diff
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/AppWrapper.java	Tue Dec 20 20:46:32 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/AppWrapper.java	Tue Jan 03 21:28:20 2017 +0530
@@ -252,11 +252,13 @@
 
             newArgs.add("-classpath");
             if (classpath.length != 0) {
-                newArgs.add(
-                        Stream.of(classpath)
-                                .map(eachPath -> eachPath.toAbsolutePath()
-                                        .toString())
-                        .collect(joining(File.pathSeparator)));
+                try(Stream<String> map = Stream.of(classpath)
+                        .map(eachPath -> eachPath.toAbsolutePath()
+                                .toString())) {
+                    newArgs.add(
+                            map
+                            .collect(joining(File.pathSeparator)));
+                }
             } else {
                 newArgs.add(getBinDir().toString());
             }
@@ -266,7 +268,7 @@
             }
 
             if (extension != null) {
-                newArgs.add(DOUBLE_HYPHEN+MODULEPATH);
+                newArgs.add(DOUBLE_HYPHEN + MODULEPATH);
                 newArgs.add(String.join(File.pathSeparator,
                         getModulePathBasedOnExtension(extension),
                         JMODS_PATH_IN_JDK));
@@ -335,9 +337,11 @@
                     });
             if (classpath.length != 0) {
                 argsList.add("-classpath");
-                argsList.add(Stream.of(classpath)
-                        .map(path -> path.toAbsolutePath().toString())
-                        .collect(joining(File.pathSeparator)));
+                try(Stream<String> map = Stream.of(classpath)
+                        .map(path -> path.toAbsolutePath().toString())) {
+                    argsList.add(map
+                            .collect(joining(File.pathSeparator)));
+                }
             }
             ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
             if (extension != null) {
@@ -413,14 +417,16 @@
                     Files.newOutputStream(jarFile), manifest)) {
                 add(jarOutputStream, new HashSet<>(entry.getValue()));
                 for (Pair<String, String> service : services) {
-                    if (!entry.getValue().stream().anyMatch(source -> source
-                            .getFullName().equals(service.getValue()))) {
-                        continue;
+                    try(Stream<Source> stream = entry.getValue().stream()) {
+                        if (!stream.anyMatch(source -> source
+                                .getFullName().equals(service.getValue()))) {
+                            continue;
+                        }
+                        jarOutputStream.putNextEntry(new JarEntry(
+                                "META-INF/services/" + service.getKey()));
+                        jarOutputStream.write(service.getValue().getBytes());
+                        jarOutputStream.closeEntry();
                     }
-                    jarOutputStream.putNextEntry(new JarEntry(
-                            "META-INF/services/" + service.getKey()));
-                    jarOutputStream.write(service.getValue().getBytes());
-                    jarOutputStream.closeEntry();
                 }
             }
         }
@@ -433,15 +439,16 @@
             Path packageDir = classesDir
                     .resolve(src.getPackageName().replace('.', '/'));
             // we need to process inner classes like App1$1
-            DirectoryStream<Path> classFiles = newDirectoryStream(packageDir,
-                    src.getSimpleName() + "*.class");
-            for (Path classFile : classFiles) {
-                ZipEntry entry = new JarEntry(
-                        src.getPackageName().replace('.', '/') + "/"
-                                + classFile.getFileName().toString());
-                jarStream.putNextEntry(entry);
-                jarStream.write(Files.readAllBytes(classFile));
-                jarStream.closeEntry();
+            try(DirectoryStream<Path> classFiles = newDirectoryStream(packageDir,
+                    src.getSimpleName() + "*.class")) {
+                for (Path classFile : classFiles) {
+                    ZipEntry entry = new JarEntry(
+                            src.getPackageName().replace('.', '/') + "/"
+                                    + classFile.getFileName().toString());
+                    jarStream.putNextEntry(entry);
+                    jarStream.write(Files.readAllBytes(classFile));
+                    jarStream.closeEntry();
+                }
             }
         }
     }
@@ -643,7 +650,7 @@
         return !getModuleTempSources().isEmpty();
     }
 
-    private String getModulePathBasedOnExtension(ExtensionType extension) {
+    public String getModulePathBasedOnExtension(ExtensionType extension) {
         if (extension == null) {
             throw new NullPointerException("Extension cannot be null");
         }
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/BundlingManager.java	Tue Dec 20 20:46:32 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/BundlingManager.java	Tue Jan 03 21:28:20 2017 +0530
@@ -148,6 +148,9 @@
         if (Objects.nonNull(getExtensionType())) {
             stringBuilder.append("-");
             stringBuilder.append(getExtensionType());
+        } else if (Objects.nonNull(modulePath)) {
+            stringBuilder.append("-");
+            stringBuilder.append(modulePath.getFileName());
         }
 
         if (Objects.nonNull(getBundler().getID())) {
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/installers/LinuxAbstractBundlerUtils.java	Tue Dec 20 20:46:32 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/installers/LinuxAbstractBundlerUtils.java	Tue Jan 03 21:28:20 2017 +0530
@@ -30,6 +30,7 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import java.util.regex.Pattern;
+import java.util.stream.Stream;
 
 import com.oracle.appbundlers.utils.AppWrapper;
 import com.oracle.appbundlers.utils.BundlerUtils;
@@ -149,7 +150,6 @@
     protected VerificationMethod getFileAssociationVerificator() {
         return (value, app, applicationTitle) -> {
             try {
-                File oneOfIcons = null;
 
                 @SuppressWarnings("unchecked")
                 List<Map<String, Object>> associations = (List<Map<String, Object>>) value;
@@ -190,9 +190,6 @@
                     assertTrue(Utils.checkFilesEquality(desktopFile,
                             getDesktopFile(app, applicationTitle)));
 
-                    if (icon != null) {
-                        oneOfIcons = icon;
-                    }
                 }
             } catch (IOException | ExecutionException ex) {
                 throw new RuntimeException(ex);
@@ -234,13 +231,15 @@
 
     @Override
     public void checkIfExecutablesAvailableInBinDir(Path binDirPath) throws IOException {
-        Optional<Path> result = Files.find(binDirPath, 1, (file, attr) -> file
-                .toFile().getName().equals("java")).findFirst();
-        if (!result.isPresent()) {
-            throw new FileNotFoundException("java"
-                    + " not found under " + binDirPath );
+        try(Stream<Path> find = Files.find(binDirPath, 1, (file, attr) -> file
+                .toFile().getName().equals("java"))) {
+            Optional<Path> result = find.findFirst();
+            if (!result.isPresent()) {
+                throw new FileNotFoundException("java"
+                        + " not found under " + binDirPath );
+            }
+            LOG.log(Level.INFO, "java executable found in {0}", binDirPath);
         }
-        LOG.log(Level.INFO, "java executable found in {0}", binDirPath);
     }
 
     @Override
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/installers/MacAbstractBundlerUtils.java	Tue Dec 20 20:46:32 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/installers/MacAbstractBundlerUtils.java	Tue Jan 03 21:28:20 2017 +0530
@@ -296,13 +296,15 @@
 
     @Override
     public void checkIfExecutablesAvailableInBinDir(Path binDirPath) throws IOException {
-        Optional<Path> result = Files.find(binDirPath, 1, (file, attr) -> file
-                .toFile().getName().equals("java")).findFirst();
-        if (!result.isPresent()) {
-            throw new FileNotFoundException("java"
-                    + " not found under " + binDirPath );
+        try (Stream<Path> find = Files.find(binDirPath, 1, (file, attr) -> file
+                .toFile().getName().equals("java"))) {
+            Optional<Path> result = find.findFirst();
+            if (!result.isPresent()) {
+                throw new FileNotFoundException("java"
+                        + " not found under " + binDirPath );
+            }
+            LOG.log(Level.INFO, "java executable found in {0}", binDirPath);
         }
-        LOG.log(Level.INFO, "java executable found in {0}", binDirPath);
     }
 
     @Override
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/installers/WinAbstractBundlerUtils.java	Tue Dec 20 20:46:32 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/installers/WinAbstractBundlerUtils.java	Tue Jan 03 21:28:20 2017 +0530
@@ -31,6 +31,7 @@
 import java.util.logging.Logger;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
+import java.util.stream.Stream;
 
 import org.testng.Assert;
 
@@ -504,13 +505,15 @@
 
     @Override
     public void checkIfExecutablesAvailableInBinDir(Path binDirPath) throws IOException {
-        Optional<Path> result = Files.find(binDirPath, 1, (file, attr) -> file
-                .toFile().getName().equals("java.exe")).findFirst();
-        if (!result.isPresent()) {
-            throw new FileNotFoundException("java"
-                    + " not found under " + binDirPath );
+        try (Stream<Path> find = Files.find(binDirPath, 1, (file, attr) -> file
+                .toFile().getName().equals("java.exe"))) {
+            Optional<Path> result = find.findFirst();
+            if (!result.isPresent()) {
+                throw new FileNotFoundException("java"
+                        + " not found under " + binDirPath );
+            }
+            LOG.log(Level.INFO, "java.exe found in {0}", binDirPath);
         }
-        LOG.log(Level.INFO, "java.exe found in {0}", binDirPath);
     }
 
     @Override
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/resources/testapp.examplebundler.module.info.template	Tue Dec 20 20:46:32 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/resources/testapp.examplebundler.module.info.template	Tue Jan 03 21:28:20 2017 +0530
@@ -13,4 +13,5 @@
     requires jdk.management;
     requires java.base;
     exports testapp;
+	provides com.oracle.tools.packager.Bundler with testapp.ExampleBundler;
 }
\ No newline at end of file
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/resources/testapp.examplebundlers.module.info.template	Tue Dec 20 20:46:32 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/src/com/oracle/appbundlers/utils/resources/testapp.examplebundlers.module.info.template	Tue Jan 03 21:28:20 2017 +0530
@@ -13,4 +13,5 @@
     requires jdk.management;
     requires java.base;
     exports testapp;
+	provides com.oracle.tools.packager.Bundlers with testapp.ExampleBundlers;
 }
\ No newline at end of file
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/UserFriendlyJvmOptionsTest.java	Tue Dec 20 20:46:32 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/UserFriendlyJvmOptionsTest.java	Tue Jan 03 21:28:20 2017 +0530
@@ -5,7 +5,6 @@
 
 package com.oracle.appbundlers.tests.functionality;
 
-import static com.oracle.appbundlers.utils.Config.OPTION_PREFIX;
 import static com.oracle.appbundlers.utils.installers.AbstractBundlerUtils.USER_FRIENDLY_API;
 import static java.util.stream.Collectors.toList;
 
@@ -14,7 +13,6 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.UUID;
 
 import com.oracle.appbundlers.tests.functionality.functionalinterface.AdditionalParams;
 import com.oracle.appbundlers.tests.functionality.functionalinterface.VerifiedOptions;
@@ -95,10 +93,6 @@
         return () -> {
             Map<String, Object> additionalParams = new HashMap<>();
             additionalParams.put(USER_JVM_OPTIONS, defultUserJvmOptions);
-
-            Long uuid = UUID.randomUUID().getMostSignificantBits();
-            additionalParams.put(IDENTIFIER, uuid.toString());
-
             return additionalParams;
         };
     }
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/AddModuleTest.java	Tue Dec 20 20:46:32 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/AddModuleTest.java	Tue Jan 03 21:28:20 2017 +0530
@@ -41,9 +41,7 @@
 
     @Override
     public void overrideParameters(ExtensionType intermediate) {
-        if (intermediate != ExtensionType.NormalJar) {
-            this.currentParameter.setAdditionalParams(getAdditionalParams());
-            this.currentParameter.setVerifiedOptions(getVerifiedOptions());
-        }
+        this.currentParameter.setAdditionalParams(getAdditionalParams());
+        this.currentParameter.setVerifiedOptions(getVerifiedOptions());
     }
 }
\ No newline at end of file
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/JmodExplodedModuleAndModularJarDependencyTest.java	Tue Dec 20 20:46:32 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/JmodExplodedModuleAndModularJarDependencyTest.java	Tue Jan 03 21:28:20 2017 +0530
@@ -28,6 +28,7 @@
 import java.util.stream.Stream;
 
 import org.testng.Assert;
+import org.testng.annotations.AfterClass;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
@@ -37,6 +38,7 @@
 import com.oracle.appbundlers.utils.BundlerUtils;
 import com.oracle.appbundlers.utils.BundlingManager;
 import com.oracle.appbundlers.utils.BundlingManagers;
+import com.oracle.appbundlers.utils.Config;
 import com.oracle.appbundlers.utils.ExtensionType;
 import com.oracle.appbundlers.utils.PackageTypeFilter;
 import com.oracle.appbundlers.utils.PackagerApiFilter;
@@ -175,7 +177,7 @@
             throws Exception {
         Map<String, Object> allParams = new HashMap<String, Object>();
         allParams.put(APP_NAME,
-                getResultingAppName(modulepath.getFileName().toString()));
+                getResultingAppName());
         AppWrapper app = this.intermediateToParametersMap
                 .get(ExtensionType.ModularJar).getApp();
         allParams.put(MAIN_MODULE,
@@ -191,16 +193,6 @@
         return allParams;
     }
 
-    /**
-     * return App Name
-     * @param modulePathFileName
-     */
-    public String getResultingAppName(String modulePathFileName) {
-        return String.join("_", this.getClass().getSimpleName(),
-                this.bundlingManager.toString().replace('-', '_'),
-                modulePathFileName);
-    }
-
     public VerifiedOptions getVerifiedOptions() {
         return () -> {
             Map<String, Object> hashMap = new HashMap<String, Object>();
@@ -241,7 +233,7 @@
                     .get(ExtensionType.NormalJar).getApp();
             bundlingManager.execute(allParams, app);
             String path = bundlingManager.install(app,
-                    getResultingAppName(modulePath.getFileName().toString()),
+                    getResultingAppName(),
                     false);
             LOG.log(Level.INFO, "Installed at: {0}", path);
 
@@ -251,7 +243,7 @@
                     .createNewVerifiedOptions()
                     .forEach((name, value) -> bundlingManager.verifyOption(name,
                             value, app, getResultingAppName(
-                                    modulePath.getFileName().toString())));
+                                   )));
         } finally {
             uninstallApp(modulePath);
             LOG.log(Level.INFO, "Finished test: {0}", testName);
@@ -289,5 +281,23 @@
         return BundlerProvider.createBundlingManagers(installationPackageTypes,
                 packagerInterfaces, modulePathList, true);
     }
+
+    @AfterClass
+    protected void cleanUp() throws IOException {
+        super.cleanUp();
+
+        for (Iterator<Path> iterator = modulePathList.iterator(); iterator
+                .hasNext();) {
+            Path path = iterator.next();
+            if (!Config.CONFIG_INSTANCE.isNoCleanSet()) {
+                LOG.log(Level.INFO, "Removing directory " + path);
+                Utils.tryRemoveRecursive(path);
+            } else {
+                LOG.log(Level.INFO, "Skipped removing directory " + path);
+            }
+        }
+        Utils.tryRemoveRecursive(this.intermediateToParametersMap
+                .get(ExtensionType.NormalJar).getApp().getWorkDir());
+    }
 }
 
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/LimitModuleTest.java	Tue Dec 20 20:46:32 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/LimitModuleTest.java	Tue Jan 03 21:28:20 2017 +0530
@@ -58,11 +58,9 @@
     @Override
     public void overrideParameters(ExtensionType intermediate)
             throws IOException {
-        if (ExtensionType.NormalJar != intermediate) {
-            this.currentParameter.setAdditionalParams(getAdditionalParams());
-            this.currentParameter.setVerifiedOptions(getVerifiedOptions());
-            this.currentParameter.setApp(getApp());
-        }
+        this.currentParameter.setAdditionalParams(getAdditionalParams());
+        this.currentParameter.setVerifiedOptions(getVerifiedOptions());
+        this.currentParameter.setApp(getApp());
     }
 }
 
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/ListServiceProvidersTest.java	Tue Dec 20 20:46:32 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/ListServiceProvidersTest.java	Tue Jan 03 21:28:20 2017 +0530
@@ -54,11 +54,9 @@
     @Override
     public void overrideParameters(ExtensionType intermediate)
             throws IOException {
-        if (intermediate != ExtensionType.NormalJar) {
-            this.currentParameter.setApp(getApp());
-            this.currentParameter.setAdditionalParams(getAdditionalParams());
-            this.currentParameter.setVerifiedOptions(getVerifiedOptions());
-        }
+        this.currentParameter.setApp(getApp());
+        this.currentParameter.setAdditionalParams(getAdditionalParams());
+        this.currentParameter.setVerifiedOptions(getVerifiedOptions());
     }
 
     private AdditionalParams getAdditionalParams() {
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleBundledWithMinimumModulesAnd3rdPartyModulesTest.java	Tue Dec 20 20:46:32 2016 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- */
-package com.oracle.appbundlers.tests.functionality.jdk9test;
-
-import static com.oracle.appbundlers.utils.installers.AbstractBundlerUtils.CHECK_MODULE_IN_JAVA_EXECUTABLE;
-import static com.oracle.appbundlers.utils.installers.AbstractBundlerUtils.OUTPUT_CONTAINS;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import com.oracle.appbundlers.tests.functionality.functionalinterface.AdditionalParams;
-import com.oracle.appbundlers.tests.functionality.functionalinterface.VerifiedOptions;
-import com.oracle.appbundlers.utils.AppWrapper;
-import com.oracle.appbundlers.utils.ExtensionType;
-import com.oracle.appbundlers.utils.SourceFactory;
-import com.oracle.appbundlers.utils.Utils;
-
-/**
- * Named Module  + 3rd party modules
- * -m hello.world/HelloWorld -addmods 3rd.party
- * -modulepath <path to 3rd party modular JARs>
- * @author Ramesh BG
- */
-public class NamedModuleBundledWithMinimumModulesAnd3rdPartyModulesTest
-        extends ModuleTestBase {
-
-    public VerifiedOptions getVerifiedOptions() {
-        return () -> {
-            Map<String, Object> hashMap = new HashMap<String, Object>();
-            hashMap.put(OUTPUT_CONTAINS, HELLO_WORLD_OUTPUT);
-            hashMap.put(CHECK_MODULE_IN_JAVA_EXECUTABLE,
-                    COM_GREETINGS_MODULE_CUM_PACKAGE_NAME);
-            return hashMap;
-        };
-    }
-
-    public AdditionalParams getAdditionalParams() {
-        return () -> {
-            Map<String, Object> hashMap = new HashMap<String, Object>();
-            hashMap.put(ADD_MODS, this.currentParameter.getApp()
-                    .getAllModuleNamesSeperatedByCommaExceptMainmodule());
-            hashMap.put(STRIP_NATIVE_COMMANDS, false);
-            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());
-    }
-
-    @Override
-    public void overrideParameters(ExtensionType intermediate)
-            throws IOException {
-        if (ExtensionType.NormalJar != intermediate) {
-            this.currentParameter.setAdditionalParams(getAdditionalParams());
-            this.currentParameter.setVerifiedOptions(getVerifiedOptions());
-        }
-    }
-}
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleDependsOn3rdPartyModulesTest.java	Tue Jan 03 21:28:20 2017 +0530
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ */
+package com.oracle.appbundlers.tests.functionality.jdk9test;
+
+import static com.oracle.appbundlers.utils.installers.AbstractBundlerUtils.CHECK_MODULE_IN_JAVA_EXECUTABLE;
+import static com.oracle.appbundlers.utils.installers.AbstractBundlerUtils.OUTPUT_CONTAINS;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.oracle.appbundlers.tests.functionality.functionalinterface.AdditionalParams;
+import com.oracle.appbundlers.tests.functionality.functionalinterface.VerifiedOptions;
+import com.oracle.appbundlers.utils.AppWrapper;
+import com.oracle.appbundlers.utils.ExtensionType;
+import com.oracle.appbundlers.utils.SourceFactory;
+import com.oracle.appbundlers.utils.Utils;
+
+/**
+ * Named Module  + 3rd party modules
+ * -m hello.world/HelloWorld -addmods 3rd.party
+ * -modulepath <path to 3rd party modular JARs>
+ * @author Ramesh BG
+ */
+public class NamedModuleDependsOn3rdPartyModulesTest
+        extends ModuleTestBase {
+
+    public VerifiedOptions getVerifiedOptions() {
+        return () -> {
+            Map<String, Object> hashMap = new HashMap<String, Object>();
+            hashMap.put(OUTPUT_CONTAINS, HELLO_WORLD_OUTPUT);
+            hashMap.put(CHECK_MODULE_IN_JAVA_EXECUTABLE,
+                    COM_GREETINGS_MODULE_CUM_PACKAGE_NAME);
+            return hashMap;
+        };
+    }
+
+    public AdditionalParams getAdditionalParams() {
+        return () -> {
+            Map<String, Object> hashMap = new HashMap<String, Object>();
+            hashMap.put(ADD_MODS, this.currentParameter.getApp()
+                    .getAllModuleNamesSeperatedByCommaExceptMainmodule());
+            hashMap.put(STRIP_NATIVE_COMMANDS, false);
+            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());
+    }
+
+    @Override
+    public void overrideParameters(ExtensionType intermediate)
+            throws IOException {
+        this.currentParameter.setAdditionalParams(getAdditionalParams());
+        this.currentParameter.setVerifiedOptions(getVerifiedOptions());
+    }
+}
+
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleWithEntireJreTest.java	Tue Dec 20 20:46:32 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleWithEntireJreTest.java	Tue Jan 03 21:28:20 2017 +0530
@@ -41,10 +41,8 @@
     @Override
     public void overrideParameters(ExtensionType intermediate)
             throws IOException {
-        if (ExtensionType.NormalJar != intermediate) {
-            this.currentParameter.setApp(getApp());
-            this.currentParameter.setVerifiedOptions(getVerifiedOptions());
-        }
+        this.currentParameter.setApp(getApp());
+        this.currentParameter.setVerifiedOptions(getVerifiedOptions());
     }
 }
 
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleWithMinimumModulesTest.java	Tue Dec 20 20:46:32 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/NamedModuleWithMinimumModulesTest.java	Tue Jan 03 21:28:20 2017 +0530
@@ -53,11 +53,9 @@
     @Override
     public void overrideParameters(ExtensionType javaExtensionType)
             throws IOException {
-        if (ExtensionType.NormalJar != javaExtensionType) {
-            this.currentParameter.setApp(getApp());
-            this.currentParameter.setAdditionalParams(getAdditionalParams());
-            this.currentParameter.setVerifiedOptions(getVerifiedOptions());
-        }
+        this.currentParameter.setApp(getApp());
+        this.currentParameter.setAdditionalParams(getAdditionalParams());
+        this.currentParameter.setVerifiedOptions(getVerifiedOptions());
     }
 }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/UnNamedModuleDependsOn3rdPartyModulesTest.java	Tue Jan 03 21:28:20 2017 +0530
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ */
+package com.oracle.appbundlers.tests.functionality.jdk9test;
+
+import static com.oracle.appbundlers.utils.installers.AbstractBundlerUtils.CHECK_MODULE_IN_JAVA_EXECUTABLE;
+import static com.oracle.appbundlers.utils.installers.AbstractBundlerUtils.OUTPUT_CONTAINS;
+import static java.util.stream.Collectors.toList;
+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.stream.Collectors;
+import java.util.stream.Stream;
+
+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.ExtensionType;
+import com.oracle.appbundlers.utils.JavaExtensionTypeFilter;
+import com.oracle.appbundlers.utils.SourceFactory;
+import com.oracle.appbundlers.utils.Utils;
+import com.oracle.tools.packager.RelativeFileSet;
+import com.sun.javafx.tools.packager.bundlers.BundleParams;
+
+/**
+ *  Unnamed Module + JRE + 3rd party modules -srcfiles hello.world.jar -appClass
+ *  HelloWorld -BmainJar=hello.world.jar -addmods 3rd.party -modulepath
+ *  <path to 3rd party JARs>
+ *  @author Ramesh BG
+ */
+public class UnNamedModuleDependsOn3rdPartyModulesTest
+        extends TestBase {
+
+    protected AppWrapper getApp() throws IOException {
+        Map<String, String> hashMap = new HashMap<String, String>();
+        hashMap.put(PRINTLN_STATEMENT, CUSTOM_UTIL_PRINTLN_STATEMENT);
+        return new AppWrapper(Utils.getTempSubDir(WORK_DIRECTORY),
+                COM_GREETINGS_APP1_QUALIFIED_CLASS_NAME,
+                SourceFactory.get_custom_util_module(),
+                SourceFactory.get_com_greetings_app_unnamed_module(
+                        hashMap));
+    }
+
+    public VerifiedOptions getVerifiedOptions() {
+        return () -> {
+            Map<String, Object> hashMap = new HashMap<String, Object>();
+            hashMap.put(OUTPUT_CONTAINS, HELLO_WORLD_OUTPUT);
+            hashMap.put(CHECK_MODULE_IN_JAVA_EXECUTABLE,
+                    CUSTOM_UTIL_MODULE_NAME);
+            return hashMap;
+        };
+    }
+
+    public AdditionalParams getAdditionalParams() {
+        return () -> {
+            Map<String, Object> hashMap = new HashMap<String, Object>();
+            hashMap.put(ADD_MODS,
+                    this.currentParameter.getApp().getAllModuleNamesSeparatedByComma());
+            hashMap.put(STRIP_NATIVE_COMMANDS, false);
+            return hashMap;
+        };
+    }
+
+    @Override
+    protected void prepareTestEnvironment() throws Exception {
+        for (ExtensionType javaExtensionFormat : getExtensionArray()) {
+            this.currentParameter = this.intermediateToParametersMap
+                    .get(javaExtensionFormat);
+            overrideParameters(javaExtensionFormat);
+            initializeAndPrepareApp();
+        }
+    }
+
+    @Override
+    public void overrideParameters(ExtensionType javaExtensionFormat)
+            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(
+                new ExtensionType[] { extension, ExtensionType.NormalJar });
+        app.writeSourcesToAppDirectory();
+        app.compileAndCreateJavaExtensionType(
+                new String[] { DOUBLE_HYPHEN + ADD_EXPORTS,
+                        "custom.util/testapp.util=ALL-UNNAMED", DOUBLE_HYPHEN + ADD_MODS, CUSTOM_UTIL_MODULE_NAME},
+                extension);
+    }
+
+    @Override
+    protected void initializeAndPrepareApp() throws Exception {
+        prepareApp(this.currentParameter.getApp(),
+                this.currentParameter.getExtension());
+    }
+
+    public BasicParams getBasicParams() throws IOException {
+        /*
+         * there is no main module in this test since unnamed module depending
+         * on named module
+         */
+        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(MAIN_JAR,
+                    this.currentParameter.getApp().getMainJarFile().toFile().getName());
+            basicParams.put(MODULEPATH, String.join(File.pathSeparator,
+                    JMODS_PATH_IN_JDK, ((GenericModuleParameters) this.currentParameter).getModulePath()));
+            return basicParams;
+        };
+    }
+
+    @Override
+    public ExtensionType[] getExtensionArray() {
+        return Stream.of(ExtensionType.getModuleTypes())
+                .filter(JavaExtensionTypeFilter::accept).collect(toList())
+                .toArray(new ExtensionType[0]);
+    }
+
+    @Override
+    protected void executeJavaPackager(BundlingManager bundlingManager,
+            Map<String, Object> allParams, ExtensionType extension) throws IOException {
+        bundlingManager.execute(allParams, this.currentParameter.getApp() ,true);
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/UnNamedModuleDependsOnOtherJarsTest.java	Tue Jan 03 21:28:20 2017 +0530
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ */
+package com.oracle.appbundlers.tests.functionality.jdk9test;
+
+import static com.oracle.appbundlers.utils.installers.AbstractBundlerUtils.MULTI_OUTPUT_CONTAINS;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+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.utils.AppWrapper;
+import com.oracle.appbundlers.utils.ExtensionType;
+import com.oracle.appbundlers.utils.SourceFactory;
+import com.oracle.appbundlers.utils.Utils;
+
+/**
+ * Unnamed Module + JRE + 3rd party JARs
+ * -srcfiles hello.world.jar,3rd.party.jar -appClass HelloWorld
+ * -BmainJar=hello.world.jar
+ * @author Ramesh BG
+ */
+public class UnNamedModuleDependsOnOtherJarsTest
+        extends TestBase {
+
+    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>() {
+                            /**
+                             * serial version UID
+                             */
+                            private static final long serialVersionUID = 5243894457965235103L;
+
+                            {
+                                put(PRINTLN_STATEMENT,
+                                        CUSTOM_UTIL_APPEND_CLASS_NAME_PRINT_METHOD);
+                            }
+                        })
+                );
+    }
+
+    protected VerifiedOptions getVerifiedOptions() {
+        return () -> {
+            Map<String, Object> hashMap = new HashMap<String, Object>();
+            List<String> arrayList = new ArrayList<String>();
+            /*
+             * following parameter is added to check dependency of
+             * com.greeetings.App1 on test.app.Util i.e. com.greetings.jar on
+             * Util.jar
+             */
+            arrayList
+                    .add(CUSTOM_UTIL_UNNAMED_MODULE_FULLY_QUALIFIED_CLASS_NAME);
+            arrayList.add(HELLO_WORLD_OUTPUT);
+            hashMap.put(MULTI_OUTPUT_CONTAINS, arrayList);
+            return hashMap;
+        };
+    }
+
+    protected AdditionalParams getAdditionalParams() {
+        return () -> {
+            Map<String, Object> hashMap = new HashMap<String, Object>();
+            hashMap.put(APPLICATION_CLASS,
+                    COM_GREETINGS_APP1_QUALIFIED_CLASS_NAME);
+            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());
+        }
+    }
+
+    @Override
+    public boolean isTestCaseApplicableForExtensionType(
+            ExtensionType extensionType) {
+        return ExtensionType.NormalJar == extensionType;
+    }
+}
+
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/UnnamedModuleDependsOn3rdPartyModulesBundledWithEntireJreTest.java	Tue Dec 20 20:46:32 2016 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- */
-package com.oracle.appbundlers.tests.functionality.jdk9test;
-
-import static com.oracle.appbundlers.utils.installers.AbstractBundlerUtils.CHECK_MODULE_IN_JAVA_EXECUTABLE;
-import static com.oracle.appbundlers.utils.installers.AbstractBundlerUtils.OUTPUT_CONTAINS;
-import 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.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.ExtensionType;
-import com.oracle.appbundlers.utils.SourceFactory;
-import com.oracle.appbundlers.utils.Utils;
-import com.oracle.tools.packager.RelativeFileSet;
-import com.sun.javafx.tools.packager.bundlers.BundleParams;
-
-/**
- *  Unnamed Module + JRE + 3rd party modules -srcfiles hello.world.jar -appClass
- *  HelloWorld -BmainJar=hello.world.jar -addmods 3rd.party -modulepath
- *  <path to 3rd party JARs>
- *  @author Ramesh BG
- */
-public class UnnamedModuleDependsOn3rdPartyModulesBundledWithEntireJreTest
-        extends TestBase {
-
-    protected AppWrapper getApp() throws IOException {
-        Map<String, String> hashMap = new HashMap<String, String>();
-        hashMap.put(PRINTLN_STATEMENT, CUSTOM_UTIL_PRINTLN_STATEMENT);
-        return new AppWrapper(Utils.getTempSubDir(WORK_DIRECTORY),
-                COM_GREETINGS_APP1_QUALIFIED_CLASS_NAME,
-                SourceFactory.get_custom_util_module(),
-                SourceFactory.get_com_greetings_app_unnamed_module(
-                        hashMap));
-    }
-
-    public VerifiedOptions getVerifiedOptions() {
-        return () -> {
-            Map<String, Object> hashMap = new HashMap<String, Object>();
-            hashMap.put(OUTPUT_CONTAINS, HELLO_WORLD_OUTPUT);
-            hashMap.put(CHECK_MODULE_IN_JAVA_EXECUTABLE,
-                    CUSTOM_UTIL_MODULE_NAME);
-            return hashMap;
-        };
-    }
-
-    public AdditionalParams getAdditionalParams() {
-        return () -> {
-            Map<String, Object> hashMap = new HashMap<String, Object>();
-            hashMap.put(ADD_MODS,
-                    this.currentParameter.getApp().getAllModuleNamesSeparatedByComma());
-            hashMap.put(STRIP_NATIVE_COMMANDS, false);
-            return hashMap;
-        };
-    }
-
-    @Override
-    protected void prepareTestEnvironment() throws Exception {
-        for (ExtensionType javaExtensionFormat : getExtensionArray()) {
-            this.currentParameter = this.intermediateToParametersMap
-                    .get(javaExtensionFormat);
-            overrideParameters(javaExtensionFormat);
-            initializeAndPrepareApp();
-        }
-    }
-
-    @Override
-    public void overrideParameters(ExtensionType javaExtensionFormat)
-            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(
-                new ExtensionType[] { extension, ExtensionType.NormalJar });
-        app.writeSourcesToAppDirectory();
-        app.compileAndCreateJavaExtensionType(
-                new String[] { DOUBLE_HYPHEN + ADD_EXPORTS,
-                        "custom.util/testapp.util=ALL-UNNAMED", DOUBLE_HYPHEN + ADD_MODS, CUSTOM_UTIL_MODULE_NAME},
-                extension);
-    }
-
-    @Override
-    protected void initializeAndPrepareApp() throws Exception {
-        prepareApp(this.currentParameter.getApp(),
-                this.currentParameter.getExtension());
-    }
-
-    public BasicParams getBasicParams() throws IOException {
-        /*
-         * there is no main module in this test since unnamed module depending
-         * on named module
-         */
-        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(MAIN_JAR,
-                    this.currentParameter.getApp().getMainJarFile().toFile().getName());
-            basicParams.put(MODULEPATH, String.join(File.pathSeparator,
-                    JMODS_PATH_IN_JDK, ((GenericModuleParameters) this.currentParameter).getModulePath()));
-            return basicParams;
-        };
-    }
-
-    @Override
-    public ExtensionType[] getExtensionArray() {
-        return ExtensionType.getModuleTypes();
-    }
-
-    @Override
-    protected void executeJavaPackager(BundlingManager bundlingManager,
-            Map<String, Object> allParams, ExtensionType extension) throws IOException {
-        bundlingManager.execute(allParams, this.currentParameter.getApp() ,true);
-    }
-}
-
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/jdk9test/UnnamedModuleDependsOnOtherJarsBundledWithEntireJre.java	Tue Dec 20 20:46:32 2016 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- */
-package com.oracle.appbundlers.tests.functionality.jdk9test;
-
-import static com.oracle.appbundlers.utils.installers.AbstractBundlerUtils.MULTI_OUTPUT_CONTAINS;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-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.utils.AppWrapper;
-import com.oracle.appbundlers.utils.ExtensionType;
-import com.oracle.appbundlers.utils.SourceFactory;
-import com.oracle.appbundlers.utils.Utils;
-
-/**
- * Unnamed Module + JRE + 3rd party JARs
- * -srcfiles hello.world.jar,3rd.party.jar -appClass HelloWorld
- * -BmainJar=hello.world.jar
- * @author Ramesh BG
- */
-public class UnnamedModuleDependsOnOtherJarsBundledWithEntireJre
-        extends TestBase {
-
-    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>() {
-                            /**
-                             * serial version UID
-                             */
-                            private static final long serialVersionUID = 5243894457965235103L;
-
-                            {
-                                put(PRINTLN_STATEMENT,
-                                        CUSTOM_UTIL_APPEND_CLASS_NAME_PRINT_METHOD);
-                            }
-                        })
-                );
-    }
-
-    protected VerifiedOptions getVerifiedOptions() {
-        return () -> {
-            Map<String, Object> hashMap = new HashMap<String, Object>();
-            List<String> arrayList = new ArrayList<String>();
-            /*
-             * following parameter is added to check dependency of
-             * com.greeetings.App1 on test.app.Util i.e. com.greetings.jar on
-             * Util.jar
-             */
-            arrayList
-                    .add(CUSTOM_UTIL_UNNAMED_MODULE_FULLY_QUALIFIED_CLASS_NAME);
-            arrayList.add(HELLO_WORLD_OUTPUT);
-            hashMap.put(MULTI_OUTPUT_CONTAINS, arrayList);
-            return hashMap;
-        };
-    }
-
-    protected AdditionalParams getAdditionalParams() {
-        return () -> {
-            Map<String, Object> hashMap = new HashMap<String, Object>();
-            hashMap.put(APPLICATION_CLASS,
-                    COM_GREETINGS_APP1_QUALIFIED_CLASS_NAME);
-            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());
-        }
-    }
-
-    @Override
-    public boolean isTestCaseApplicableForExtensionType(
-            ExtensionType extensionType) {
-        return ExtensionType.NormalJar == extensionType;
-    }
-}
-
--- a/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/loading/BundlerLoadingTest.java	Tue Dec 20 20:46:32 2016 +0530
+++ b/functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/loading/BundlerLoadingTest.java	Tue Jan 03 21:28:20 2017 +0530
@@ -1,5 +1,7 @@
 package com.oracle.appbundlers.tests.loading;
 
+import static java.util.stream.Collectors.joining;
+import static java.util.stream.Collectors.toList;
 import static java.util.stream.Collectors.toSet;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertTrue;
@@ -19,6 +21,8 @@
 import java.util.ServiceLoader;
 import java.util.Set;
 import java.util.concurrent.ExecutionException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 import org.testng.SkipException;
 import org.testng.annotations.AfterMethod;
@@ -26,6 +30,7 @@
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
+import com.oracle.appbundlers.tests.functionality.TestBase;
 import com.oracle.appbundlers.utils.AppWrapper;
 import com.oracle.appbundlers.utils.Config;
 import com.oracle.appbundlers.utils.Constants;
@@ -34,6 +39,8 @@
 import com.oracle.appbundlers.utils.Utils;
 import com.oracle.tools.packager.Bundler;
 import com.oracle.tools.packager.Bundlers;
+import java.lang.module.*;
+import java.lang.reflect.*;
 
 import javafx.util.Pair;
 
@@ -42,6 +49,8 @@
  */
 public class BundlerLoadingTest implements Constants {
 
+    private static final String TESTAPP_EXAMPLEBUNDLERS_MODULE_NAME = "testapp.examplebundlers";
+    private static final String TESTAPP_EXAMPLEBUNDLER_MODULE_NAME = "testapp.examplebundler";
     private static final String COM_ORACLE_TOOLS_PACKAGER_BUNDLERS = "com.oracle.tools.packager.Bundlers";
     private static final String COM_ORACLE_TOOLS_PACKAGER_BUNDLER = "com.oracle.tools.packager.Bundler";
     public static final String examplePackage = "testapp";
@@ -53,28 +62,84 @@
             + exampleBundlersName;
     private AppWrapper app;
 
-    private AppWrapper createAndPrepareNewAppForExampleBundler(
-            ExtensionType extension, List<Pair<String, String>> services)
+    protected static final Logger LOG = Logger
+            .getLogger(BundlerLoadingTest.class.getName());
+
+
+    private void prepareApp(ExtensionType extension,
+            List<Pair<String, String>> services)
                     throws IOException, ExecutionException {
-        app = getExampleBundlerApp(extension);
         app.preinstallApp(extension);
         app.writeSourcesToAppDirectory();
         app.compileApp(extension);
         app.jarApp(extension, services);
+    }
+
+    private AppWrapper createAndPrepareNewAppForExampleBundlerWithService(
+            ExtensionType extension, List<Pair<String, String>> services)
+                    throws IOException, ExecutionException {
+        app = getExampleBundlerApp(extension);
+        prepareApp(extension, services);
         return app;
     }
 
-    private AppWrapper createAndPrepareNewAppForExampleBundlers(
+    private AppWrapper createAndPrepareNewAppForExampleBundlersWithService(
             ExtensionType extension, List<Pair<String, String>> services)
                     throws IOException, ExecutionException {
         app = getExampleBundlersApp(extension);
-        app.preinstallApp(extension);
-        app.writeSourcesToAppDirectory();
-        app.compileApp(extension);
-        app.jarApp(extension, services);
+        prepareApp(extension, services);
         return app;
     }
 
+    private AppWrapper getExampleBundlerApp(ExtensionType extension)
+            throws IOException, ExecutionException {
+        switch (extension) {
+        default:
+            return new AppWrapper(Utils.getTempSubDir("testBundlerLoading"),
+                    exampleBundlerFullName,
+                    new Source(exampleBundlerFullName, exampleBundlerName + ".java.template",
+                            exampleBundlerFullName,
+                            Collections.emptyMap()));
+        case ExplodedModules:
+        case Jmods:
+        case ModularJar:
+            Map<String, String> classToTemplateMap = new HashMap<String, String>();
+            classToTemplateMap.put(TESTAPP_EXAMPLE_BUNDLER,
+                    EXAMPLE_BUNDLER_TEMPLATE);
+
+            return new AppWrapper(Utils.getTempSubDir(WORK_DIRECTORY),
+                    TESTAPP_EXAMPLE_BUNDLER,
+                    new Source(TESTAPP_EXAMPLEBUNDLER_MODULE_NAME,
+                            "testapp.examplebundler.module.info.template",
+                            classToTemplateMap, TESTAPP_EXAMPLE_BUNDLER,
+                            exampleBundlerName, Collections.emptyMap(), true));
+        }
+    }
+
+    private AppWrapper getExampleBundlersApp(ExtensionType extension)
+            throws IOException, ExecutionException {
+        switch (extension) {
+        default:
+            return new AppWrapper(Utils.getTempSubDir("testBundlerLoading"),
+                    exampleBundlersFullName,
+                    new Source(exampleBundlersFullName, exampleBundlersName + ".java.template",
+                            exampleBundlersName, Collections.emptyMap()));
+        case ExplodedModules:
+        case Jmods:
+        case ModularJar:
+            Map<String, String> classToTemplateMap = new HashMap<String, String>();
+            classToTemplateMap.put(TESTAPP_EXAMPLE_BUNDLERS,
+                    EXAMPLE_BUNDLERS_TEMPLATE);
+
+            return new AppWrapper(Utils.getTempSubDir(WORK_DIRECTORY),
+                    TESTAPP_EXAMPLE_BUNDLERS,
+                    new Source(TESTAPP_EXAMPLEBUNDLERS_MODULE_NAME,
+                            "testapp.examplebundlers.module.info.template",
+                            classToTemplateMap, TESTAPP_EXAMPLE_BUNDLERS,
+                            exampleBundlersName, Collections.emptyMap(), true));
+        }
+    }
+
     @Test
     public void testLoadDefaultBundlers() {
         if (Config.CONFIG_INSTANCE.manualOnly()) {
@@ -110,87 +175,165 @@
     public void testLoadBundlerMethod(ExtensionType extension)
             throws IOException, ExecutionException {
         List<Pair<String, String>> arrayList = new ArrayList<Pair<String, String>>();
-        arrayList.add(new Pair<>(BundlerLoadingTest.COM_ORACLE_TOOLS_PACKAGER_BUNDLER,
-                exampleBundlerFullName));
-        app = createAndPrepareNewAppForExampleBundler(extension, arrayList);
-        List<Path> endProductListPath = getJavaExtensionProductListPath(app, extension);
-        List<URL> urlList = new ArrayList<>();
-        for (Path path : endProductListPath) {
-            urlList.add(path.toUri().toURL());
+        if (extension == ExtensionType.NormalJar) {
+            arrayList.add(
+                    new Pair<>(BundlerLoadingTest.COM_ORACLE_TOOLS_PACKAGER_BUNDLER,
+                            exampleBundlerFullName));
+            app = createAndPrepareNewAppForExampleBundlerWithService(extension, arrayList);
+            List<Path> endProductListPath = getJavaExtensionProductListPath(app,
+                    extension);
+            List<URL> urlList = new ArrayList<>();
+            for (Path path : endProductListPath) {
+                urlList.add(path.toUri().toURL());
+            }
+            Bundlers bundlers = Bundlers.createBundlersInstance();
+            ServiceLoader<Bundler> loader = ServiceLoader.load(Bundler.class,
+                    new URLClassLoader(
+                            urlList.toArray(new URL[urlList.size()])));
+            Iterator<Bundler> iterator = loader.iterator();
+            while (iterator.hasNext()) {
+                Bundler nextBundler = iterator.next();
+                bundlers.loadBundler(nextBundler);
+            }
+            assertTrue(
+                    bundlers.getBundlers().stream()
+                            .anyMatch(bundler -> bundler.getClass().getName()
+                                    .equals(exampleBundlerFullName)),
+                    exampleBundlerFullName + " Bundler is not loaded");
+        } else {
+            app = createAndPrepareNewAppForExampleBundlerWithService(extension, arrayList);
+            Layer layer = createCustomLayer(extension,
+                    BundlerLoadingTest.TESTAPP_EXAMPLEBUNDLER_MODULE_NAME);
+            ServiceLoader<Bundler> loader = ServiceLoader.load(layer,
+                    Bundler.class);
+            Bundlers bundlers = Bundlers.createBundlersInstance();
+            Iterator<Bundler> iterator = loader.iterator();
+            while (iterator.hasNext()) {
+                Bundler nextBundler = iterator.next();
+                bundlers.loadBundler(nextBundler);
+            }
+            assertTrue(
+                    bundlers.getBundlers().stream()
+                            .anyMatch(bundler -> bundler.getClass().getName()
+                                    .equals(exampleBundlerFullName)),
+                    exampleBundlerFullName + " Bundler is not loaded");
         }
-        ServiceLoader<Bundler> loader = ServiceLoader.load(Bundler.class,
-
-        new URLClassLoader(urlList.toArray(new URL[urlList.size()])));
-
-        Bundlers bundlers = Bundlers.createBundlersInstance();
-        Iterator<Bundler> iterator = loader.iterator();
-        while (iterator.hasNext()) {
-            Bundler nextBundler = iterator.next();
-            bundlers.loadBundler(nextBundler);
-        }
-        assertTrue(
-                bundlers.getBundlers().stream()
-                        .anyMatch(bundler -> bundler.getClass().getName()
-                                .equals(exampleBundlerFullName)),
-                exampleBundlerFullName + " Bundler is not loaded");
     }
 
     @Test(dataProvider = "getExtension")
     public void testLoadBundlersFromServicesMethod(ExtensionType extension)
             throws IOException, ExecutionException {
         List<Pair<String, String>> arrayList = new ArrayList<Pair<String, String>>();
-        arrayList.add(new Pair<>(BundlerLoadingTest.COM_ORACLE_TOOLS_PACKAGER_BUNDLER,
-                exampleBundlerFullName));
-        app = createAndPrepareNewAppForExampleBundler(extension, arrayList);
-        Bundlers bundlers = Bundlers.createBundlersInstance();
-        List<Path> endProductListPath = getJavaExtensionProductListPath(app, extension);
-        List<URL> urlList = new ArrayList<>();
-        for (Path path : endProductListPath) {
-            urlList.add(path.toUri().toURL());
+        if (extension == ExtensionType.NormalJar) {
+            arrayList.add(
+                    new Pair<>(BundlerLoadingTest.COM_ORACLE_TOOLS_PACKAGER_BUNDLER,
+                            exampleBundlerFullName));
+            app = createAndPrepareNewAppForExampleBundlerWithService(extension, arrayList);
+            Bundlers bundlers = Bundlers.createBundlersInstance();
+            List<Path> endProductListPath = getJavaExtensionProductListPath(app,
+                    extension);
+            List<URL> urlList = new ArrayList<>();
+            for (Path path : endProductListPath) {
+                urlList.add(path.toUri().toURL());
+            }
+            bundlers.loadBundlersFromServices(new URLClassLoader(
+                    urlList.toArray(new URL[urlList.size()])));
+            assertTrue(
+                    bundlers.getBundlers().stream()
+                            .anyMatch(bundler -> bundler.getClass().getName()
+                                    .equals(exampleBundlerFullName)),
+                    exampleBundlerFullName + " Bundler is not loaded from jar");
+        } else {
+            app = createAndPrepareNewAppForExampleBundlerWithService(extension, arrayList);
+            Layer layer = createCustomLayer(extension,
+                    BundlerLoadingTest.TESTAPP_EXAMPLEBUNDLER_MODULE_NAME);
+            ClassLoader moduleClassLoader = layer
+                    .findLoader(BundlerLoadingTest.TESTAPP_EXAMPLEBUNDLER_MODULE_NAME);
+            ServiceLoader<Bundler> loader = ServiceLoader.load(Bundler.class);
+            Bundlers bundlers = Bundlers.createBundlersInstance();
+            bundlers.loadBundlersFromServices(moduleClassLoader);
+            assertTrue(
+                    bundlers.getBundlers().stream()
+                            .anyMatch(bundler -> bundler.getClass().getName()
+                                    .equals(exampleBundlerFullName)),
+                    exampleBundlerFullName + " Bundler is not loaded from jar");
+
         }
-        bundlers.loadBundlersFromServices(
-                new URLClassLoader(urlList.toArray(new URL[urlList.size()])));
-        assertTrue(
-                bundlers.getBundlers().stream()
-                        .anyMatch(bundler -> bundler.getClass().getName()
-                                .equals(exampleBundlerFullName)),
-                exampleBundlerFullName + " Bundler is not loaded from jar");
     }
 
     @Test(dataProvider = "getExtension")
     public void testLoadCustomBundlersFromJar(ExtensionType extension)
             throws IOException, ExecutionException {
         List<Pair<String, String>> arrayList = new ArrayList<Pair<String, String>>();
-        arrayList.add(new Pair<>(BundlerLoadingTest.COM_ORACLE_TOOLS_PACKAGER_BUNDLERS,
-                exampleBundlersFullName));
-        app = createAndPrepareNewAppForExampleBundlers(extension, arrayList);
-        List<Path> endProductListPath = getJavaExtensionProductListPath(app, extension);
-        List<URL> urlList = new ArrayList<>();
-        for (Path path : endProductListPath) {
-            urlList.add(path.toUri().toURL());
+        if (extension == ExtensionType.NormalJar) {
+            arrayList.add(new Pair<>(
+                    BundlerLoadingTest.COM_ORACLE_TOOLS_PACKAGER_BUNDLERS,
+                    exampleBundlersFullName));
+            app = createAndPrepareNewAppForExampleBundlersWithService(extension, arrayList);
+            List<Path> endProductListPath = getJavaExtensionProductListPath(app,
+                    extension);
+            List<URL> urlList = new ArrayList<>();
+            for (Path path : endProductListPath) {
+                urlList.add(path.toUri().toURL());
+            }
+
+            ClassLoader customBundlersLoader = new URLClassLoader(
+                    urlList.toArray(new URL[urlList.size()]));
+            Bundlers bundlers = Bundlers
+                    .createBundlersInstance(customBundlersLoader);
+            ServiceLoader<Bundlers> bundlersLoader = ServiceLoader
+                    .load(Bundlers.class, customBundlersLoader);
+            Iterator<Bundlers> iter = bundlersLoader.iterator();
+            while (iter.hasNext()) {
+                bundlers = iter.next();
+                if (exampleBundlersFullName
+                        .equals(bundlers.getClass().getName())) {
+                    break;
+                }
+            }
+            assertEquals(bundlers.getClass().getName(), exampleBundlersFullName,
+                    "Bundlers're not loaded");
+        } else {
+            app = createAndPrepareNewAppForExampleBundlersWithService(extension, arrayList);
+            Layer layer = createCustomLayer(extension,
+                    BundlerLoadingTest.TESTAPP_EXAMPLEBUNDLERS_MODULE_NAME);
+            ClassLoader moduleClassLoader = layer
+                    .findLoader(BundlerLoadingTest.TESTAPP_EXAMPLEBUNDLERS_MODULE_NAME);
+            ServiceLoader<Bundler> loader = ServiceLoader.load(Bundler.class);
+            Bundlers bundlers = Bundlers
+                    .createBundlersInstance(moduleClassLoader);
+            assertEquals(bundlers.getClass().getName(), exampleBundlersFullName,
+                    "Bundlers're not loaded");
         }
+    }
 
-        ClassLoader customBundlersLoader = new URLClassLoader(
-                urlList.toArray(new URL[urlList.size()]));
-        Bundlers bundlers = Bundlers
-                .createBundlersInstance(customBundlersLoader);
-
-        assertEquals(bundlers.getClass().getName(), exampleBundlersFullName,
-                " Bundlers are not loaded");
-
-        assertTrue(!bundlers.getBundlers().isEmpty(),
-                "Default bundlers are not loaded");
+    private Layer createCustomLayer(ExtensionType extension,
+            String moduleName) {
+        ModuleFinder moduleFinder = ModuleFinder
+                .of(app.getJavaExtensionDirPathBasedonExtension(extension));
+        Layer parentLayer = Layer.boot();
+        Configuration configuration = parentLayer.configuration()
+                .resolveRequires(moduleFinder, ModuleFinder.of(),
+                        Set.of(moduleName));
+        ClassLoader classLoader = ClassLoader.getSystemClassLoader();
+        Layer layer = parentLayer.defineModulesWithOneLoader(configuration,
+                classLoader);
+        return layer;
     }
 
     @AfterMethod
-    @BeforeMethod
-    protected void cleanUp() throws IOException {
-        if (app != null) {
-            Utils.tryRemoveRecursive(app.getWorkDir());
+    private void cleanUp() throws IOException {
+        if (!Config.CONFIG_INSTANCE.isNoCleanSet()) {
+            if (app != null) {
+                LOG.log(Level.INFO, "Removing Directory "+app.getWorkDir());
+                Utils.tryRemoveRecursive(app.getWorkDir());
+            }
+        } else {
+            LOG.log(Level.INFO, "Skipped Removing Directory "+app.getWorkDir());
         }
     }
 
-    public List<Path> getJavaExtensionProductListPath(AppWrapper app,
+    private List<Path> getJavaExtensionProductListPath(AppWrapper app,
             ExtensionType extension) throws IOException {
         switch (extension) {
         case NormalJar:
@@ -206,7 +349,7 @@
     }
 
     @DataProvider(name = "getExtension")
-    public Iterator<Object[]> getExtension() {
+    private Iterator<Object[]> getExtension() {
         List<Object[]> list = new ArrayList<Object[]>();
         for (ExtensionType extension : getExtensionArray()) {
             Object[] eachArray = new Object[] { extension };
@@ -215,55 +358,15 @@
         return list.iterator();
     }
 
+    /*
+     * Jmods are excluded from this list because if jmods are included then we
+     * need to pass those *.jmod file to jlink and create image for same as *.jmod
+     * are not directly accepted by java command. so it is like finding all
+     * providers from runtime image instead of providing parameters
+     * programatically.
+     */
     private ExtensionType[] getExtensionArray() {
-        return ExtensionType.values();
-    }
-
-    private AppWrapper getExampleBundlerApp(ExtensionType extension)
-            throws IOException, ExecutionException {
-        switch (extension) {
-        default:
-            String fullName = examplePackage + "." + exampleBundlerName;
-            return new AppWrapper(Utils.getTempSubDir("testBundlerLoading"),
-                    fullName, new Source(fullName, exampleBundlerName + ".java.template",
-                            exampleBundlerName, Collections.emptyMap()));
-        case ExplodedModules:
-        case Jmods:
-        case ModularJar:
-            Map<String, String> classToTemplateMap = new HashMap<String, String>();
-            classToTemplateMap.put(TESTAPP_EXAMPLE_BUNDLER,
-                    EXAMPLE_BUNDLER_TEMPLATE);
-
-            return new AppWrapper(Utils.getTempSubDir(WORK_DIRECTORY),
-                    TESTAPP_EXAMPLE_BUNDLER,
-                    new Source("testapp.examplebundler",
-                            "testapp.examplebundler.module.info.template",
-                            classToTemplateMap, TESTAPP_EXAMPLE_BUNDLER,
-                            "ExampleBundler", Collections.emptyMap(), true));
-        }
-    }
-
-    private AppWrapper getExampleBundlersApp(ExtensionType extension)
-            throws IOException, ExecutionException {
-        switch (extension) {
-        default:
-            String fullName = examplePackage + "." + exampleBundlersName;
-            return new AppWrapper(Utils.getTempSubDir("testBundlerLoading"),
-                    fullName, new Source(fullName, exampleBundlersName + ".java.template",
-                            exampleBundlersName, Collections.emptyMap()));
-        case ExplodedModules:
-        case Jmods:
-        case ModularJar:
-            Map<String, String> classToTemplateMap = new HashMap<String, String>();
-            classToTemplateMap.put(TESTAPP_EXAMPLE_BUNDLERS,
-                    EXAMPLE_BUNDLERS_TEMPLATE);
-
-            return new AppWrapper(Utils.getTempSubDir(WORK_DIRECTORY),
-                    TESTAPP_EXAMPLE_BUNDLERS,
-                    new Source("testapp.examplebundlers",
-                            "testapp.examplebundlers.module.info.template",
-                            classToTemplateMap, TESTAPP_EXAMPLE_BUNDLERS,
-                            "ExampleBundlers", Collections.emptyMap(), true));
-        }
+        return new ExtensionType[] { ExtensionType.ExplodedModules,
+                ExtensionType.ModularJar, ExtensionType.NormalJar };
     }
 }