integration-tests/src/test/java/oracle/kubernetes/operator/utils/TestUtils.java
public static void buildDeployWebServiceAppInPod(
      Domain domain,
      String appName,
      String scriptName,
      String username,
      String password,
      String... args)
      throws Exception {
    String adminServerPod = domain.getDomainUid() + "-" + domain.getAdminServerName();
    final String appLocationOnHost = BaseTest.getAppLocationOnHost() + "/" + appName;
    final String appLocationInPod = BaseTest.getAppLocationInPod() + "/" + appName;
    final String scriptPathOnHost = BaseTest.getAppLocationOnHost() + "/" + scriptName;
    final String scriptPathInPod = BaseTest.getAppLocationInPod() + "/" + scriptName;

    // Default values to build archive file
    final String initInfoDirName = "WEB-INF";
    String archiveExt = "war";
    String infoDirName = initInfoDirName;
    String domainNS = domain.getDomainNs();
    int managedServerPort = ((Integer) (domain.getDomainMap()).get("managedServerPort")).intValue();
    String wsServiceName = (args.length == 0) ? BaseTest.TESTWSSERVICE : args[0];
    final String clusterUrl =
        retrieveClusterIP(domain.getDomainUid(), domain.getClusterName(), domainNS)
            + ":"
            + managedServerPort;
    LoggerHelper.getLocal().log(Level.INFO,
        "Build and deploy WebService App: "
            + appName
            + "."
            + archiveExt
            + " in the admin pod with web service name "
            + wsServiceName);

    // Create app dir in the admin pod
    StringBuffer mkdirCmd = new StringBuffer(" -- bash -c 'mkdir -p ");
    mkdirCmd.append(appLocationInPod + "'");

    // Create app dir in the admin pod
    kubectlexec(adminServerPod, domainNS, mkdirCmd.toString());

    // Create WEB-INF in the app dir
    mkdirCmd = new StringBuffer(" -- bash -c 'mkdir -p ");
    mkdirCmd.append(appLocationInPod + "/WEB-INF'");
    kubectlexec(adminServerPod, domainNS, mkdirCmd.toString());

    // Copy shell script to the admin pod
    copyFileViaCat(scriptPathOnHost, scriptPathInPod, adminServerPod, domainNS);

    // Copy all App files to the admin pod
    copyAppFilesToPod(appLocationOnHost, appLocationInPod, adminServerPod, domainNS);

    // Copy all App files to the admin pod
    copyAppFilesToPod(
        appLocationOnHost + "/WEB-INF", appLocationInPod + "/WEB-INF", adminServerPod, domainNS);

    LoggerHelper.getLocal().log(Level.INFO,
        "Creating WebService and WebService Servlet Client Applications");

    // Run the script to build WAR, EAR or JAR file and deploy the App in the admin pod
    domain.callShellScriptToBuildDeployAppInPod(
        appName, scriptName, username, password, clusterUrl, wsServiceName);
  }
/**
   * Create dir to save Web Service App files. Copy the shell script file and all App files over to
   * the admin pod Run the shell script to build WARs files and deploy the Web Service App and it's
   * client Servlet App in the admin pod
   *
   * @param domain     - Domain where to build and deploy app
   * @param appName    - WebService App name to be deployed
   * @param scriptName - a shell script to build and deploy the App in the admin pod
   * @param username   - weblogic user name
   * @param password   - weblogc password
   * @param args       - by default it use TestWsApp name for webservices impl files, or add arg for
   *                   different name
   * @throws Exception - exception reported as a failure to build or deploy ws
   */
Create dir to save Web Service App files. Copy the shell script file and all App files over to
the admin pod Run the shell script to build WARs files and deploy the Web Service App and it's
client Servlet App in the admin pod


