integration-tests/src/test/java/oracle/kubernetes/operator/ItPodsShutdown.java
@Test
  public void testAddShutdownOptionsToMsTimeout() throws Exception {

    Assumptions.assumeTrue(FULLTEST);
    String testMethodName = new Object() {
    }.getClass().getEnclosingMethod().getName();
    logTestBegin(testMethodName);
    Map<String, Object> shutdownProps = new HashMap();
    shutdownProps.put("timeoutSeconds", 10);
    shutdownProps.put("ignoreSessions", false);
    List<Map<String,Object>> shutdownPropsMSs = new ArrayList<>();
    Map<String, Object> shutdownPropsMyMS = new HashMap();
    shutdownPropsMyMS.put("managed-server1", shutdownProps);
    shutdownPropsMSs.add(shutdownPropsMyMS);
    Map<String, Object> shutdownPropOpt = new HashMap();
    shutdownPropOpt.put("server",shutdownPropsMSs);
    Domain domain = null;
    try {
      domain = createDomain(domainNSShutOpMSTimeout, shutdownPropOpt);
      Assertions.assertNotNull(domain,
          domainNSShutOpMSTimeout
              + " failed to create, returns null");
      Assertions.assertTrue(
          checkShutdownUpdatedProp(domain.getDomainUid() + "-managed-server1", domain.getDomainNs(),"10", "false"),
          domain.getDomainUid()
              + "-managed-server1: "
              + " shutdown property does not match the expected :"
              + " timeoutSeconds=10, ignoreSessions=false");
      domain.buildDeployJavaAppInPod(
          testAppName, scriptName, BaseTest.getUsername(), BaseTest.getPassword());
      domain.callWebAppAndVerifyLoadBalancing(testAppName + "/CounterServlet?", false);
      long delayTime = 80 * 1000;
      // testing timeout
      long terminationTime = verifyShutdown(delayTime, domain);

      if (terminationTime > delayTime) {
        LoggerHelper.getLocal().log(Level.INFO, "\"FAILURE: ignored timeoutValue during shutdown");
        throw new Exception("FAILURE: ignored timeoutValue during shutdown");
      }
    } finally {
      if (domain != null) {
        TestUtils.deleteWeblogicDomainResources(domain.getDomainUid());
      }
    }
    LoggerHelper.getLocal().log(Level.INFO, "SUCCESS - {0}", testMethodName);
  }
/**
   * Add shutdown option Timeout at managed server level and verify all pods are Terminated
   * according to the setting.
   *
   * @throws Exception If domain cannot be started or failed to verify shutdown options
   */
Add shutdown option Timeout at managed server level and verify all pods are Terminated
according to the setting.

