/*
 * Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v. 2.0, which is available at
 * http://www.eclipse.org/legal/epl-2.0.
 *
 * This Source Code may also be made available under the following Secondary
 * Licenses when the conditions for such availability set forth in the
 * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
 * version 2 with the GNU Classpath Exception, which is available at
 * https://www.gnu.org/software/classpath/license.html.
 *
 * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
 */

/*
 * $Id:$
 */
package com.sun.ts.tests.servlet.api.jakarta_servlet.dispatchtest;

import java.io.PrintWriter;

import com.sun.javatest.Status;
import com.sun.ts.tests.servlet.common.client.AbstractUrlClient;

public class URLClient extends AbstractUrlClient {

  String CONTEXT_ROOT = "/servlet_js_dispatchtest_web";

  /**
   * Entry point for different-VM execution. It should delegate to method
   * run(String[], PrintWriter, PrintWriter), and this method should not contain
   * any test configuration.
   */
  public static void main(String[] args) {
    URLClient theTests = new URLClient();
    Status s = theTests.run(args, new PrintWriter(System.out),
        new PrintWriter(System.err));
    s.exit();
  }

  /**
   * Entry point for same-VM execution. In different-VM execution, the main
   * method delegates to this method.
   */
  public Status run(String args[], PrintWriter out, PrintWriter err) {
    setServletName("DispatchTestServlet");
    setContextRoot(CONTEXT_ROOT);

    return super.run(args, out, err);
  }

  /*
   * @class.setup_props: webServerHost; webServerPort; ts_home;
   */