Create dir to save Web Service App files . Copy the shell script file and all App files over to the admin pod Run the shell script to build WARs files and deploy the Web Service App and it ' s client Servlet App in the admin pod
public static void buildDeployWebServiceAppInPod(
      Domain domain,
      String appName,
      String scriptName,
      String username,
      String password,
      String... args)
      throws Exception {
    String adminServerPod = domain.getDomainUid() + "-" + domain.getAdminServerName();
    final String appLocationOnHost = BaseTest.getAppLocationOnHost() + "/" + appName;
    final String appLocationInPod = BaseTest.getAppLocationInPod() + "/" + appName;
    final String scriptPathOnHost = BaseTest.getAppLocationOnHost() + "/" + scriptName;
    final String scriptPathInPod = BaseTest.getAppLocationInPod() + "/" + scriptName;
    final String initInfoDirName = "WEB-INF";
    String archiveExt = "war";
    String infoDirName = initInfoDirName;
    String domainNS = domain.getDomainNs();
    int managedServerPort = ((Integer) (domain.getDomainMap()).get("managedServerPort")).intValue();
    String wsServiceName = (args.length == 0) ? BaseTest.TESTWSSERVICE : args[0];
    final String clusterUrl =
        retrieveClusterIP(domain.getDomainUid(), domain.getClusterName(), domainNS)
            + ":"
            + managedServerPort;
    LoggerHelper.getLocal().log(Level.INFO,
        "Build and deploy WebService App: "
            + appName
            + "."
            + archiveExt
            + " in the admin pod with web service name "
            + wsServiceName);
    StringBuffer mkdirCmd = new StringBuffer(" -- bash -c 'mkdir -p ");
    mkdirCmd.append(appLocationInPod + "'");
    kubectlexec(adminServerPod, domainNS, mkdirCmd.toString());
    mkdirCmd = new StringBuffer(" -- bash -c 'mkdir -p ");
    mkdirCmd.append(appLocationInPod + "/WEB-INF'");
    kubectlexec(adminServerPod, domainNS, mkdirCmd.toString());
    copyFileViaCat(scriptPathOnHost, scriptPathInPod, adminServerPod, domainNS);
    copyAppFilesToPod(appLocationOnHost, appLocationInPod, adminServerPod, domainNS);
    copyAppFilesToPod(
        appLocationOnHost + "/WEB-INF", appLocationInPod + "/WEB-INF", adminServerPod, domainNS);
    LoggerHelper.getLocal().log(Level.INFO,
        "Creating WebService and WebService Servlet Client Applications");
    domain.callShellScriptToBuildDeployAppInPod(
        appName, scriptName, username, password, clusterUrl, wsServiceName);
  }
public static void buildDeployWebServiceAppInPod ( Domain domain , String appName , String scriptName , String username , String password , String ... args ) throws Exception { String adminServerPod = domain . getDomainUid ( ) + "-" + domain . getAdminServerName ( ) ; final String appLocationOnHost = BaseTest . getAppLocationOnHost ( ) + "/" + appName ; final String appLocationInPod = BaseTest . getAppLocationInPod ( ) + "/" + appName ; final String scriptPathOnHost = BaseTest . getAppLocationOnHost ( ) + "/" + scriptName ; final String scriptPathInPod = BaseTest . getAppLocationInPod ( ) + "/" + scriptName ; final String initInfoDirName = "WEB-INF" ; String archiveExt = "war" ; String infoDirName = initInfoDirName ; String domainNS = domain . getDomainNs ( ) ; int managedServerPort = ( ( Integer ) ( domain . getDomainMap ( ) ) . get ( "managedServerPort" ) ) . intValue ( ) ; String wsServiceName = ( args . length == 0 ) ? BaseTest . TESTWSSERVICE : args [ 0 ] ; final String clusterUrl = retrieveClusterIP ( domain . getDomainUid ( ) , domain . getClusterName ( ) , domainNS ) + ":" + managedServerPort ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Build and deploy WebService App: " + appName + "." + archiveExt + " in the admin pod with web service name " + wsServiceName ) ; StringBuffer mkdirCmd = new StringBuffer ( " -- bash -c 'mkdir -p " ) ; mkdirCmd . append ( appLocationInPod + "'" ) ; kubectlexec ( adminServerPod , domainNS , mkdirCmd . toString ( ) ) ; mkdirCmd = new StringBuffer ( " -- bash -c 'mkdir -p " ) ; mkdirCmd . append ( appLocationInPod + "/WEB-INF'" ) ; kubectlexec ( adminServerPod , domainNS , mkdirCmd . toString ( ) ) ; copyFileViaCat ( scriptPathOnHost , scriptPathInPod , adminServerPod , domainNS ) ; copyAppFilesToPod ( appLocationOnHost , appLocationInPod , adminServerPod , domainNS ) ; copyAppFilesToPod ( appLocationOnHost + "/WEB-INF" , appLocationInPod + "/WEB-INF" , adminServerPod , domainNS ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Creating WebService and WebService Servlet Client Applications" ) ; domain . callShellScriptToBuildDeployAppInPod ( appName , scriptName , username , password , clusterUrl , wsServiceName ) ; }
Create dir to save Web Service App files.
Create dir to save Web Service App files .
// Default values to build archive file // Create app dir in the admin pod // Create app dir in the admin pod // Create WEB-INF in the app dir // Copy shell script to the admin pod // Copy all App files to the admin pod // Copy all App files to the admin pod // Run the script to build WAR, EAR or JAR file and deploy the App in the admin pod