new-integration-tests/src/test/java/oracle/weblogic/kubernetes/ItOperatorTwoDomains.java
private void restartDomain1AndVerifyNoImpactOnDomain2() {
    String domain1AdminServerPodName = domainAdminServerPodNames.get(0);

    // shutdown domain1
    logger.info("Shutting down domain1");
    assertTrue(shutdownDomain(domain1Uid, domain1Namespace),
        String.format("shutdown domain %s in namespace %s failed", domain1Uid, domain1Namespace));

    // verify all the server pods in domain1 were shutdown
    logger.info("Checking that admin server pod in domain1 was shutdown");
    checkPodDoesNotExist(domain1AdminServerPodName, domain1Uid, domain1Namespace);

    logger.info("Checking managed server pods in domain1 were shutdown");
    for (int i = 1; i <= replicasAfterScale; i++) {
      String domain1ManagedServerPodName = domain1Uid + "-" + MANAGED_SERVER_NAME_BASE + i;
      checkPodDoesNotExist(domain1ManagedServerPodName, domain1Uid, domain1Namespace);
    }

    // verify domain2 was not changed after domain1 was shut down
    logger.info("Verifying that domain2 was not changed after domain1 was shut down");
    verifyDomain2NotChanged();

    // restart domain1
    logger.info("Starting domain1");
    assertTrue(startDomain(domain1Uid, domain1Namespace),
        String.format("start domain %s in namespace %s failed", domain1Uid, domain1Namespace));

    // verify domain1 is restarted
    // check domain1 admin server pod is ready, also check admin service exists in the domain1 namespace
    logger.info("Checking admin server pod in domain1 was started");
    checkPodReadyAndServiceExists(domain1AdminServerPodName, domain1Uid, domain1Namespace);
    checkPodRestarted(domain1Uid, domain1Namespace, domain1AdminServerPodName,
        domainAdminPodOriginalTimestamps.get(0));

    // check managed server pods in domain1
    logger.info("Checking managed server pods in domain1 were started");
    for (int i = 1; i <= replicasAfterScale; i++) {
      String domain1ManagedServerPodName = domain1Uid + "-" + MANAGED_SERVER_NAME_BASE + i;
      checkPodReadyAndServiceExists(domain1ManagedServerPodName, domain1Uid, domain1Namespace);
      checkPodRestarted(domain1Uid, domain1Namespace, domain1ManagedServerPodName,
          domain1ManagedServerPodOriginalTimestampList.get(i - 1));
    }

    // verify domain2 was not changed after domain1 was restarted
    logger.info("Verifying that domain2 was not changed after domain1 was started");
    verifyDomain2NotChanged();
  }
/**
   * Restart domain1 and verify there was no impact on domain2.
   */
Restart domain1 and verify there was no impact on domain2.
Restart domain1 and verify there was no impact on domain2 .
private void restartDomain1AndVerifyNoImpactOnDomain2() {
    String domain1AdminServerPodName = domainAdminServerPodNames.get(0);
    logger.info("Shutting down domain1");
    assertTrue(shutdownDomain(domain1Uid, domain1Namespace),
        String.format("shutdown domain %s in namespace %s failed", domain1Uid, domain1Namespace));
    logger.info("Checking that admin server pod in domain1 was shutdown");
    checkPodDoesNotExist(domain1AdminServerPodName, domain1Uid, domain1Namespace);
    logger.info("Checking managed server pods in domain1 were shutdown");
    for (int i = 1; i <= replicasAfterScale; i++) {
      String domain1ManagedServerPodName = domain1Uid + "-" + MANAGED_SERVER_NAME_BASE + i;
      checkPodDoesNotExist(domain1ManagedServerPodName, domain1Uid, domain1Namespace);
    }
    logger.info("Verifying that domain2 was not changed after domain1 was shut down");
    verifyDomain2NotChanged();
    logger.info("Starting domain1");
    assertTrue(startDomain(domain1Uid, domain1Namespace),
        String.format("start domain %s in namespace %s failed", domain1Uid, domain1Namespace));
    logger.info("Checking admin server pod in domain1 was started");
    checkPodReadyAndServiceExists(domain1AdminServerPodName, domain1Uid, domain1Namespace);
    checkPodRestarted(domain1Uid, domain1Namespace, domain1AdminServerPodName,
        domainAdminPodOriginalTimestamps.get(0));
    logger.info("Checking managed server pods in domain1 were started");
    for (int i = 1; i <= replicasAfterScale; i++) {
      String domain1ManagedServerPodName = domain1Uid + "-" + MANAGED_SERVER_NAME_BASE + i;
      checkPodReadyAndServiceExists(domain1ManagedServerPodName, domain1Uid, domain1Namespace);
      checkPodRestarted(domain1Uid, domain1Namespace, domain1ManagedServerPodName,
          domain1ManagedServerPodOriginalTimestampList.get(i - 1));
    }
    logger.info("Verifying that domain2 was not changed after domain1 was started");
    verifyDomain2NotChanged();
  }
