integration-tests/src/test/java/oracle/kubernetes/operator/utils/Domain.java
public void callWebAppAndVerifyLoadBalancing(String webappName, boolean verifyLoadBalance)
      throws Exception {
    if (!loadBalancer.equals("NONE")) {
      // url
      StringBuffer testAppUrl = new StringBuffer("http://");
      testAppUrl.append(getHostNameForCurl()).append(":").append(loadBalancerWebPort).append("/");
      if (loadBalancer.equals("APACHE")) {
        testAppUrl.append("weblogic/");
      }
      testAppUrl.append(webappName).append("/");
      // curl cmd to call webapp
      StringBuffer curlCmd = new StringBuffer("curl --silent --noproxy '*' ");
      curlCmd
          .append(" -H 'host: ")
          .append(domainUid)
          .append(".org' ")
          .append(testAppUrl.toString());
      // curl cmd to get response code
      StringBuffer curlCmdResCode = new StringBuffer(curlCmd.toString());
      curlCmdResCode.append(" --write-out %{http_code} -o /dev/null");

      LoggerHelper.getLocal().log(Level.INFO, "Curl cmd with response code " + curlCmdResCode);
      LoggerHelper.getLocal().log(Level.INFO, "Curl cmd " + curlCmd);
      //check helm status
      checkLoadBalancer();
      // call webapp iteratively till its deployed/ready
      callWebAppAndWaitTillReady(curlCmdResCode.toString());

      // execute curl and look for the managed server name in response
      callWebAppAndCheckForServerNameInResponse(curlCmd.toString(), verifyLoadBalance);
      // LoggerHelper.getLocal().log(Level.INFO, "curlCmd "+curlCmd);
    }
  }
/**
   * Call webapp and verify load balancing by checking server name in the response.
   *
   * @param webappName        webappName
   * @param verifyLoadBalance verifyLoadBalance
   * @throws Exception If failed to access the application or verify LB
   */
Call webapp and verify load balancing by checking server name in the response.
@param webappName        webappName
@param verifyLoadBalance verifyLoadBalance
@throws Exception If failed to access the application or verify LB
Call webapp and verify load balancing by checking server name in the response . @param webappName webappName @param verifyLoadBalance verifyLoadBalance @throws Exception If failed to access the application or verify LB
public void callWebAppAndVerifyLoadBalancing(String webappName, boolean verifyLoadBalance)
      throws Exception {
    if (!loadBalancer.equals("NONE")) {
      StringBuffer testAppUrl = new StringBuffer("http://");
      testAppUrl.append(getHostNameForCurl()).append(":").append(loadBalancerWebPort).append("/");
      if (loadBalancer.equals("APACHE")) {
        testAppUrl.append("weblogic/");
      }
      testAppUrl.append(webappName).append("/");
      StringBuffer curlCmd = new StringBuffer("curl --silent --noproxy '*' ");
      curlCmd
          .append(" -H 'host: ")
          .append(domainUid)
          .append(".org' ")
          .append(testAppUrl.toString());
      StringBuffer curlCmdResCode = new StringBuffer(curlCmd.toString());
      curlCmdResCode.append(" --write-out %{http_code} -o /dev/null");
      LoggerHelper.getLocal().log(Level.INFO, "Curl cmd with response code " + curlCmdResCode);
      LoggerHelper.getLocal().log(Level.INFO, "Curl cmd " + curlCmd);
      checkLoadBalancer();
      callWebAppAndWaitTillReady(curlCmdResCode.toString());
      callWebAppAndCheckForServerNameInResponse(curlCmd.toString(), verifyLoadBalance);
    }
  }
public void callWebAppAndVerifyLoadBalancing ( String webappName , boolean verifyLoadBalance ) throws Exception { if ( ! loadBalancer . equals ( "NONE" ) ) { StringBuffer testAppUrl = new StringBuffer ( "http://" ) ; testAppUrl . append ( getHostNameForCurl ( ) ) . append ( ":" ) . append ( loadBalancerWebPort ) . append ( "/" ) ; if ( loadBalancer . equals ( "APACHE" ) ) { testAppUrl . append ( "weblogic/" ) ; } testAppUrl . append ( webappName ) . append ( "/" ) ; StringBuffer curlCmd = new StringBuffer ( "curl --silent --noproxy '*' " ) ; curlCmd . append ( " -H 'host: " ) . append ( domainUid ) . append ( ".org' " ) . append ( testAppUrl . toString ( ) ) ; StringBuffer curlCmdResCode = new StringBuffer ( curlCmd . toString ( ) ) ; curlCmdResCode . append ( " --write-out %{http_code} -o /dev/null" ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Curl cmd with response code " + curlCmdResCode ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Curl cmd " + curlCmd ) ; checkLoadBalancer ( ) ; callWebAppAndWaitTillReady ( curlCmdResCode . toString ( ) ) ; callWebAppAndCheckForServerNameInResponse ( curlCmd . toString ( ) , verifyLoadBalance ) ; } }
Call webapp and verify load balancing by checking server name in the response.
Call webapp and verify load balancing by checking server name in the response .
// url // curl cmd to call webapp // curl cmd to get response code //check helm status // call webapp iteratively till its deployed/ready // execute curl and look for the managed server name in response // LoggerHelper.getLocal().log(Level.INFO, "curlCmd "+curlCmd);