/* * 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; /** * Example 5: Named Module App + Entire JRE (default) * * -appClass HelloWorld -BmainJar=hello.world.jar -addmods hello.world,ALL_JRE * (implicit so not required) * * @author Ramesh BG Example 5 in chris list Need to check with chris whether * ALL_JRE is required here. */ public class NamedModuleWithEntireJreTest extends ModuleTestBase { protected VerifiedOptions getVerifiedOptions() { return () -> { Map hashMap = new HashMap(); hashMap.put(OUTPUT_CONTAINS, HELLO_WORLD_OUTPUT); hashMap.put(CHECK_MODULE_IN_JAVA_EXECUTABLE, COM_GREETINGS_MODULE_CUM_PACKAGE_NAME); return hashMap; }; } protected AdditionalParams getAdditionalParams() { return () -> { Map hashMap = new HashMap(); hashMap.put(ADD_MODS, this.currentParameter.getApp().addAllModules()); return hashMap; }; } protected AppWrapper getApp() throws IOException { return new AppWrapper(Utils.getTempSubDir(WORK_DIRECTORY), COM_GREETINGS_APP1_QUALIFIED_CLASS_NAME, SourceFactory.get_com_greetings_module()); } @Override public void overrideParameters(ExtensionType intermediate) throws IOException { if (ExtensionType.NormalJar != intermediate) { this.currentParameter.setApp(getApp()); this.currentParameter.setAdditionalParams(getAdditionalParams()); this.currentParameter.setVerifiedOptions(getVerifiedOptions()); } } }