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

    Assumptions.assumeTrue(FULLTEST);
    String testMethodName = new Object() {
    }.getClass().getEnclosingMethod().getName();
    logTestBegin(testMethodName);

    Map<String, Object> shutdownProps = new HashMap();
    shutdownProps.put("timeoutSeconds", 160);
    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(domainNSShutOpMSIgnoreSessions, shutdownPropOpt);
      Assertions.assertNotNull(domain,
          domainNSShutOpMSIgnoreSessions
              + " failed to create, returns null");
      Assertions.assertTrue(
          checkShutdownUpdatedProp(domain.getDomainUid()
              + "-managed-server1", domain.getDomainNs(),"160", "false"),
          domain.getDomainUid()
              + "-managed-server1: "
              + " shutdown property does not match the expected :"
              + " timeoutSeconds=160, ignoreSessions=false");
      domain.buildDeployJavaAppInPod(
          testAppName, scriptName, BaseTest.getUsername(), BaseTest.getPassword());
      domain.callWebAppAndVerifyLoadBalancing(testAppName + "/CounterServlet?", false);

      long delayTime = 80 * 1000;
      long terminationTimeWithIgnoreSessionFalse = verifyShutdown(delayTime, domain);

      if (terminationTimeWithIgnoreSessionFalse < delayTime) {
        LoggerHelper.getLocal().log(Level.INFO, "FAILURE: ignored opened session during shutdown");
        throw new Exception("FAILURE: ignored opened session during shutdown");
      }
      LoggerHelper.getLocal().log(Level.INFO,
          " Termination time with ignoreSession=false :" + terminationTimeWithIgnoreSessionFalse);
    } finally {
      if (domain != null) {
        TestUtils.deleteWeblogicDomainResources(domain.getDomainUid());
      }
    }
    LoggerHelper.getLocal().log(Level.INFO, "SUCCESS - {0}", testMethodName);
  }
/**
   * Start domain with added shutdown options at the managed server level with IgnoreSessions=false
   * and verify values are propagated to specified server level. Server shuts down only after sessions are ended.
   *
   * @throws Exception If domain cannot be started or failed to verify shutdown options
   */
Start domain with added shutdown options at the managed server level with IgnoreSessions=false
and verify values are propagated to specified server level. Server shuts down only after sessions are ended.

@throws Exception If domain cannot be started or failed to verify shutdown options
Start domain with added shutdown options at the managed server level with IgnoreSessions = false and verify values are propagated to specified server level . Server shuts down only after sessions are ended . @throws Exception If domain cannot be started or failed to verify shutdown options
@Test
  public void testAddShutdownOptionsToMsIgnoreSessions() throws Exception {
    Assumptions.assumeTrue(FULLTEST);
    String testMethodName = new Object() {
    }.getClass().getEnclosingMethod().getName();
    logTestBegin(testMethodName);
    Map<String, Object> shutdownProps = new HashMap();
    shutdownProps.put("timeoutSeconds", 160);
    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(domainNSShutOpMSIgnoreSessions, shutdownPropOpt);
      Assertions.assertNotNull(domain,
          domainNSShutOpMSIgnoreSessions
              + " failed to create, returns null");
      Assertions.assertTrue(
          checkShutdownUpdatedProp(domain.getDomainUid()
              + "-managed-server1", domain.getDomainNs(),"160", "false"),
          domain.getDomainUid()
              + "-managed-server1: "
              + " shutdown property does not match the expected :"
              + " timeoutSeconds=160, ignoreSessions=false");
      domain.buildDeployJavaAppInPod(
          testAppName, scriptName, BaseTest.getUsername(), BaseTest.getPassword());
      domain.callWebAppAndVerifyLoadBalancing(testAppName + "/CounterServlet?", false);
      long delayTime = 80 * 1000;
      long terminationTimeWithIgnoreSessionFalse = verifyShutdown(delayTime, domain);
      if (terminationTimeWithIgnoreSessionFalse < delayTime) {
        LoggerHelper.getLocal().log(Level.INFO, "FAILURE: ignored opened session during shutdown");
        throw new Exception("FAILURE: ignored opened session during shutdown");
      }
      LoggerHelper.getLocal().log(Level.INFO,
          " Termination time with ignoreSession=false :" + terminationTimeWithIgnoreSessionFalse);
    } finally {
      if (domain != null) {
        TestUtils.deleteWeblogicDomainResources(domain.getDomainUid());
      }
    }
    LoggerHelper.getLocal().log(Level.INFO, "SUCCESS - {0}", testMethodName);
  }
@ Test public void testAddShutdownOptionsToMsIgnoreSessions ( ) throws Exception { Assumptions . assumeTrue ( FULLTEST ) ; String testMethodName = new Object ( ) { } . getClass ( ) . getEnclosingMethod ( ) . getName ( ) ; logTestBegin ( testMethodName ) ; Map < String , Object > shutdownProps = new HashMap ( ) ; shutdownProps . put ( "timeoutSeconds" , 160 ) ; 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 ( domainNSShutOpMSIgnoreSessions , shutdownPropOpt ) ; Assertions . assertNotNull ( domain , domainNSShutOpMSIgnoreSessions + " failed to create, returns null" ) ; Assertions . assertTrue ( checkShutdownUpdatedProp ( domain . getDomainUid ( ) + "-managed-server1" , domain . getDomainNs ( ) , "160" , "false" ) , domain . getDomainUid ( ) + "-managed-server1: " + " shutdown property does not match the expected :" + " timeoutSeconds=160, ignoreSessions=false" ) ; domain . buildDeployJavaAppInPod ( testAppName , scriptName , BaseTest . getUsername ( ) , BaseTest . getPassword ( ) ) ; domain . callWebAppAndVerifyLoadBalancing ( testAppName + "/CounterServlet?" , false ) ; long delayTime = 80 * 1000 ; long terminationTimeWithIgnoreSessionFalse = verifyShutdown ( delayTime , domain ) ; if ( terminationTimeWithIgnoreSessionFalse < delayTime ) { LoggerHelper . getLocal ( ) . log ( Level . INFO , "FAILURE: ignored opened session during shutdown" ) ; throw new Exception ( "FAILURE: ignored opened session during shutdown" ) ; } LoggerHelper . getLocal ( ) . log ( Level . INFO , " Termination time with ignoreSession=false :" + terminationTimeWithIgnoreSessionFalse ) ; } finally { if ( domain != null ) { TestUtils . deleteWeblogicDomainResources ( domain . getDomainUid ( ) ) ; } } LoggerHelper . getLocal ( ) . log ( Level . INFO , "SUCCESS - {0}" , testMethodName ) ; }
Start domain with added shutdown options at the managed server level with IgnoreSessions=false
 and verify values are propagated to specified server level.
Start domain with added shutdown options at the managed server level with IgnoreSessions = false and verify values are propagated to specified server level .