< prev index next >

functional/appBundlerTestsJDK9/appBundlerTestsJDK9/test/com/oracle/appbundlers/tests/functionality/CommandLineArgumentsTest.java

Print this page


   1 /*
   2  * Copyright (c) 2014, 2016 Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  */
   5 
   6 package com.oracle.appbundlers.tests.functionality;
   7 
   8 import static com.oracle.appbundlers.utils.installers.AbstractBundlerUtils.CHECK_ARGUMENTS;
   9 
  10 import java.util.Arrays;
  11 import java.util.HashMap;
  12 import java.util.List;
  13 import java.util.Map;
  14 
  15 import com.oracle.appbundlers.tests.functionality.functionalinterface.VerifiedOptions;


  16 import com.oracle.appbundlers.utils.ExtensionType;
  17 
  18 /**
  19  * @author Dmitry Ginzburg &lt;dmitry.x.ginzburg@oracle.com&gt;
  20  */
  21 
  22 /**
  23  * This test is designed to check whether arguments are correctly passed to the
  24  * executable
  25  */
  26 public class CommandLineArgumentsTest extends TestBase {
  27 
  28     public List<String> args() {
  29         return Arrays.asList("aba", "caba", "aba caba");










  30     }
  31 
  32     @Override
  33     public void overrideParameters(ExtensionType intermediate) {
  34         this.currentParameter.setVerifiedOptions(getVerifiedOptions());
  35     }
  36 
  37     private VerifiedOptions getVerifiedOptions() {
  38         return () -> {
  39             Map<String, Object> verifiedOptions = new HashMap<>();
  40             verifiedOptions.put(CHECK_ARGUMENTS, args());
  41             return verifiedOptions;
  42         };
  43     }
  44 }
   1 /*
   2  * Copyright (c) 2014, 2016 Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  */
   5 
   6 package com.oracle.appbundlers.tests.functionality;
   7 
   8 import static com.oracle.appbundlers.utils.installers.AbstractBundlerUtils.CHECK_ARGUMENTS;
   9 
  10 import java.util.Arrays;
  11 import java.util.HashMap;
  12 import java.util.List;
  13 import java.util.Map;
  14 
  15 import com.oracle.appbundlers.tests.functionality.functionalinterface.VerifiedOptions;
  16 import com.oracle.appbundlers.utils.BundlerUtils;
  17 import com.oracle.appbundlers.utils.BundlingManagers;
  18 import com.oracle.appbundlers.utils.ExtensionType;
  19 
  20 /**
  21  * @author Dmitry Ginzburg &lt;dmitry.x.ginzburg@oracle.com&gt;
  22  */
  23 
  24 /**
  25  * This test is designed to check whether arguments are correctly passed to the
  26  * executable
  27  */
  28 public class CommandLineArgumentsTest extends TestBase {
  29 
  30     public List<String> args() {
  31         return Arrays.asList("aba", "caba", "aba caba");
  32     }
  33 
  34     @Override
  35     protected BundlerUtils[] getBundlerUtils() {
  36         return new BundlerUtils[] { BundlerUtils.EXE };
  37     }
  38 
  39     @Override
  40     protected BundlingManagers[] getBundlingManagers() {
  41         return new BundlingManagers[] { BundlingManagers.CLI };
  42     }
  43 
  44     @Override
  45     public void overrideParameters(ExtensionType intermediate) {
  46         this.currentParameter.setVerifiedOptions(getVerifiedOptions());
  47     }
  48 
  49     private VerifiedOptions getVerifiedOptions() {
  50         return () -> {
  51             Map<String, Object> verifiedOptions = new HashMap<>();
  52             verifiedOptions.put(CHECK_ARGUMENTS, args());
  53             return verifiedOptions;
  54         };
  55     }
  56 }
< prev index next >