private void restartDomain1AndVerifyNoImpactOnDomain2 ( ) { String domain1AdminServerPodName = domainAdminServerPodNames . get ( 0 ) ; logger . info ( "Shutting down domain1" ) ; assertTrue ( shutdownDomain ( domain1Uid , domain1Namespace ) , String . format ( "shutdown domain %s in namespace %s failed" , domain1Uid , domain1Namespace ) ) ; logger . info ( "Checking that admin server pod in domain1 was shutdown" ) ; checkPodDoesNotExist ( domain1AdminServerPodName , domain1Uid , domain1Namespace ) ; logger . info ( "Checking managed server pods in domain1 were shutdown" ) ; for ( int i = 1 ; i <= replicasAfterScale ; i ++ ) { String domain1ManagedServerPodName = domain1Uid + "-" + MANAGED_SERVER_NAME_BASE + i ; checkPodDoesNotExist ( domain1ManagedServerPodName , domain1Uid , domain1Namespace ) ; } logger . info ( "Verifying that domain2 was not changed after domain1 was shut down" ) ; verifyDomain2NotChanged ( ) ; logger . info ( "Starting domain1" ) ; assertTrue ( startDomain ( domain1Uid , domain1Namespace ) , String . format ( "start domain %s in namespace %s failed" , domain1Uid , domain1Namespace ) ) ; logger . info ( "Checking admin server pod in domain1 was started" ) ; checkPodReadyAndServiceExists ( domain1AdminServerPodName , domain1Uid , domain1Namespace ) ; checkPodRestarted ( domain1Uid , domain1Namespace , domain1AdminServerPodName , domainAdminPodOriginalTimestamps . get ( 0 ) ) ; logger . info ( "Checking managed server pods in domain1 were started" ) ; for ( int i = 1 ; i <= replicasAfterScale ; i ++ ) { String domain1ManagedServerPodName = domain1Uid + "-" + MANAGED_SERVER_NAME_BASE + i ; checkPodReadyAndServiceExists ( domain1ManagedServerPodName , domain1Uid , domain1Namespace ) ; checkPodRestarted ( domain1Uid , domain1Namespace , domain1ManagedServerPodName , domain1ManagedServerPodOriginalTimestampList . get ( i - 1 ) ) ; } logger . info ( "Verifying that domain2 was not changed after domain1 was started" ) ; verifyDomain2NotChanged ( ) ; }
Restart domain1 and verify there was no impact on domain2.
Restart domain1 and verify there was no impact on domain2 .
// shutdown domain1 // verify all the server pods in domain1 were shutdown // verify domain2 was not changed after domain1 was shut down // restart domain1 // verify domain1 is restarted // check domain1 admin server pod is ready, also check admin service exists in the domain1 namespace // check managed server pods in domain1 // verify domain2 was not changed after domain1 was restarted