@@ -1597,17 +1597,18 @@ public void restartManagedServerUsingServerStartPolicy(String msName) throws Exc
15971597 }
15981598
15991599 /**
1600- * Run the shell script to build .war file and deploy the App in the admin pod
1600+ * Run the shell script to build WAR, EAR or JAR file and deploy the App in the admin pod
16011601 *
16021602 * @param webappName - Web App Name to be deployed
1603- * @param scriptName - a shell script to build .war file and deploy the App in the admin pod
1603+ * @param scriptName - a shell script to build WAR, EAR or JAR file and deploy the App in the
1604+ * admin pod
16041605 * @param archiveExt - archive extention
16051606 * @param infoDirNames - archive information dir location
16061607 * @param username - weblogic user name
16071608 * @param password - weblogc password
16081609 * @throws Exception
16091610 */
1610- private void callShellScriptToBuildWarDeployAppInPod (
1611+ private void callShellScriptToBuildDeployAppInPod (
16111612 String webappName ,
16121613 String scriptName ,
16131614 String archiveExt ,
@@ -1678,10 +1679,11 @@ private void callShellScriptToBuildWarDeployAppInPod(
16781679
16791680 /**
16801681 * Create dir to save Web App files Copy the shell script file and all App files over to the admin
1681- * pod Run the shell script to build .war file and deploy the App in the admin pod
1682+ * pod Run the shell script to build WAR, EAR or JAR file and deploy the App in the admin pod
16821683 *
16831684 * @param appName - Java App name to be deployed
1684- * @param scriptName - a shell script to build .war file and deploy the App in the admin pod
1685+ * @param scriptName - a shell script to build WAR, EAR or JAR file and deploy the App in the
1686+ * admin pod
16851687 * @param username - weblogic user name
16861688 * @param password - weblogc password
16871689 * @param args - by default, a WAR file is created for a Web App and a EAR file is created for EJB
@@ -1698,9 +1700,12 @@ public void buildDeployJavaAppInPod(
16981700 String scriptPathOnHost = BaseTest .getAppLocationOnHost () + "/" + scriptName ;
16991701 String scriptPathInPod = BaseTest .getAppLocationInPod () + "/" + scriptName ;
17001702
1703+ // Default velues to build archive file
17011704 final String initInfoDirName = "WEB-INF" ;
17021705 String archiveExt = "war" ;
17031706 String infoDirName = initInfoDirName ;
1707+
1708+ // Get archive info dir name
17041709 File appFiles = new File (appLocationOnHost );
17051710
17061711 String [] subDirArr =
@@ -1714,6 +1719,7 @@ public boolean accept(File dir, String name) {
17141719
17151720 List <String > subDirList = Arrays .asList (subDirArr );
17161721
1722+ // Check archive file type
17171723 if (!subDirList .contains (infoDirName )) {
17181724 infoDirName = "META-INF" ;
17191725 // Create .ear file or .jar file for EJB
@@ -1722,10 +1728,9 @@ public boolean accept(File dir, String name) {
17221728
17231729 logger .info ("Build and deploy: " + appName + "." + archiveExt + " in the admin pod" );
17241730
1731+ // Create app dir in the admin pod
17251732 StringBuffer mkdirCmd = new StringBuffer (" -- bash -c 'mkdir -p " );
17261733 mkdirCmd .append (appLocationInPod ).append ("/" + infoDirName + "'" );
1727-
1728- // Create app dir in the pod
17291734 TestUtils .kubectlexec (adminServerPod , domainNS , mkdirCmd .toString ());
17301735
17311736 // Copy shell script to the pod
@@ -1734,8 +1739,8 @@ public boolean accept(File dir, String name) {
17341739 // Copy all App files to the admin pod
17351740 TestUtils .copyAppFilesToPod (appLocationOnHost , appLocationInPod , adminServerPod , domainNS );
17361741
1737- // Run the script to build .war file and deploy the App in the pod
1738- callShellScriptToBuildWarDeployAppInPod (
1742+ // Run the script to build WAR, EAR or JAR file and deploy the App in the admin pod
1743+ callShellScriptToBuildDeployAppInPod (
17391744 appName , scriptName , archiveExt , infoDirName , username , password );
17401745 }
17411746}
0 commit comments