integration-tests/src/test/java/oracle/kubernetes/operator/ItSessionMigration.java
@Test
  public void testHttpSessionMigr() throws Exception {
    Assumptions.assumeTrue(FULLTEST);
    String testMethodName = new Object() {
    }.getClass().getEnclosingMethod().getName();
    logTestBegin(testMethodName);

    Map<String, Object> domainMap = domain.getDomainMap();
    final String domainNS = domainMap.get("namespace").toString();
    final String domainUid = domain.getDomainUid();

    int counterNum = 4;
    String testAppPath = testAppName + "/CounterServlet";
    String webServiceSetUrl = testAppPath + "?setCounter=" + counterNum;
    String webServiceGetUrl = testAppPath + "?getCounter";

    String primaryServ = "primary";
    String count = "count";

    // Send the first HTTP request and save HTTP header/sessionID info
    ExecResult result = getHttpResponse(webServiceSetUrl, " -D ");

    // Get primary server name & count number bf primaryServName1 is stopped
    String primaryServName1 = getHttpResponseAttribute(result.stdout(), primaryServ);
    final String countattribute1 = getHttpResponseAttribute(result.stdout(), count);

    // Stop primary server
    domain.shutdownManagedServerUsingServerStartPolicy(primaryServName1);

    // Send the second HTTP request using HTTP header/sessionID info save before
    result = getHttpResponse(webServiceGetUrl, " -b ");

    // Get primary server name & count number af primaryServName1 is stopped
    String primaryServName2 = getHttpResponseAttribute(result.stdout(), primaryServ);
    String countattribute2 = getHttpResponseAttribute(result.stdout(), count);

    // Verify that the count number is from a new primary server
    Assumptions.assumeFalse(
        primaryServName1.trim().equals(primaryServName2.trim()),
        "A new primary server should be picked!");

    // Verify that HTTP session state is migrated by checking the count number same
    // bf and af primaryServName1 stopped
    Assumptions.assumeTrue(
        countattribute1.equals(countattribute2), "HTTP session state is NOT migrated!");

    // Restore test env
    domain.restartManagedServerUsingServerStartPolicy(primaryServName1);
    TestUtils.checkPodReady(domainUid + "-" + primaryServName1, domainNS);

    LoggerHelper.getLocal().log(Level.INFO, "SUCCESS - "
        + testMethodName + ". HTTP session state is migrated!");
  }
/**
   * Verify that HTTP session state is migrated to the new primary server after the primary server
   * shut down.
   *
   * @throws Exception exception
   */
Verify that HTTP session state is migrated to the new primary server after the primary server
shut down.

@throws Exception exception
Verify that HTTP session state is migrated to the new primary server after the primary server shut down . @throws Exception exception
@Test
  public void testHttpSessionMigr() throws Exception {
    Assumptions.assumeTrue(FULLTEST);
    String testMethodName = new Object() {
    }.getClass().getEnclosingMethod().getName();
    logTestBegin(testMethodName);
    Map<String, Object> domainMap = domain.getDomainMap();
    final String domainNS = domainMap.get("namespace").toString();
    final String domainUid = domain.getDomainUid();
    int counterNum = 4;
    String testAppPath = testAppName + "/CounterServlet";
    String webServiceSetUrl = testAppPath + "?setCounter=" + counterNum;
    String webServiceGetUrl = testAppPath + "?getCounter";
    String primaryServ = "primary";
    String count = "count";
    ExecResult result = getHttpResponse(webServiceSetUrl, " -D ");
    String primaryServName1 = getHttpResponseAttribute(result.stdout(), primaryServ);
    final String countattribute1 = getHttpResponseAttribute(result.stdout(), count);
    domain.shutdownManagedServerUsingServerStartPolicy(primaryServName1);
    result = getHttpResponse(webServiceGetUrl, " -b ");
    String primaryServName2 = getHttpResponseAttribute(result.stdout(), primaryServ);
    String countattribute2 = getHttpResponseAttribute(result.stdout(), count);
    Assumptions.assumeFalse(
        primaryServName1.trim().equals(primaryServName2.trim()),
        "A new primary server should be picked!");
    Assumptions.assumeTrue(
        countattribute1.equals(countattribute2), "HTTP session state is NOT migrated!");
    domain.restartManagedServerUsingServerStartPolicy(primaryServName1);
    TestUtils.checkPodReady(domainUid + "-" + primaryServName1, domainNS);
    LoggerHelper.getLocal().log(Level.INFO, "SUCCESS - "
        + testMethodName + ". HTTP session state is migrated!");
  }
@ Test public void testHttpSessionMigr ( ) throws Exception { Assumptions . assumeTrue ( FULLTEST ) ; String testMethodName = new Object ( ) { } . getClass ( ) . getEnclosingMethod ( ) . getName ( ) ; logTestBegin ( testMethodName ) ; Map < String , Object > domainMap = domain . getDomainMap ( ) ; final String domainNS = domainMap . get ( "namespace" ) . toString ( ) ; final String domainUid = domain . getDomainUid ( ) ; int counterNum = 4 ; String testAppPath = testAppName + "/CounterServlet" ; String webServiceSetUrl = testAppPath + "?setCounter=" + counterNum ; String webServiceGetUrl = testAppPath + "?getCounter" ; String primaryServ = "primary" ; String count = "count" ; ExecResult result = getHttpResponse ( webServiceSetUrl , " -D " ) ; String primaryServName1 = getHttpResponseAttribute ( result . stdout ( ) , primaryServ ) ; final String countattribute1 = getHttpResponseAttribute ( result . stdout ( ) , count ) ; domain . shutdownManagedServerUsingServerStartPolicy ( primaryServName1 ) ; result = getHttpResponse ( webServiceGetUrl , " -b " ) ; String primaryServName2 = getHttpResponseAttribute ( result . stdout ( ) , primaryServ ) ; String countattribute2 = getHttpResponseAttribute ( result . stdout ( ) , count ) ; Assumptions . assumeFalse ( primaryServName1 . trim ( ) . equals ( primaryServName2 . trim ( ) ) , "A new primary server should be picked!" ) ; Assumptions . assumeTrue ( countattribute1 . equals ( countattribute2 ) , "HTTP session state is NOT migrated!" ) ; domain . restartManagedServerUsingServerStartPolicy ( primaryServName1 ) ; TestUtils . checkPodReady ( domainUid + "-" + primaryServName1 , domainNS ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "SUCCESS - " + testMethodName + ". HTTP session state is migrated!" ) ; }
Verify that HTTP session state is migrated to the new primary server after the primary server
 shut down.
Verify that HTTP session state is migrated to the new primary server after the primary server shut down .
// Send the first HTTP request and save HTTP header/sessionID info // Get primary server name & count number bf primaryServName1 is stopped // Stop primary server // Send the second HTTP request using HTTP header/sessionID info save before // Get primary server name & count number af primaryServName1 is stopped // Verify that the count number is from a new primary server // Verify that HTTP session state is migrated by checking the count number same // bf and af primaryServName1 stopped // Restore test env