integration-tests/src/test/java/oracle/kubernetes/operator/BaseTest.java
public void testAdminT3Channel(Domain domain, boolean verifyLoadBalancing) throws Exception {
    LoggerHelper.getLocal().log(Level.INFO, "Inside testAdminT3Channel");
    TestUtils.renewK8sClusterLease(getProjectRoot(), getLeaseId());
    Map<String, Object> domainMap = domain.getDomainMap();
    // check if the property is set to true
    Boolean exposeAdmint3Channel = (Boolean) domainMap.get("exposeAdminT3Channel");

    if (exposeAdmint3Channel != null && exposeAdmint3Channel.booleanValue()) {
      ExecResult result =
          TestUtils.kubectlexecNoCheck(
              domain.getDomainUid() + ("-") + domainMap.get("adminServerName"),
              "" + domainMap.get("namespace"),
              " -- mkdir -p " + appLocationInPod);
      if (result.exitValue() != 0) {
        throw new RuntimeException(
            "FAILURE: command to create directory "
                + appLocationInPod
                + " in the pod failed, returned "
                + result.stderr()
                + " "
                + result.stdout());
      }

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

      /* The below check is done for domain-home-in-image domains, it needs 12.2.1.3 patched image
       * otherwise managed servers will see unicast errors after app deployment and run as
       * standalone servers, not in cluster.
       * Here is the error message
       * <Jan 18, 2019 8:54:16,214 PM GMT> <Error> <Kernel> <BEA-000802> <ExecuteRequest failed
       * java.lang.AssertionError: LocalGroup should atleast have the local server!.
       * java.lang.AssertionError: LocalGroup should atleast have the local server!
       *    at weblogic.cluster.messaging.internal.GroupImpl.send(GroupImpl.java:176)
       *    at weblogic.cluster.messaging.internal.server.UnicastFragmentSocket.send
       *    (UnicastFragmentSocket.java:97)
       *    at weblogic.cluster.FragmentSocketWrapper.send(FragmentSocketWrapper.java:84)
       *    at weblogic.cluster.UnicastSender.send(UnicastSender.java:53)
       *    at weblogic.cluster.UnicastSender.send(UnicastSender.java:21)
       *    Truncated. see log file for complete stacktrace
       */

      if (domainMap.containsKey("domainHomeImageBase")) {
        if (domainMap.get("initialManagedServerReplicas") != null
            && ((Integer) domainMap.get("initialManagedServerReplicas")) >= 1) {

          result =
              ExecCommand.exec(
                  "kubectl logs "
                      + domain.getDomainUid()
                      + ("-")
                      + domainMap.get("managedServerNameBase")
                      + "1 -n "
                      + domainMap.get("namespace")
                      + " | grep BEA-000802");
          if (result.exitValue() == 0) {
            throw new RuntimeException(
                "FAILURE: Managed Servers are not part of the cluster, failing with "
                    + result.stdout()
                    + ". \n Make sure WebLogic Server 12.2.1.3.0 with patch 29135930 applied is used.");
          }
        }
      }

    } else {
      LoggerHelper.getLocal().log(Level.INFO,
          "exposeAdminT3Channel is false, can not test t3ChannelPort");
    }

    LoggerHelper.getLocal().log(Level.INFO, "Done - testAdminT3Channel");
  }
/**
   * Verify t3channel port by deploying webapp using the port.
   *
   * @throws Exception exception
   */
Verify t3channel port by deploying webapp using the port.
@throws Exception exception
Verify t3channel port by deploying webapp using the port . @throws Exception exception
public void testAdminT3Channel(Domain domain, boolean verifyLoadBalancing) throws Exception {
    LoggerHelper.getLocal().log(Level.INFO, "Inside testAdminT3Channel");
    TestUtils.renewK8sClusterLease(getProjectRoot(), getLeaseId());
    Map<String, Object> domainMap = domain.getDomainMap();
    Boolean exposeAdmint3Channel = (Boolean) domainMap.get("exposeAdminT3Channel");
    if (exposeAdmint3Channel != null && exposeAdmint3Channel.booleanValue()) {
      ExecResult result =
          TestUtils.kubectlexecNoCheck(
              domain.getDomainUid() + ("-") + domainMap.get("adminServerName"),
              "" + domainMap.get("namespace"),
              " -- mkdir -p " + appLocationInPod);
      if (result.exitValue() != 0) {
        throw new RuntimeException(
            "FAILURE: command to create directory "
                + appLocationInPod
                + " in the pod failed, returned "
                + result.stderr()
                + " "
                + result.stdout());
      }
      int retriesForDeployment = 10;
      domain.deployWebAppViaWlst(
          TESTWEBAPP,
          getProjectRoot() + "/src/integration-tests/apps/testwebapp.war",
          appLocationInPod,
          getUsername(),
          getPassword(), retriesForDeployment);
      domain.callWebAppAndVerifyLoadBalancing(TESTWEBAPP, verifyLoadBalancing);
      /* The below check is done for domain-home-in-image domains, it needs 12.2.1.3 patched image
       * otherwise managed servers will see unicast errors after app deployment and run as
       * standalone servers, not in cluster.
       * Here is the error message
       * <Jan 18, 2019 8:54:16,214 PM GMT> <Error> <Kernel> <BEA-000802> <ExecuteRequest failed
       * java.lang.AssertionError: LocalGroup should atleast have the local server!.
       * java.lang.AssertionError: LocalGroup should atleast have the local server!
       *    at weblogic.cluster.messaging.internal.GroupImpl.send(GroupImpl.java:176)
       *    at weblogic.cluster.messaging.internal.server.UnicastFragmentSocket.send
       *    (UnicastFragmentSocket.java:97)
       *    at weblogic.cluster.FragmentSocketWrapper.send(FragmentSocketWrapper.java:84)
       *    at weblogic.cluster.UnicastSender.send(UnicastSender.java:53)
       *    at weblogic.cluster.UnicastSender.send(UnicastSender.java:21)
       *    Truncated. see log file for complete stacktrace
       */
      if (domainMap.containsKey("domainHomeImageBase")) {
        if (domainMap.get("initialManagedServerReplicas") != null
            && ((Integer) domainMap.get("initialManagedServerReplicas")) >= 1) {
          result =
              ExecCommand.exec(
                  "kubectl logs "
                      + domain.getDomainUid()
                      + ("-")
                      + domainMap.get("managedServerNameBase")
                      + "1 -n "
                      + domainMap.get("namespace")
                      + " | grep BEA-000802");
          if (result.exitValue() == 0) {
            throw new RuntimeException(
                "FAILURE: Managed Servers are not part of the cluster, failing with "
                    + result.stdout()
                    + ". \n Make sure WebLogic Server 12.2.1.3.0 with patch 29135930 applied is used.");
          }
        }
      }
    } else {
      LoggerHelper.getLocal().log(Level.INFO,
          "exposeAdminT3Channel is false, can not test t3ChannelPort");
    }
    LoggerHelper.getLocal().log(Level.INFO, "Done - testAdminT3Channel");
  }