@throws Exception If domain cannot be started or failed to verify shutdown options
Add shutdown option Timeout at managed server level and verify all pods are Terminated according to the setting . @throws Exception If domain cannot be started or failed to verify shutdown options
@Test
  public void testAddShutdownOptionsToMsTimeout() throws Exception {
    Assumptions.assumeTrue(FULLTEST);
    String testMethodName = new Object() {
    }.getClass().getEnclosingMethod().getName();
    logTestBegin(testMethodName);
    Map<String, Object> shutdownProps = new HashMap();
    shutdownProps.put("timeoutSeconds", 10);
    shutdownProps.put("ignoreSessions", false);
    List<Map<String,Object>> shutdownPropsMSs = new ArrayList<>();
    Map<String, Object> shutdownPropsMyMS = new HashMap();
    shutdownPropsMyMS.put("managed-server1", shutdownProps);
    shutdownPropsMSs.add(shutdownPropsMyMS);
    Map<String, Object> shutdownPropOpt = new HashMap();
    shutdownPropOpt.put("server",shutdownPropsMSs);
    Domain domain = null;
    try {
      domain = createDomain(domainNSShutOpMSTimeout, shutdownPropOpt);
      Assertions.assertNotNull(domain,
          domainNSShutOpMSTimeout
              + " failed to create, returns null");
      Assertions.assertTrue(
          checkShutdownUpdatedProp(domain.getDomainUid() + "-managed-server1", domain.getDomainNs(),"10", "false"),
          domain.getDomainUid()
              + "-managed-server1: "
              + " shutdown property does not match the expected :"
              + " timeoutSeconds=10, ignoreSessions=false");
      domain.buildDeployJavaAppInPod(
          testAppName, scriptName, BaseTest.getUsername(), BaseTest.getPassword());
      domain.callWebAppAndVerifyLoadBalancing(testAppName + "/CounterServlet?", false);
      long delayTime = 80 * 1000;
      long terminationTime = verifyShutdown(delayTime, domain);
      if (terminationTime > delayTime) {
        LoggerHelper.getLocal().log(Level.INFO, "\"FAILURE: ignored timeoutValue during shutdown");
        throw new Exception("FAILURE: ignored timeoutValue during shutdown");
      }
    } finally {
      if (domain != null) {
        TestUtils.deleteWeblogicDomainResources(domain.getDomainUid());
      }
    }
    LoggerHelper.getLocal().log(Level.INFO, "SUCCESS - {0}", testMethodName);
  }
@ Test public void testAddShutdownOptionsToMsTimeout ( ) throws Exception { Assumptions . assumeTrue ( FULLTEST ) ; String testMethodName = new Object ( ) { } . getClass ( ) . getEnclosingMethod ( ) . getName ( ) ; logTestBegin ( testMethodName ) ; Map < String , Object > shutdownProps = new HashMap ( ) ; shutdownProps . put ( "timeoutSeconds" , 10 ) ; shutdownProps . put ( "ignoreSessions" , false ) ; List < Map < String , Object > > shutdownPropsMSs = new ArrayList < > ( ) ; Map < String , Object > shutdownPropsMyMS = new HashMap ( ) ; shutdownPropsMyMS . put ( "managed-server1" , shutdownProps ) ; shutdownPropsMSs . add ( shutdownPropsMyMS ) ; Map < String , Object > shutdownPropOpt = new HashMap ( ) ; shutdownPropOpt . put ( "server" , shutdownPropsMSs ) ; Domain domain = null ; try { domain = createDomain ( domainNSShutOpMSTimeout , shutdownPropOpt ) ; Assertions . assertNotNull ( domain , domainNSShutOpMSTimeout + " failed to create, returns null" ) ; Assertions . assertTrue ( checkShutdownUpdatedProp ( domain . getDomainUid ( ) + "-managed-server1" , domain . getDomainNs ( ) , "10" , "false" ) , domain . getDomainUid ( ) + "-managed-server1: " + " shutdown property does not match the expected :" + " timeoutSeconds=10, ignoreSessions=false" ) ; domain . buildDeployJavaAppInPod ( testAppName , scriptName , BaseTest . getUsername ( ) , BaseTest . getPassword ( ) ) ; domain . callWebAppAndVerifyLoadBalancing ( testAppName + "/CounterServlet?" , false ) ; long delayTime = 80 * 1000 ; long terminationTime = verifyShutdown ( delayTime , domain ) ; if ( terminationTime > delayTime ) { LoggerHelper . getLocal ( ) . log ( Level . INFO , "\"FAILURE: ignored timeoutValue during shutdown" ) ; throw new Exception ( "FAILURE: ignored timeoutValue during shutdown" ) ; } } finally { if ( domain != null ) { TestUtils . deleteWeblogicDomainResources ( domain . getDomainUid ( ) ) ; } } LoggerHelper . getLocal ( ) . log ( Level . INFO , "SUCCESS - {0}" , testMethodName ) ; }
Add shutdown option Timeout at managed server level and verify all pods are Terminated
 according to the setting.
Add shutdown option Timeout at managed server level and verify all pods are Terminated according to the setting .
// testing timeout