integration-tests/src/test/java/oracle/kubernetes/operator/utils/Domain.java
public void verifyDomainServerPodRestart(String oldPropertyString, String newPropertyString)
      throws Exception {
    LoggerHelper.getLocal().log(Level.INFO, "Inside testDomainServerPodRestart");
    String content =
        new String(
            Files.readAllBytes(
                Paths.get(
                    userProjectsDir
                        + "/weblogic-domains/"
                        + domainUid
                        + "/domain.yaml")));
    boolean result = content.indexOf(newPropertyString) >= 0;
    LoggerHelper.getLocal().log(Level.INFO,
        "The search result for " + newPropertyString + " is: " + result);
    if (!result) {
      TestUtils.createNewYamlFile(
          userProjectsDir + "/weblogic-domains/" + domainUid + "/domain.yaml",
          userProjectsDir + "/weblogic-domains/" + domainUid + "/domain_new.yaml",
          oldPropertyString,
          newPropertyString);
      LoggerHelper.getLocal().log(Level.INFO,
          "Done - generate new domain.yaml for "
              + domainUid
              + " oldProperty: "
              + oldPropertyString
              + " newProperty: "
              + newPropertyString);

      // kubectl apply the new generated domain yaml file with changed property
      StringBuffer command = new StringBuffer();
      command
          .append("kubectl apply  -f ")
          .append(
              userProjectsDir
                  + "/weblogic-domains/"
                  + domainUid
                  + "/domain_new.yaml");
      LoggerHelper.getLocal().log(Level.INFO, "kubectl execute with command: " + command.toString());
      TestUtils.execOrAbortProcess(command.toString());

      // verify the servers in the domain are being restarted in a sequence
      verifyAdminServerRestarted();
      verifyManagedServersRestarted();

      // make domain.yaml include the new changed property
      TestUtils.copyFile(
          userProjectsDir + "/weblogic-domains/" + domainUid + "/domain_new.yaml",
          userProjectsDir + "/weblogic-domains/" + domainUid + "/domain.yaml");
    }
    LoggerHelper.getLocal().log(Level.INFO, "Done - testDomainServerPodRestart");
  }
/**
   * Verify domain server pods get restarted after a property change.
   *
   * @param oldPropertyString - the old property value
   * @param newPropertyString - the new property value
   * @throws Exception - IOException or errors occurred if the tested server is not restarted
   */
Verify domain server pods get restarted after a property change.
@param oldPropertyString - the old property value
@param newPropertyString - the new property value
@throws Exception - IOException or errors occurred if the tested server is not restarted
Verify domain server pods get restarted after a property change . @param oldPropertyString - the old property value @param newPropertyString - the new property value @throws Exception - IOException or errors occurred if the tested server is not restarted
public void verifyDomainServerPodRestart(String oldPropertyString, String newPropertyString)
      throws Exception {
    LoggerHelper.getLocal().log(Level.INFO, "Inside testDomainServerPodRestart");
    String content =
        new String(
            Files.readAllBytes(
                Paths.get(
                    userProjectsDir
                        + "/weblogic-domains/"
                        + domainUid
                        + "/domain.yaml")));
    boolean result = content.indexOf(newPropertyString) >= 0;
    LoggerHelper.getLocal().log(Level.INFO,
        "The search result for " + newPropertyString + " is: " + result);
    if (!result) {
      TestUtils.createNewYamlFile(
          userProjectsDir + "/weblogic-domains/" + domainUid + "/domain.yaml",
          userProjectsDir + "/weblogic-domains/" + domainUid + "/domain_new.yaml",
          oldPropertyString,
          newPropertyString);
      LoggerHelper.getLocal().log(Level.INFO,
          "Done - generate new domain.yaml for "
              + domainUid
              + " oldProperty: "
              + oldPropertyString
              + " newProperty: "
              + newPropertyString);
      StringBuffer command = new StringBuffer();
      command
          .append("kubectl apply  -f ")
          .append(
              userProjectsDir
                  + "/weblogic-domains/"
                  + domainUid
                  + "/domain_new.yaml");
      LoggerHelper.getLocal().log(Level.INFO, "kubectl execute with command: " + command.toString());
      TestUtils.execOrAbortProcess(command.toString());
      verifyAdminServerRestarted();
      verifyManagedServersRestarted();
      TestUtils.copyFile(
          userProjectsDir + "/weblogic-domains/" + domainUid + "/domain_new.yaml",
          userProjectsDir + "/weblogic-domains/" + domainUid + "/domain.yaml");
    }
    LoggerHelper.getLocal().log(Level.INFO, "Done - testDomainServerPodRestart");
  }
public void verifyDomainServerPodRestart ( String oldPropertyString , String newPropertyString ) throws Exception { LoggerHelper . getLocal ( ) . log ( Level . INFO , "Inside testDomainServerPodRestart" ) ; String content = new String ( Files . readAllBytes ( Paths . get ( userProjectsDir + "/weblogic-domains/" + domainUid + "/domain.yaml" ) ) ) ; boolean result = content . indexOf ( newPropertyString ) >= 0 ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "The search result for " + newPropertyString + " is: " + result ) ; if ( ! result ) { TestUtils . createNewYamlFile ( userProjectsDir + "/weblogic-domains/" + domainUid + "/domain.yaml" , userProjectsDir + "/weblogic-domains/" + domainUid + "/domain_new.yaml" , oldPropertyString , newPropertyString ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Done - generate new domain.yaml for " + domainUid + " oldProperty: " + oldPropertyString + " newProperty: " + newPropertyString ) ; StringBuffer command = new StringBuffer ( ) ; command . append ( "kubectl apply  -f " ) . append ( userProjectsDir + "/weblogic-domains/" + domainUid + "/domain_new.yaml" ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "kubectl execute with command: " + command . toString ( ) ) ; TestUtils . execOrAbortProcess ( command . toString ( ) ) ; verifyAdminServerRestarted ( ) ; verifyManagedServersRestarted ( ) ; TestUtils . copyFile ( userProjectsDir + "/weblogic-domains/" + domainUid + "/domain_new.yaml" , userProjectsDir + "/weblogic-domains/" + domainUid + "/domain.yaml" ) ; } LoggerHelper . getLocal ( ) . log ( Level . INFO , "Done - testDomainServerPodRestart" ) ; }
Verify domain server pods get restarted after a property change.
Verify domain server pods get restarted after a property change .
// kubectl apply the new generated domain yaml file with changed property // verify the servers in the domain are being restarted in a sequence // make domain.yaml include the new changed property