integration-tests/src/test/java/oracle/kubernetes/operator/BaseTest.java
public void testWldfScaling(Operator operator, Domain domain) throws Exception {
    LoggerHelper.getLocal().log(Level.INFO, "Inside testWldfScaling");
    TestUtils.renewK8sClusterLease(getProjectRoot(), getLeaseId());

    Map<String, Object> domainMap = domain.getDomainMap();
    String domainUid = domain.getDomainUid();
    String domainNS = (String) domainMap.get("namespace");
    String adminServerName = (String) domainMap.get("adminServerName");
    String adminPodName = domainUid + "-" + adminServerName;
    String domainName = (String) domainMap.get("domainName");

    copyScalingScriptToPod(domainUid, adminPodName, domainNS);
    TestUtils.createRbacPoliciesForWldfScaling();

    // deploy opensessionapp
    int retriesForDeployment = 10;
    domain.deployWebAppViaWlst(
        "opensessionapp",
        getProjectRoot() + "/src/integration-tests/apps/opensessionapp.war",
        appLocationInPod,
        getUsername(),
        getPassword(), retriesForDeployment);

    TestUtils.createWldfModule(
        adminPodName, domainNS, ((Integer) domainMap.get("t3ChannelPort")).intValue());

    String clusterName = domainMap.get("clusterName").toString();
    int replicaCntBeforeScaleup = TestUtils.getClusterReplicas(domainUid, clusterName, domainNS);
    LoggerHelper.getLocal().log(Level.INFO,
        "replica count before scaleup " + replicaCntBeforeScaleup);

    LoggerHelper.getLocal().log(Level.INFO, "Scale domain " + domainUid + " by calling the webapp");

    int replicas = 3;
    callWebAppAndVerifyScaling(domain, replicas);

    int replicaCntAfterScaleup = TestUtils.getClusterReplicas(domainUid, clusterName, domainNS);
    if (replicaCntAfterScaleup <= replicaCntBeforeScaleup) {
      throw new RuntimeException(
          "FAILURE: Cluster replica count has not increased after scaling up,"
              + " replicaCntBeforeScaleup/replicaCntAfterScaleup "
              + replicaCntBeforeScaleup
              + "/"
              + replicaCntAfterScaleup);
    }

    LoggerHelper.getLocal().log(Level.INFO, "Done - testWldfScaling");
  }
/**
   * Scale the cluster up using WebLogic WLDF scaling.
   *
   * @throws Exception exception
   */
Scale the cluster up using WebLogic WLDF scaling.
@throws Exception exception
Scale the cluster up using WebLogic WLDF scaling . @throws Exception exception
public void testWldfScaling(Operator operator, Domain domain) throws Exception {
    LoggerHelper.getLocal().log(Level.INFO, "Inside testWldfScaling");
    TestUtils.renewK8sClusterLease(getProjectRoot(), getLeaseId());
    Map<String, Object> domainMap = domain.getDomainMap();
    String domainUid = domain.getDomainUid();
    String domainNS = (String) domainMap.get("namespace");
    String adminServerName = (String) domainMap.get("adminServerName");
    String adminPodName = domainUid + "-" + adminServerName;
    String domainName = (String) domainMap.get("domainName");
    copyScalingScriptToPod(domainUid, adminPodName, domainNS);
    TestUtils.createRbacPoliciesForWldfScaling();
    int retriesForDeployment = 10;
    domain.deployWebAppViaWlst(
        "opensessionapp",
        getProjectRoot() + "/src/integration-tests/apps/opensessionapp.war",
        appLocationInPod,
        getUsername(),
        getPassword(), retriesForDeployment);
    TestUtils.createWldfModule(
        adminPodName, domainNS, ((Integer) domainMap.get("t3ChannelPort")).intValue());
    String clusterName = domainMap.get("clusterName").toString();
    int replicaCntBeforeScaleup = TestUtils.getClusterReplicas(domainUid, clusterName, domainNS);
    LoggerHelper.getLocal().log(Level.INFO,
        "replica count before scaleup " + replicaCntBeforeScaleup);
    LoggerHelper.getLocal().log(Level.INFO, "Scale domain " + domainUid + " by calling the webapp");
    int replicas = 3;
    callWebAppAndVerifyScaling(domain, replicas);
    int replicaCntAfterScaleup = TestUtils.getClusterReplicas(domainUid, clusterName, domainNS);
    if (replicaCntAfterScaleup <= replicaCntBeforeScaleup) {
      throw new RuntimeException(
          "FAILURE: Cluster replica count has not increased after scaling up,"
              + " replicaCntBeforeScaleup/replicaCntAfterScaleup "
              + replicaCntBeforeScaleup
              + "/"
              + replicaCntAfterScaleup);
    }
    LoggerHelper.getLocal().log(Level.INFO, "Done - testWldfScaling");
  }
public void testWldfScaling ( Operator operator , Domain domain ) throws Exception { LoggerHelper . getLocal ( ) . log ( Level . INFO , "Inside testWldfScaling" ) ; TestUtils . renewK8sClusterLease ( getProjectRoot ( ) , getLeaseId ( ) ) ; Map < String , Object > domainMap = domain . getDomainMap ( ) ; String domainUid = domain . getDomainUid ( ) ; String domainNS = ( String ) domainMap . get ( "namespace" ) ; String adminServerName = ( String ) domainMap . get ( "adminServerName" ) ; String adminPodName = domainUid + "-" + adminServerName ; String domainName = ( String ) domainMap . get ( "domainName" ) ; copyScalingScriptToPod ( domainUid , adminPodName , domainNS ) ; TestUtils . createRbacPoliciesForWldfScaling ( ) ; int retriesForDeployment = 10 ; domain . deployWebAppViaWlst ( "opensessionapp" , getProjectRoot ( ) + "/src/integration-tests/apps/opensessionapp.war" , appLocationInPod , getUsername ( ) , getPassword ( ) , retriesForDeployment ) ; TestUtils . createWldfModule ( adminPodName , domainNS , ( ( Integer ) domainMap . get ( "t3ChannelPort" ) ) . intValue ( ) ) ; String clusterName = domainMap . get ( "clusterName" ) . toString ( ) ; int replicaCntBeforeScaleup = TestUtils . getClusterReplicas ( domainUid , clusterName , domainNS ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "replica count before scaleup " + replicaCntBeforeScaleup ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Scale domain " + domainUid + " by calling the webapp" ) ; int replicas = 3 ; callWebAppAndVerifyScaling ( domain , replicas ) ; int replicaCntAfterScaleup = TestUtils . getClusterReplicas ( domainUid , clusterName , domainNS ) ; if ( replicaCntAfterScaleup <= replicaCntBeforeScaleup ) { throw new RuntimeException ( "FAILURE: Cluster replica count has not increased after scaling up," + " replicaCntBeforeScaleup/replicaCntAfterScaleup " + replicaCntBeforeScaleup + "/" + replicaCntAfterScaleup ) ; } LoggerHelper . getLocal ( ) . log ( Level . INFO , "Done - testWldfScaling" ) ; }
Scale the cluster up using WebLogic WLDF scaling.
Scale the cluster up using WebLogic WLDF scaling .
// deploy opensessionapp