  /* Run test */
  /*
   * @testName: dispatchReturnTest
   * 
   * @assertion_ids: Servlet:JAVADOC:639; Servlet:JAVADOC:639.2;
   * Servlet:JAVADOC:639.3; Servlet:JAVADOC:639.4; Servlet:JAVADOC:639.5;
   * Servlet:JAVADOC:703; Servlet:JAVADOC:707; Servlet:JAVADOC:708;
   * Servlet:JAVADOC:710;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(); call ac.dispatch(); call
   * ServletRequest.isAsyncSupported() call ServletRequest.isAsyncStarted() call
   * ServletRequest.getDispatcherType() check System times: before calling
   * dispatch; dispatch returns dispatch operation starts. verifies all work
   * accordingly.
   */
  public void dispatchReturnTest() throws Fault {
    TEST_PROPS.setProperty(APITEST, "dispatchReturnTest");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_dispatchReturnTest|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "After dispatch|"
            + "ASYNC_STARTED_dispatchReturnTest|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC");
    invoke();
  }

  /*
   * @testName: dispatchReturnTest1
   * 
   * @assertion_ids: Servlet:JAVADOC:639; Servlet:JAVADOC:639.2;
   * Servlet:JAVADOC:639.3; Servlet:JAVADOC:639.4; Servlet:JAVADOC:639.5;
   * Servlet:JAVADOC:703; Servlet:JAVADOC:707; Servlet:JAVADOC:708;
   * Servlet:JAVADOC:712;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(request, response); call
   * ac.dispatch(); call ServletRequest.isAsyncSupported() call
   * ServletRequest.isAsyncStarted() call ServletRequest.getDispatcherType()
   * check System times: before calling dispatch; dispatch returns dispatch
   * operation starts. verifies all work accordingly.
   */
  public void dispatchReturnTest1() throws Fault {
    TEST_PROPS.setProperty(APITEST, "dispatchReturnTest1");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_dispatchReturnTest1|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "After dispatch|"
            + "ASYNC_STARTED_dispatchReturnTest1|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC");
    invoke();
  }

  /*
   * @testName: dispatchReturnTest2
   * 
   * @assertion_ids: Servlet:JAVADOC:640; Servlet:JAVADOC:640.1;
   * Servlet:JAVADOC:703; Servlet:JAVADOC:707; Servlet:JAVADOC:708;
   * Servlet:JAVADOC:710;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(); call ac.dispatch(URI);
   * call ServletRequest.isAsyncSupported() call ServletRequest.isAsyncStarted()
   * call ServletRequest.getDispatcherType() check System times: before calling
   * dispatch; dispatch returns dispatch operation starts. verifies all work
   * accordingly.
   */
  public void dispatchReturnTest2() throws Fault {
    TEST_PROPS.setProperty(APITEST, "dispatchReturnTest2");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_dispatchReturnTest2|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "After dispatch|"
            + "ASYNC_STARTED_dispatchTest|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC");
    invoke();
  }

  /*
   * @testName: dispatchReturnTest3
   * 
   * @assertion_ids: Servlet:JAVADOC:640; Servlet:JAVADOC:640.1;
   * Servlet:JAVADOC:703; Servlet:JAVADOC:707; Servlet:JAVADOC:708;
   * Servlet:JAVADOC:712;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(request, response); call
   * ac.dispatch(URI); call ServletRequest.isAsyncSupported() call
   * ServletRequest.isAsyncStarted() call ServletRequest.getDispatcherType()
   * check System times: before calling dispatch; dispatch returns dispatch
   * operation starts. verifies all work accordingly.
   */
  public void dispatchReturnTest3() throws Fault {
    TEST_PROPS.setProperty(APITEST, "dispatchReturnTest3");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_dispatchReturnTest3|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "After dispatch|"
            + "ASYNC_STARTED_dispatchTest|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC");
    invoke();
  }

  /*
   * @testName: dispatchReturnTest4
   * 
   * @assertion_ids: Servlet:JAVADOC:219; Servlet:JAVADOC:641;
   * Servlet:JAVADOC:641.1; Servlet:JAVADOC:703; Servlet:JAVADOC:706;
   * Servlet:JAVADOC:707; Servlet:JAVADOC:708; Servlet:JAVADOC:710;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(); call
   * ac.dispatch(ServletContext,URI); call ServletRequest.isAsyncSupported()
   * call ServletRequest.isAsyncStarted() call
   * ServletRequest.getDispatcherType() check System times: before calling
   * dispatch; dispatch returns dispatch operation starts. verifies all work
   * accordingly.
   */
  public void dispatchReturnTest4() throws Fault {
    TEST_PROPS.setProperty(APITEST, "dispatchReturnTest4");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_dispatchReturnTest4|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "After dispatch|"
            + "ASYNC_STARTED_dispatchTest10|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC");
    invoke();
  }

  /*
   * @testName: dispatchReturnTest5
   * 
   * @assertion_ids: Servlet:JAVADOC:219; Servlet:JAVADOC:641;
   * Servlet:JAVADOC:641.1; Servlet:JAVADOC:703; Servlet:JAVADOC:706;
   * Servlet:JAVADOC:707; Servlet:JAVADOC:708; Servlet:JAVADOC:712;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(request, response); call
   * ac.dispatch(ServletContext,URI); call ServletRequest.isAsyncSupported()
   * call ServletRequest.isAsyncStarted() call
   * ServletRequest.getDispatcherType() check System times: before calling
   * dispatch; dispatch returns dispatch operation starts. verifies all work
   * accordingly.
   */
  public void dispatchReturnTest5() throws Fault {
    TEST_PROPS.setProperty(APITEST, "dispatchReturnTest5");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_dispatchReturnTest5|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "After dispatch|"
            + "ASYNC_STARTED_dispatchTest10|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC");
    invoke();
  }

  /*
   * @testName: startAsyncAgainTest
   * 
   * @assertion_ids: Servlet:JAVADOC:639; Servlet:JAVADOC:639.2;
   * Servlet:JAVADOC:639.3; Servlet:JAVADOC:639.4; Servlet:JAVADOC:639.5;
   * Servlet:JAVADOC:703; Servlet:JAVADOC:707; Servlet:JAVADOC:708;
   * Servlet:JAVADOC:710;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(); call ac.dispatch(); call
   * ServletRequest.isAsyncSupported() call ServletRequest.isAsyncStarted() call
   * ServletRequest.getDispatcherType() check System times: before calling
   * dispatch; dispatch returns dispatch operation starts. StartAsync and
   * dispatch again, and check all above; verifies all work accordingly.
   */
  public void startAsyncAgainTest() throws Fault {
    TEST_PROPS.setProperty(APITEST, "startAsyncAgainTest");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_startAsyncAgainTest|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "After dispatch|"
            + "ASYNC_STARTED_startAsyncAgainTest|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC|"
            + "Before second dispatch|" + "second dispatch return|"
            + "After second dispatch|"
            + "ASYNC_STARTED_AGAIN_startAsyncAgainTest|"
            + "IsAsyncSupported=true|" + "IsAsyncStarted=false|"
            + "DispatcherType=ASYNC");
    invoke();
  }

  /*
   * @testName: startAsyncAgainTest1
   * 
   * @assertion_ids: Servlet:JAVADOC:639; Servlet:JAVADOC:639.2;
   * Servlet:JAVADOC:639.3; Servlet:JAVADOC:639.4; Servlet:JAVADOC:639.5;
   * Servlet:JAVADOC:703; Servlet:JAVADOC:707; Servlet:JAVADOC:708;
   * Servlet:JAVADOC:712;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(request, response); call
   * ac.dispatch(); call ServletRequest.isAsyncSupported() call
   * ServletRequest.isAsyncStarted() call ServletRequest.getDispatcherType()
   * check System times: before calling dispatch; dispatch returns dispatch
   * operation starts. StartAsync and dispatch again, and check all above;
   * verifies all work accordingly.
   */
  public void startAsyncAgainTest1() throws Fault {
    TEST_PROPS.setProperty(APITEST, "startAsyncAgainTest1");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_startAsyncAgainTest1|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "After dispatch|"
            + "ASYNC_STARTED_startAsyncAgainTest1|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC|"
            + "Before second dispatch|" + "second dispatch return|"
            + "After second dispatch|"
            + "ASYNC_STARTED_AGAIN_startAsyncAgainTest1|"
            + "IsAsyncSupported=true|" + "IsAsyncStarted=false|"
            + "DispatcherType=ASYNC");
    invoke();
  }

  /*
   * @testName: startAsyncAgainTest2
   * 
   * @assertion_ids: Servlet:JAVADOC:639; Servlet:JAVADOC:639.2;
   * Servlet:JAVADOC:639.3; Servlet:JAVADOC:639.4; Servlet:JAVADOC:639.5;
   * Servlet:JAVADOC:639.10; Servlet:JAVADOC:703; Servlet:JAVADOC:707;
   * Servlet:JAVADOC:708; Servlet:JAVADOC:710;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(); call ac.dispatch(); call
   * ServletRequest.isAsyncSupported() call ServletRequest.isAsyncStarted() call
   * ServletRequest.getDispatcherType() check System times: before calling
   * dispatch; dispatch returns dispatch operation starts. StartAsync again in
   * dispatched thread, and check all above; ac.complete(); verifies all work
   * accordingly.
   */
  public void startAsyncAgainTest2() throws Fault {
    TEST_PROPS.setProperty(APITEST, "startAsyncAgainTest2");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_startAsyncAgainTest2|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "After dispatch|"
            + "ASYNC_STARTED_startAsyncAgainTest2|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC|"
            + "Before complete");
    invoke();
  }

  /*
   * @testName: startAsyncAgainTest3
   * 
   * @assertion_ids: Servlet:JAVADOC:639; Servlet:JAVADOC:639.2;
   * Servlet:JAVADOC:639.3; Servlet:JAVADOC:639.4; Servlet:JAVADOC:639.5;
   * Servlet:JAVADOC:639.10; Servlet:JAVADOC:703; Servlet:JAVADOC:707;
   * Servlet:JAVADOC:708; Servlet:JAVADOC:712;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(request, response); call
   * ac.dispatch(); call ServletRequest.isAsyncSupported() call
   * ServletRequest.isAsyncStarted() call ServletRequest.getDispatcherType()
   * check System times: before calling dispatch; dispatch returns dispatch
   * operation starts. StartAsync again in dispatched thread, and check all
   * above; call ac.complete(); verifies all work accordingly.
   */
  public void startAsyncAgainTest3() throws Fault {
    TEST_PROPS.setProperty(APITEST, "startAsyncAgainTest3");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_startAsyncAgainTest3|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "After dispatch|"
            + "ASYNC_STARTED_startAsyncAgainTest3|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC|"
            + "Before complete");
    invoke();
  }

  /*
   * @testName: startAsyncAgainTest4
   * 
   * @assertion_ids: Servlet:JAVADOC:639; Servlet:JAVADOC:639.2;
   * Servlet:JAVADOC:639.3; Servlet:JAVADOC:639.4; Servlet:JAVADOC:639.5;
   * Servlet:JAVADOC:639.9; Servlet:JAVADOC:703; Servlet:JAVADOC:707;
   * Servlet:JAVADOC:708; Servlet:JAVADOC:710;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(); call ac.dispatch(); call
   * ServletRequest.isAsyncSupported() call ServletRequest.isAsyncStarted() call
   * ServletRequest.getDispatcherType() check System times: before calling
   * dispatch; dispatch returns dispatch operation starts. StartAsync in
   * dispatched thread, and check all above; StartAsync again in the
   * asynchrounous thread verifies all work accordingly.
   */
  public void startAsyncAgainTest4() throws Fault {
    TEST_PROPS.setProperty(APITEST, "startAsyncAgainTest4");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_startAsyncAgainTest4|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "After dispatch|"
            + "ASYNC_STARTED_startAsyncAgainTest4|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC|"
            + "startAsync called|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=true|" + "DispatcherType=ASYNC|"
            + "startAsync called again|"
            + "Expected IllegalStateException thrown");
    invoke();
  }

  /*
   * @testName: startAsyncAgainTest5
   * 
   * @assertion_ids: Servlet:JAVADOC:639; Servlet:JAVADOC:639.2;
   * Servlet:JAVADOC:639.3; Servlet:JAVADOC:639.4; Servlet:JAVADOC:639.5;
   * Servlet:JAVADOC:639.9; Servlet:JAVADOC:703; Servlet:JAVADOC:707;
   * Servlet:JAVADOC:708; Servlet:JAVADOC:712;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(request, response); call
   * ac.dispatch(); call ServletRequest.isAsyncSupported() call
   * ServletRequest.isAsyncStarted() call ServletRequest.getDispatcherType()
   * check System times: before calling dispatch; dispatch returns dispatch
   * operation starts. StartAsync in dispatched thread, and check all above;
   * StartAsync again in the asynchrounous thread verifies all work accordingly.
   */
  public void startAsyncAgainTest5() throws Fault {
    TEST_PROPS.setProperty(APITEST, "startAsyncAgainTest5");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_startAsyncAgainTest5|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "After dispatch|"
            + "ASYNC_STARTED_startAsyncAgainTest5|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC|"
            + "startAsync called|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=true|" + "DispatcherType=ASYNC|"
            + "startAsync called again|"
            + "Expected IllegalStateException thrown");
    invoke();
  }

  /*
   * @testName: startAsyncAgainTest6
   * 
   * @assertion_ids: Servlet:JAVADOC:640; Servlet:JAVADOC:640.1;
   * Servlet:JAVADOC:640.2; Servlet:JAVADOC:640.4; Servlet:JAVADOC:703;
   * Servlet:JAVADOC:707; Servlet:JAVADOC:708; Servlet:JAVADOC:710;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(); call ac.dispatch(URI);
   * call ServletRequest.isAsyncSupported() call ServletRequest.isAsyncStarted()
   * call ServletRequest.getDispatcherType() check request's attributes:
   * REQUEST_URI CONTEXT_PATH PATH_INFO SERVLET_PATH QUERY_STRING
   * ASYNC_REQUEST_URI ASYNC_CONTEXT_PATH ASYNC_PATH_INFO ASYNC_SERVLET_PATH
   * ASYNC_QUERY_STRING check System times: before calling dispatch; dispatch
   * returns dispatch operation starts. StartAsync again, and check all above;
   * call ac.dispatch(URI); verifies all work accordingly.
   */
  public void startAsyncAgainTest6() throws Fault {
    TEST_PROPS.setProperty(APITEST, "startAsyncAgainTest6");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_startAsyncAgainTest6|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "After dispatch|"
            + "ASYNC_STARTED_dispatchTest1|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC|"
            + "Before second dispatch|" + "second dispatch return|"
            + "After dispatch|" + "ASYNC_STARTED_dispatchTest|"
            + "IsAsyncSupported=true|" + "IsAsyncStarted=false|"
            + "DispatcherType=ASYNC");
    invoke();
  }

  /*
   * @testName: startAsyncAgainTest7
   * 
   * @assertion_ids: Servlet:JAVADOC:640; Servlet:JAVADOC:640.1;
   * Servlet:JAVADOC:640.2; Servlet:JAVADOC:640.4; Servlet:JAVADOC:703;
   * Servlet:JAVADOC:707; Servlet:JAVADOC:708; Servlet:JAVADOC:712;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(request, response); call
   * ac.dispatch(URI); call ServletRequest.isAsyncSupported() call
   * ServletRequest.isAsyncStarted() call ServletRequest.getDispatcherType()
   * check request's attributes: REQUEST_URI CONTEXT_PATH PATH_INFO SERVLET_PATH
   * QUERY_STRING ASYNC_REQUEST_URI ASYNC_CONTEXT_PATH ASYNC_PATH_INFO
   * ASYNC_SERVLET_PATH ASYNC_QUERY_STRING check System times: before calling
   * dispatch; dispatch returns dispatch operation starts. StartAsync again, and
   * check all above; call ac.dispatch(URI); verifies all work accordingly.
   */
  public void startAsyncAgainTest7() throws Fault {
    TEST_PROPS.setProperty(APITEST, "startAsyncAgainTest7");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_startAsyncAgainTest7|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "After dispatch|"
            + "ASYNC_STARTED_dispatchTest2|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC|"
            + "Before second dispatch|" + "second dispatch return|"
            + "After dispatch|" + "ASYNC_STARTED_dispatchTest|"
            + "IsAsyncSupported=true|" + "IsAsyncStarted=false|"
            + "DispatcherType=ASYNC");
    invoke();
  }

  /*
   * @testName: startAsyncAgainTest8
   * 
   * @assertion_ids: Servlet:JAVADOC:640; Servlet:JAVADOC:640.1;
   * Servlet:JAVADOC:640.2; Servlet:JAVADOC:640.4; Servlet:JAVADOC:703;
   * Servlet:JAVADOC:707; Servlet:JAVADOC:708; Servlet:JAVADOC:710;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(); call ac.dispatch(URI);
   * call ServletRequest.isAsyncSupported() call ServletRequest.isAsyncStarted()
   * call ServletRequest.getDispatcherType() check request's attributes:
   * REQUEST_URI CONTEXT_PATH PATH_INFO SERVLET_PATH QUERY_STRING
   * ASYNC_REQUEST_URI ASYNC_CONTEXT_PATH ASYNC_PATH_INFO ASYNC_SERVLET_PATH
   * ASYNC_QUERY_STRING check System times: before calling dispatch; dispatch
   * returns dispatch operation starts. StartAsync again in dispatched thread,
   * and check all above; ac.complete(); verifies all work accordingly.
   */
  public void startAsyncAgainTest8() throws Fault {
    TEST_PROPS.setProperty(APITEST, "startAsyncAgainTest8");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_startAsyncAgainTest8|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "After dispatch|"
            + "ASYNC_STARTED_dispatchTest3|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC|"
            + "Before complete");
    invoke();
  }

  /*
   * @testName: startAsyncAgainTest9
   * 
   * @assertion_ids: Servlet:JAVADOC:640; Servlet:JAVADOC:640.1;
   * Servlet:JAVADOC:640.2; Servlet:JAVADOC:640.4; Servlet:JAVADOC:703;
   * Servlet:JAVADOC:707; Servlet:JAVADOC:708; Servlet:JAVADOC:712;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(request, response); call
   * ac.dispatch(URI); call ServletRequest.isAsyncSupported() call
   * ServletRequest.isAsyncStarted() call ServletRequest.getDispatcherType()
   * check request's attributes: REQUEST_URI CONTEXT_PATH PATH_INFO SERVLET_PATH
   * QUERY_STRING ASYNC_REQUEST_URI ASYNC_CONTEXT_PATH ASYNC_PATH_INFO
   * ASYNC_SERVLET_PATH ASYNC_QUERY_STRING check System times: before calling
   * dispatch; dispatch returns dispatch operation starts. StartAsync again in
   * dispatched thread, and check all above; call ac.complete(); verifies all
   * work accordingly.
   */
  public void startAsyncAgainTest9() throws Fault {
    TEST_PROPS.setProperty(APITEST, "startAsyncAgainTest9");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_startAsyncAgainTest9|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "After dispatch|"
            + "ASYNC_STARTED_dispatchTest4|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC|"
            + "Before complete");
    invoke();
  }

  /*
   * @testName: startAsyncAgainTest10
   * 
   * @assertion_ids: Servlet:JAVADOC:640; Servlet:JAVADOC:640.1;
   * Servlet:JAVADOC:640.2; Servlet:JAVADOC:640.3; Servlet:JAVADOC:703;
   * Servlet:JAVADOC:707; Servlet:JAVADOC:708; Servlet:JAVADOC:710;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(); call ac.dispatch(URI);
   * call ServletRequest.isAsyncSupported() call ServletRequest.isAsyncStarted()
   * call ServletRequest.getDispatcherType() check request's attributes:
   * REQUEST_URI CONTEXT_PATH PATH_INFO SERVLET_PATH QUERY_STRING
   * ASYNC_REQUEST_URI ASYNC_CONTEXT_PATH ASYNC_PATH_INFO ASYNC_SERVLET_PATH
   * ASYNC_QUERY_STRING check System times: before calling dispatch; dispatch
   * returns dispatch operation starts. StartAsync in dispatched thread, and
   * check all above; StartAsync again in the asynchrounous thread verifies all
   * work accordingly.
   */
  public void startAsyncAgainTest10() throws Fault {
    TEST_PROPS.setProperty(APITEST, "startAsyncAgainTest10");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_startAsyncAgainTest10|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "After dispatch|"
            + "ASYNC_STARTED_dispatchTest5|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC|"
            + "startAsync called|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=true|" + "DispatcherType=ASYNC|"
            + "startAsync called again|"
            + "Expected IllegalStateException thrown");
    invoke();
  }

  /*
   * @testName: startAsyncAgainTest11
   * 
   * @assertion_ids: Servlet:JAVADOC:640; Servlet:JAVADOC:640.1;
   * Servlet:JAVADOC:640.2; Servlet:JAVADOC:640.3; Servlet:JAVADOC:703;
   * Servlet:JAVADOC:707; Servlet:JAVADOC:708; Servlet:JAVADOC:712;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(request, response); call
   * ac.dispatch(); call ServletRequest.isAsyncSupported() call
   * ServletRequest.isAsyncStarted() call ServletRequest.getDispatcherType()
   * check request's attributes: REQUEST_URI CONTEXT_PATH PATH_INFO SERVLET_PATH
   * QUERY_STRING ASYNC_REQUEST_URI ASYNC_CONTEXT_PATH ASYNC_PATH_INFO
   * ASYNC_SERVLET_PATH ASYNC_QUERY_STRING check System times: before calling
   * dispatch; dispatch returns dispatch operation starts. StartAsync in
   * dispatched thread, and check all above; StartAsync again in the
   * asynchrounous thread verifies all work accordingly.
   */
  public void startAsyncAgainTest11() throws Fault {
    TEST_PROPS.setProperty(APITEST, "startAsyncAgainTest11");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_startAsyncAgainTest11|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "After dispatch|"
            + "ASYNC_STARTED_dispatchTest6|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC|"
            + "startAsync called|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=true|" + "DispatcherType=ASYNC|"
            + "startAsync called again|"
            + "Expected IllegalStateException thrown");
    invoke();
  }

  /*
   * @testName: startAsyncAgainTest12
   * 
   * @assertion_ids: Servlet:JAVADOC:219; Servlet:JAVADOC:641;
   * Servlet:JAVADOC:641.1; Servlet:JAVADOC:641.4; Servlet:JAVADOC:703;
   * Servlet:JAVADOC:706; Servlet:JAVADOC:707; Servlet:JAVADOC:708;
   * Servlet:JAVADOC:710;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(); call
   * ac.dispatch(ServletContext, URI); call ServletRequest.isAsyncSupported()
   * call ServletRequest.isAsyncStarted() call
   * ServletRequest.getDispatcherType() check System times: before calling
   * dispatch; dispatch returns dispatch operation starts. StartAsync and
   * dispatch again, and check all above; verifies all work accordingly.
   */
  public void startAsyncAgainTest12() throws Fault {
    TEST_PROPS.setProperty(APITEST, "startAsyncAgainTest12");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_startAsyncAgainTest12|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "After dispatch|"
            + "ASYNC_STARTED_dispatchTest11|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC|"
            + "Before second dispatch|" + "second dispatch return|"
            + "After dispatch|" + "ASYNC_STARTED_dispatchTest|"
            + "IsAsyncSupported=true|" + "IsAsyncStarted=false|"
            + "DispatcherType=ASYNC");
    invoke();
  }

  /*
   * @testName: startAsyncAgainTest13
   * 
   * @assertion_ids: Servlet:JAVADOC:219; Servlet:JAVADOC:641;
   * Servlet:JAVADOC:641.1; Servlet:JAVADOC:641.4; Servlet:JAVADOC:703;
   * Servlet:JAVADOC:706; Servlet:JAVADOC:707; Servlet:JAVADOC:708;
   * Servlet:JAVADOC:712;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(request, response); call
   * ac.dispatch(ServletContext, URI); call ServletRequest.isAsyncSupported()
   * call ServletRequest.isAsyncStarted() call
   * ServletRequest.getDispatcherType() check System times: before calling
   * dispatch; dispatch returns dispatch operation starts. StartAsync and
   * dispatch again, and check all above; verifies all work accordingly.
   */
  public void startAsyncAgainTest13() throws Fault {
    TEST_PROPS.setProperty(APITEST, "startAsyncAgainTest13");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_startAsyncAgainTest13|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "After dispatch|"
            + "ASYNC_STARTED_dispatchTest12|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC|"
            + "Before second dispatch|" + "second dispatch return|"
            + "After dispatch|" + "ASYNC_STARTED_dispatchTest|"
            + "IsAsyncSupported=true|" + "IsAsyncStarted=false|"
            + "DispatcherType=ASYNC");
    invoke();
  }

  /*
   * @testName: startAsyncAgainTest14
   * 
   * @assertion_ids: Servlet:JAVADOC:219; Servlet:JAVADOC:641;
   * Servlet:JAVADOC:641.1; Servlet:JAVADOC:641.4; Servlet:JAVADOC:703;
   * Servlet:JAVADOC:706;; Servlet:JAVADOC:707; Servlet:JAVADOC:708;
   * Servlet:JAVADOC:710;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(); call
   * ac.dispatch(ServletContext, URI); call ServletRequest.isAsyncSupported()
   * call ServletRequest.isAsyncStarted() call
   * ServletRequest.getDispatcherType() check System times: before calling
   * dispatch; dispatch returns dispatch operation starts. StartAsync again in
   * dispatched thread, and check all above; ac.complete(); verifies all work
   * accordingly.
   */
  public void startAsyncAgainTest14() throws Fault {
    TEST_PROPS.setProperty(APITEST, "startAsyncAgainTest14");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_startAsyncAgainTest14|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "After dispatch|"
            + "ASYNC_STARTED_dispatchTest13|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC|"
            + "Before complete");
    invoke();
  }

  /*
   * @testName: startAsyncAgainTest15
   * 
   * @assertion_ids: Servlet:JAVADOC:219; Servlet:JAVADOC:641;
   * Servlet:JAVADOC:641.1; Servlet:JAVADOC:641.4; Servlet:JAVADOC:703;
   * Servlet:JAVADOC:706; Servlet:JAVADOC:707; Servlet:JAVADOC:708;
   * Servlet:JAVADOC:712;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(request, response); call
   * ac.dispatch(); call ServletRequest.isAsyncSupported() call
   * ServletRequest.isAsyncStarted() call ServletRequest.getDispatcherType()
   * check System times: before calling dispatch; dispatch returns dispatch
   * operation starts. StartAsync again in dispatched thread, and check all
   * above; call ac.complete(); verifies all work accordingly.
   */
  public void startAsyncAgainTest15() throws Fault {
    TEST_PROPS.setProperty(APITEST, "startAsyncAgainTest15");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_startAsyncAgainTest15|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "After dispatch|"
            + "ASYNC_STARTED_dispatchTest14|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC|"
            + "Before complete");
    invoke();
  }

  /*
   * @testName: startAsyncAgainTest16
   * 
   * @assertion_ids: Servlet:JAVADOC:219; Servlet:JAVADOC:641;
   * Servlet:JAVADOC:641.3; Servlet:JAVADOC:703; Servlet:JAVADOC:706;
   * Servlet:JAVADOC:707; Servlet:JAVADOC:708; Servlet:JAVADOC:710;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(); call
   * ac.dispatch(ServletContext, URI); call ServletRequest.isAsyncSupported()
   * call ServletRequest.isAsyncStarted() call
   * ServletRequest.getDispatcherType() check System times: before calling
   * dispatch; dispatch returns dispatch operation starts. StartAsync in
   * dispatched thread, and check all above; StartAsync again in the
   * asynchrounous thread verifies all work accordingly.
   */
  public void startAsyncAgainTest16() throws Fault {
    TEST_PROPS.setProperty(APITEST, "startAsyncAgainTest16");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_startAsyncAgainTest16|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "After dispatch|"
            + "ASYNC_STARTED_dispatchTest15|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC|"
            + "startAsync called|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=true|" + "DispatcherType=ASYNC|"
            + "startAsync called again|"
            + "Expected IllegalStateException thrown");
    invoke();
  }

  /*
   * @testName: startAsyncAgainTest17
   * 
   * @assertion_ids: Servlet:JAVADOC:219; Servlet:JAVADOC:641;
   * Servlet:JAVADOC:641.3; Servlet:JAVADOC:703; Servlet:JAVADOC:706;
   * Servlet:JAVADOC:707; Servlet:JAVADOC:708; Servlet:JAVADOC:712;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(request, response); call
   * ac.dispatch(ServletContext, URI); call ServletRequest.isAsyncSupported()
   * call ServletRequest.isAsyncStarted() call
   * ServletRequest.getDispatcherType() check System times: before calling
   * dispatch; dispatch returns dispatch operation starts. StartAsync in
   * dispatched thread, and check all above; StartAsync again in the
   * asynchrounous thread verifies all work accordingly.
   */
  public void startAsyncAgainTest17() throws Fault {
    TEST_PROPS.setProperty(APITEST, "startAsyncAgainTest17");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_startAsyncAgainTest17|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "After dispatch|"
            + "ASYNC_STARTED_dispatchTest16|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC|"
            + "startAsync called|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=true|" + "DispatcherType=ASYNC|"
            + "startAsync called again|"
            + "Expected IllegalStateException thrown");
    invoke();
  }

  /*
   * @testName: negativeDispatchTest
   * 
   * @assertion_ids: Servlet:JAVADOC:639; Servlet:JAVADOC:639.2;
   * Servlet:JAVADOC:639.3; Servlet:JAVADOC:639.4; Servlet:JAVADOC:639.5;
   * Servlet:JAVADOC:639.11; Servlet:JAVADOC:703; Servlet:JAVADOC:707;
   * Servlet:JAVADOC:708; Servlet:JAVADOC:710;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(); call
   * ServletRequest.isAsyncSupported() call ServletRequest.isAsyncStarted() call
   * ServletRequest.getDispatcherType() call ac.dispatch(); check System times:
   * before calling dispatch; dispatch returns dispatch operation starts. call
   * ac.dispatch() again verifies all work accordingly.
   */
  public void negativeDispatchTest() throws Fault {
    TEST_PROPS.setProperty(APITEST, "negativeDispatchTest");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_negativeDispatchTest|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "dispatch again|"
            + "dispatch() called again|"
            + "Expected IllegalStateException thrown|" + "After dispatch|"
            + "ASYNC_STARTED_negativeDispatchTest|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC");
    invoke();
  }

  /*
   * @testName: negativeDispatchTest1
   * 
   * @assertion_ids: Servlet:JAVADOC:639; Servlet:JAVADOC:639.2;
   * Servlet:JAVADOC:639.3; Servlet:JAVADOC:639.4; Servlet:JAVADOC:639.5;
   * Servlet:JAVADOC:639.11; Servlet:JAVADOC:703; Servlet:JAVADOC:707;
   * Servlet:JAVADOC:708; Servlet:JAVADOC:712;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(request, response); call
   * ServletRequest.isAsyncSupported() call ServletRequest.isAsyncStarted() call
   * ServletRequest.getDispatcherType() call ac.dispatch(); check System times:
   * before calling dispatch; dispatch returns dispatch operation starts. call
   * ac.dispatch() again verifies all work accordingly.
   */
  public void negativeDispatchTest1() throws Fault {
    TEST_PROPS.setProperty(APITEST, "negativeDispatchTest1");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_negativeDispatchTest1|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "dispatch again|"
            + "dispatch() called again|"
            + "Expected IllegalStateException thrown|" + "After dispatch|"
            + "ASYNC_STARTED_negativeDispatchTest1|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC");
    invoke();
  }

  /*
   * @testName: negativeDispatchTest4
   * 
   * @assertion_ids: Servlet:JAVADOC:640; Servlet:JAVADOC:640.3;
   * Servlet:JAVADOC:640.8; Servlet:JAVADOC:703; Servlet:JAVADOC:707;
   * Servlet:JAVADOC:708; Servlet:JAVADOC:710;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(request, response); call
   * ServletRequest.isAsyncSupported() call ServletRequest.isAsyncStarted() call
   * ServletRequest.getDispatcherType() call ac.dispatch(URI); check System
   * times: before calling dispatch; dispatch returns dispatch operation starts.
   * call ac.dispatch(URI) again verifies all work accordingly.
   */
  public void negativeDispatchTest4() throws Fault {
    TEST_PROPS.setProperty(APITEST, "negativeDispatchTest4");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_negativeDispatchTest4|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "dispatch again|"
            + "dispatch(URI) called again|"
            + "Expected IllegalStateException thrown|" + "After dispatch|"
            + "ASYNC_STARTED_dispatchTest|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC");
    invoke();
  }

  /*
   * @testName: negativeDispatchTest5
   * 
   * @assertion_ids: Servlet:JAVADOC:640; Servlet:JAVADOC:640.3;
   * Servlet:JAVADOC:640.8; Servlet:JAVADOC:703; Servlet:JAVADOC:707;
   * Servlet:JAVADOC:708; Servlet:JAVADOC:712;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(request, response); call
   * ServletRequest.isAsyncSupported() call ServletRequest.isAsyncStarted() call
   * ServletRequest.getDispatcherType() call ac.dispatch(URI); check System
   * times: before calling dispatch; dispatch returns dispatch operation starts.
   * call ac.dispatch(URI) again verifies all work accordingly.
   */
  public void negativeDispatchTest5() throws Fault {
    TEST_PROPS.setProperty(APITEST, "negativeDispatchTest5");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_negativeDispatchTest5|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "dispatch again|"
            + "dispatch(URI) called again|"
            + "Expected IllegalStateException thrown|" + "After dispatch|"
            + "ASYNC_STARTED_dispatchTest|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC");
    invoke();
  }

  /*
   * @testName: negativeDispatchTest8
   * 
   * @assertion_ids: SServlet:JAVADOC:219; Servlet:JAVADOC:641;
   * Servlet:JAVADOC:641.1; Servlet:JAVADOC:641.2; Servlet:JAVADOC:641.3;
   * Servlet:JAVADOC:703; Servlet:JAVADOC:706; Servlet:JAVADOC:707;
   * Servlet:JAVADOC:708; Servlet:JAVADOC:710;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(); call
   * ServletRequest.isAsyncSupported() call ServletRequest.isAsyncStarted() call
   * ServletRequest.getDispatcherType() call ac.dispatch(ServletContext, URI);
   * check System times: before calling dispatch; dispatch returns dispatch
   * operation starts. call ac.dispatch(ServletContext, URI) again verifies all
   * work accordingly.
   */
  public void negativeDispatchTest8() throws Fault {
    TEST_PROPS.setProperty(APITEST, "negativeDispatchTest8");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_negativeDispatchTest8|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "dispatch again|"
            + "dispatch() called again|"
            + "Expected IllegalStateException thrown|" + "After dispatch|"
            + "ASYNC_STARTED_dispatchTest10|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC");
    invoke();
  }

  /*
   * @testName: negativeDispatchTest9
   * 
   * @assertion_ids: SServlet:JAVADOC:219; Servlet:JAVADOC:641;
   * Servlet:JAVADOC:641.1; Servlet:JAVADOC:641.2; Servlet:JAVADOC:641.3;
   * Servlet:JAVADOC:703; Servlet:JAVADOC:706; Servlet:JAVADOC:707;
   * Servlet:JAVADOC:708; Servlet:JAVADOC:712;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(request, response); call
   * ServletRequest.isAsyncSupported() call ServletRequest.isAsyncStarted() call
   * ServletRequest.getDispatcherType() call ac.dispatch(ServletContext, URI);
   * check System times: before calling dispatch; dispatch returns dispatch
   * operation starts. call ac.dispatch(ServletContext, URI) again verifies all
   * work accordingly.
   */
  public void negativeDispatchTest9() throws Fault {
    TEST_PROPS.setProperty(APITEST, "negativeDispatchTest9");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_negativeDispatchTest9|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "dispatch again|"
            + "dispatch() called again|"
            + "Expected IllegalStateException thrown|" + "After dispatch|"
            + "ASYNC_STARTED_dispatchTest10|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC");
    invoke();
  }

  /*
   * @testName: negativeDispatchTest12
   * 
   * @assertion_ids: SServlet:JAVADOC:219; Servlet:JAVADOC:641;
   * Servlet:JAVADOC:641.1; Servlet:JAVADOC:641.2; Servlet:JAVADOC:641.3;
   * Servlet:JAVADOC:703; Servlet:JAVADOC:706; Servlet:JAVADOC:707;
   * Servlet:JAVADOC:708; Servlet:JAVADOC:710;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(); call
   * ServletRequest.isAsyncSupported() call ServletRequest.isAsyncStarted() call
   * ServletRequest.getDispatcherType() call ac.dispatch(ServletContext,URI);
   * check System times: before calling dispatch; dispatch returns dispatch
   * operation starts. call ac.dispatch(URI) again verifies all work
   * accordingly.
   */
  public void negativeDispatchTest12() throws Fault {
    TEST_PROPS.setProperty(APITEST, "negativeDispatchTest12");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_negativeDispatchTest12|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "dispatch again|"
            + "dispatch(URI) called again|"
            + "Expected IllegalStateException thrown|" + "After dispatch|"
            + "ASYNC_STARTED_dispatchTest10|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC");
    invoke();
  }

  /*
   * @testName: negativeDispatchTest13
   * 
   * @assertion_ids: SServlet:JAVADOC:219; Servlet:JAVADOC:641;
   * Servlet:JAVADOC:641.1; Servlet:JAVADOC:641.2; Servlet:JAVADOC:641.3;
   * Servlet:JAVADOC:703; Servlet:JAVADOC:706; Servlet:JAVADOC:707;
   * Servlet:JAVADOC:708; Servlet:JAVADOC:712;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; StartAsync in
   * DispatchTestServlet ServletRequest.startAsync(request, response); call
   * ServletRequest.isAsyncSupported() call ServletRequest.isAsyncStarted() call
   * ServletRequest.getDispatcherType() call ac.dispatch(ServletContext,URI);
   * check System times: before calling dispatch; dispatch returns dispatch
   * operation starts. call ac.dispatch(URI) again verifies all work
   * accordingly.
   */
  public void negativeDispatchTest13() throws Fault {
    TEST_PROPS.setProperty(APITEST, "negativeDispatchTest13");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_negativeDispatchTest13|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "Before dispatch|" + "dispatch return|" + "dispatch again|"
            + "dispatch(URI) called again|"
            + "Expected IllegalStateException thrown|" + "After dispatch|"
            + "ASYNC_STARTED_dispatchTest10|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=ASYNC");
    invoke();
  }

  /*
   * @testName: dispatchAfterCommitTest
   * 
   * @assertion_ids: Servlet:JAVADOC:639.12; Servlet:JAVADOC:707;
   * Servlet:JAVADOC:708; Servlet:JAVADOC:710; Servlet:JAVADOC:866;
   * Servlet:JAVADOC:872;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; DispatchTestServlet commits
   * the response; StartAsync in DispatchTestServlet
   * ServletRequest.startAsync(); call ac.dispatch(); verifies all works
   */
  public void dispatchAfterCommitTest() throws Fault {
    TEST_PROPS.setProperty(APITEST, "dispatchAfterCommitTest");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_dispatchAfterCommitTest|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "After commmit|" + "Before dispatch|" + "dispatch return|"
            + "After dispatch|" + "ASYNC_STARTED_dispatchAfterCommitTest|"
            + "IsAsyncSupported=true|" + "IsAsyncStarted=false|"
            + "DispatcherType=ASYNC");
    invoke();
  }

  /*
   * @testName: dispatchAfterCommitTest1
   * 
   * @assertion_ids: Servlet:JAVADOC:639.12; Servlet:JAVADOC:707;
   * Servlet:JAVADOC:708; Servlet:JAVADOC:712; Servlet:JAVADOC:866;
   * Servlet:JAVADOC:872;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; DispatchTestServlet commits
   * the response; StartAsync in DispatchTestServlet
   * ServletRequest.startAsync(request, response); call ac.dispatch(); verifies
   * all works
   */
  public void dispatchAfterCommitTest1() throws Fault {
    TEST_PROPS.setProperty(APITEST, "dispatchAfterCommitTest1");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_dispatchAfterCommitTest1|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "After commmit|" + "Before dispatch|" + "dispatch return|"
            + "After dispatch|" + "ASYNC_STARTED_dispatchAfterCommitTest1|"
            + "IsAsyncSupported=true|" + "IsAsyncStarted=false|"
            + "DispatcherType=ASYNC");
    invoke();
  }

  /*
   * @testName: dispatchAfterCommitTest2
   * 
   * @assertion_ids: Servlet:JAVADOC:707; Servlet:JAVADOC:708;
   * Servlet:JAVADOC:710; Servlet:JAVADOC:866; Servlet:JAVADOC:872;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; DispatchTestServlet commits
   * the response; StartAsync in DispatchTestServlet
   * ServletRequest.startAsync(); call ac.dispatch(URI); verifies all works
   */
  public void dispatchAfterCommitTest2() throws Fault {
    TEST_PROPS.setProperty(APITEST, "dispatchAfterCommitTest2");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_dispatchAfterCommitTest2|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "After commmit|" + "Before dispatch|" + "dispatch return|"
            + "After dispatch|" + "ASYNC_STARTED_dispatchTest|"
            + "IsAsyncSupported=true|" + "IsAsyncStarted=false|"
            + "DispatcherType=ASYNC");
    invoke();
  }

  /*
   * @testName: dispatchAfterCommitTest3
   * 
   * @assertion_ids: Servlet:JAVADOC:707; Servlet:JAVADOC:708;
   * Servlet:JAVADOC:712; Servlet:JAVADOC:866; Servlet:JAVADOC:872;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; DispatchTestServlet commits
   * the response; StartAsync in DispatchTestServlet
   * ServletRequest.startAsync(request, response); call ac.dispatch(URI);
   * verifies all works
   */
  public void dispatchAfterCommitTest3() throws Fault {
    TEST_PROPS.setProperty(APITEST, "dispatchAfterCommitTest3");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_dispatchAfterCommitTest3|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "After commmit|" + "Before dispatch|" + "dispatch return|"
            + "After dispatch|" + "ASYNC_STARTED_dispatchTest|"
            + "IsAsyncSupported=true|" + "IsAsyncStarted=false|"
            + "DispatcherType=ASYNC");
    invoke();
  }

  /*
   * @testName: dispatchAfterCommitTest4
   * 
   * @assertion_ids: Servlet:JAVADOC:707; Servlet:JAVADOC:708;
   * Servlet:JAVADOC:710; Servlet:JAVADOC:866; Servlet:JAVADOC:872;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; DispatchTestServlet commits
   * the response; StartAsync in DispatchTestServlet
   * ServletRequest.startAsync(); call ac.dispatch(ServletContext,URI); verifies
   * all works
   */
  public void dispatchAfterCommitTest4() throws Fault {
    TEST_PROPS.setProperty(APITEST, "dispatchAfterCommitTest4");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_dispatchAfterCommitTest4|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "After commmit|" + "Before dispatch|" + "dispatch return|"
            + "After dispatch|" + "ASYNC_STARTED_dispatchTest10|"
            + "IsAsyncSupported=true|" + "IsAsyncStarted=false|"
            + "DispatcherType=ASYNC");
    invoke();
  }

  /*
   * @testName: dispatchAfterCommitTest5
   * 
   * @assertion_ids: Servlet:JAVADOC:707; Servlet:JAVADOC:708;
   * Servlet:JAVADOC:712; Servlet:JAVADOC:866; Servlet:JAVADOC:872;
   *
   * @test_Strategy: Create a Servlet DispatchTestServlet which supports async;
   * Client send a request to DispatchTestServlet; DispatchTestServlet commits
   * the response; StartAsync in DispatchTestServlet
   * ServletRequest.startAsync(request, response); call
   * ac.dispatch(ServletContext,URI); verifies all works
   */
  public void dispatchAfterCommitTest5() throws Fault {
    TEST_PROPS.setProperty(APITEST, "dispatchAfterCommitTest5");
    TEST_PROPS.setProperty(SEARCH_STRING,
        "ASYNC_NOT_STARTED_dispatchAfterCommitTest5|" + "IsAsyncSupported=true|"
            + "IsAsyncStarted=false|" + "DispatcherType=REQUEST|"
            + "After commmit|" + "Before dispatch|" + "dispatch return|"
            + "After dispatch|" + "ASYNC_STARTED_dispatchTest10|"
            + "IsAsyncSupported=true|" + "IsAsyncStarted=false|"
            + "DispatcherType=ASYNC");
    invoke();
  }
}