public void testAdminT3Channel ( Domain domain , boolean verifyLoadBalancing ) throws Exception { LoggerHelper . getLocal ( ) . log ( Level . INFO , "Inside testAdminT3Channel" ) ; TestUtils . renewK8sClusterLease ( getProjectRoot ( ) , getLeaseId ( ) ) ; Map < String , Object > domainMap = domain . getDomainMap ( ) ; Boolean exposeAdmint3Channel = ( Boolean ) domainMap . get ( "exposeAdminT3Channel" ) ; if ( exposeAdmint3Channel != null && exposeAdmint3Channel . booleanValue ( ) ) { ExecResult result = TestUtils . kubectlexecNoCheck ( domain . getDomainUid ( ) + ( "-" ) + domainMap . get ( "adminServerName" ) , "" + domainMap . get ( "namespace" ) , " -- mkdir -p " + appLocationInPod ) ; if ( result . exitValue ( ) != 0 ) { throw new RuntimeException ( "FAILURE: command to create directory " + appLocationInPod + " in the pod failed, returned " + result . stderr ( ) + " " + result . stdout ( ) ) ; } int retriesForDeployment = 10 ; domain . deployWebAppViaWlst ( TESTWEBAPP , getProjectRoot ( ) + "/src/integration-tests/apps/testwebapp.war" , appLocationInPod , getUsername ( ) , getPassword ( ) , retriesForDeployment ) ; domain . callWebAppAndVerifyLoadBalancing ( TESTWEBAPP , verifyLoadBalancing ) ; /* The below check is done for domain-home-in-image domains, it needs 12.2.1.3 patched image
       * otherwise managed servers will see unicast errors after app deployment and run as
       * standalone servers, not in cluster.
       * Here is the error message
       * <Jan 18, 2019 8:54:16,214 PM GMT> <Error> <Kernel> <BEA-000802> <ExecuteRequest failed
       * java.lang.AssertionError: LocalGroup should atleast have the local server!.
       * java.lang.AssertionError: LocalGroup should atleast have the local server!
       *    at weblogic.cluster.messaging.internal.GroupImpl.send(GroupImpl.java:176)
       *    at weblogic.cluster.messaging.internal.server.UnicastFragmentSocket.send
       *    (UnicastFragmentSocket.java:97)
       *    at weblogic.cluster.FragmentSocketWrapper.send(FragmentSocketWrapper.java:84)
       *    at weblogic.cluster.UnicastSender.send(UnicastSender.java:53)
       *    at weblogic.cluster.UnicastSender.send(UnicastSender.java:21)
       *    Truncated. see log file for complete stacktrace
       */ if ( domainMap . containsKey ( "domainHomeImageBase" ) ) { if ( domainMap . get ( "initialManagedServerReplicas" ) != null && ( ( Integer ) domainMap . get ( "initialManagedServerReplicas" ) ) >= 1 ) { result = ExecCommand . exec ( "kubectl logs " + domain . getDomainUid ( ) + ( "-" ) + domainMap . get ( "managedServerNameBase" ) + "1 -n " + domainMap . get ( "namespace" ) + " | grep BEA-000802" ) ; if ( result . exitValue ( ) == 0 ) { throw new RuntimeException ( "FAILURE: Managed Servers are not part of the cluster, failing with " + result . stdout ( ) + ". \n Make sure WebLogic Server 12.2.1.3.0 with patch 29135930 applied is used." ) ; } } } } else { LoggerHelper . getLocal ( ) . log ( Level . INFO , "exposeAdminT3Channel is false, can not test t3ChannelPort" ) ; } LoggerHelper . getLocal ( ) . log ( Level . INFO , "Done - testAdminT3Channel" ) ; }
Verify t3channel port by deploying webapp using the port.
Verify t3channel port by deploying webapp using the port .
// check if the property is set to true