Initial Contribution

Signed-off-by: Vinay Vishal <vinay.vishal@oracle.com>
diff --git a/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/WebTest.java b/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/WebTest.java
new file mode 100644
index 0000000..a904d00
--- /dev/null
+++ b/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/WebTest.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 1997, 2018 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
+ */
+
+import java.lang.*;
+import java.io.*;
+import java.net.*;
+
+import com.sun.ejte.ccl.reporter.*;
+
+public class WebTest
+{
+    
+    private static int count = 0;
+    private static int EXPECTED_COUNT = 3;
+    
+    static SimpleReporterAdapter stat=
+        new SimpleReporterAdapter("appserv-tests");
+
+    public static void main(String args[])
+    {
+
+        // The stat reporter writes out the test info and results
+        // into the top-level quicklook directory during a run.
+      
+        stat.addDescription("http-listener reader-threads unit tests.");
+
+        String host = args[0];
+        String portS = args[1];
+        String contextRoot = args[2];
+
+        int port = new Integer(portS).intValue();
+        String name;
+        
+        try {
+            goGet(host, port, "FILTER", contextRoot + "/ServletTest" );
+        } catch (Throwable t) {
+            System.out.println(t.getMessage());
+        }
+
+        if (count != EXPECTED_COUNT){
+            stat.addStatus("web-readerThreadsConfig", stat.FAIL);
+        }           
+        stat.printSummary("web/standalonewar---> expect " + EXPECTED_COUNT);
+    }
+
+    private static void goGet(String host, int port,
+                              String result, String contextPath)
+         throws Exception
+    {
+        long time = System.currentTimeMillis();
+        Socket s = new Socket(host, port);
+        s.setSoTimeout(5000);
+        OutputStream os = s.getOutputStream();
+
+        System.out.println(("GET " + contextPath + " HTTP/1.1\n"));
+        os.write(("GET " + contextPath + " HTTP/1.1\n").getBytes());
+        os.write(("Host: localhost\n").getBytes());
+        os.write("\n".getBytes());
+        
+        InputStream is = s.getInputStream();
+        System.out.println("Time: " + (System.currentTimeMillis() - time));
+        BufferedReader bis = new BufferedReader(new InputStreamReader(is));
+        String line = null;
+
+        try{
+            int index;
+            while ((line = bis.readLine()) != null) {
+                index = line.indexOf(result);
+                System.out.println(line);
+                if (index != -1) {
+                    index = line.indexOf(":");
+                    String status = line.substring(index+1);
+                    
+                    if (status.equalsIgnoreCase("PASS")){
+                        stat.addStatus("web-readerThreadsConfig: " + line.substring(0,index), stat.PASS);
+                    } else {
+                        stat.addStatus("web-readerThreadsConfig: " + line.substring(0,index), stat.FAIL);                       
+                    }
+                    count++;
+                } 
+            }
+        } catch( Exception ex){
+        }
+   }
+  
+}
diff --git a/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/build.properties b/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/build.properties
new file mode 100644
index 0000000..3f8b786
--- /dev/null
+++ b/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/build.properties
@@ -0,0 +1,28 @@
+<!--
+
+    Copyright (c) 2018 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
+
+-->
+ 
+
+<property name="module" value="web"/>
+<property name="appname" value="${module}-readerThreadsConfig"/>         
+<property name="assemble" value="${build.classes.dir}/archive"/>
+<property name="application.xml" value="descriptor/application.xml"/>
+<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
+<property name="apptype" value="web"/>         
+<property name="web.xml" value="descriptor/web.xml"/>
+<property name="sun-web.xml" value="descriptor/sun-web.xml"/>
+<property name="contextroot" value="/web-readerThreadsConfig"/>
diff --git a/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/build.xml b/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/build.xml
new file mode 100644
index 0000000..0a99726
--- /dev/null
+++ b/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/build.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+    Copyright (c) 1997, 2018 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
+
+-->
+
+<!DOCTYPE project [
+<!ENTITY commonSetup SYSTEM "./../../../config/properties.xml">
+<!ENTITY commonBuild SYSTEM "./../../../config/common.xml">
+<!ENTITY run SYSTEM "./../../../config/run.xml">
+<!ENTITY testproperties SYSTEM "./build.properties">
+]>
+
+<project name="webcontainer_unittest" default="all" basedir=".">
+
+    &commonSetup;
+    &commonBuild;
+    &testproperties;
+    &run;
+
+    <target name="all" depends="build,setup,deploy,run,unsetup,undeploy"/>
+
+    <target name="clean" depends="init-common">
+      <antcall target="clean-common"/>
+    </target>
+       
+    <target name="compile" depends="clean">
+        <antcall target="compile-common">
+            <param name="src" value="servlet"/>
+        </antcall>
+    </target>
+
+    <target name="setup" depends="init-common">
+        <antcall target="asadmin-common-ignore-fail">
+            <param name="admin.command" value="set" />
+            <param name="operand.props"
+                   value="configs.config.server-config.network-config.transports.transport.tcp.acceptor-threads=5"/>
+        </antcall>
+    </target>
+
+    <target name="unsetup" depends="init-common">
+        <antcall target="asadmin-common-ignore-fail">
+            <param name="admin.command" value="set" />
+            <param name="operand.props"
+                   value="configs.config.server-config.network-config.transports.transport.tcp.acceptor-threads="/>
+        </antcall>
+    </target>
+
+    <target name="build" depends="compile">
+        <property name="hasWebclient" value="yes"/> 
+        <antcall target="webclient-war-common">
+            <param name="hasWebclient" value="yes"/>
+            <param name="webclient.war.classes" value="**/*.class"/> 
+        </antcall>
+
+          <javac
+            srcdir="."
+            classpath="${env.APS_HOME}/lib/reportbuilder.jar"
+            includes="WebTest.java"/>
+
+    </target> 
+
+    <target name="build-publish-war" depends="build, publish-war-common" />
+    
+    <target name="re-deploy" depends="init-common">
+        <antcall target="deploy-war-common"/>
+    </target>
+
+    <target name="deploy" depends="init-common">
+        <antcall target="deploy-war-common"/>
+    </target>
+    
+    <target name="run" depends="init-common">
+        <java classname="WebTest">
+          <arg value="${http.host}"/>
+          <arg value="${http.port}"/>
+          <arg value="${contextroot}"/>
+          <classpath>
+           <pathelement location="${env.APS_HOME}/lib/reportbuilder.jar"/>
+           <pathelement location="."/>
+         </classpath>
+        </java>
+    </target>
+ 
+    <target name="undeploy" depends="init-common">
+        <antcall target="undeploy-war-common"/>
+    </target>   
+
+    <target name="usage">
+        <antcall target="usage-common"/>
+    </target>
+</project>
diff --git a/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/descriptor/application.xml b/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/descriptor/application.xml
new file mode 100644
index 0000000..d18892e
--- /dev/null
+++ b/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/descriptor/application.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright (c) 1997, 2018 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
+
+-->
+
+<!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN' 'http://java.sun.com/j2ee/dtds/application_1_2.dtd'>
+
+<application>
+  <icon>
+    <small-icon></small-icon>
+    <large-icon></large-icon>
+  </icon>
+  <display-name>simpleservlettest</display-name>
+  <module>
+    <web>
+      <web-uri>web-simple-servlet-web.war</web-uri>
+      <context-root>simpleservlettest</context-root>
+    </web>
+  </module>
+</application>
+
diff --git a/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/descriptor/sun-web.xml b/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/descriptor/sun-web.xml
new file mode 100644
index 0000000..fd6410d
--- /dev/null
+++ b/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/descriptor/sun-web.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright (c) 1997, 2018 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
+
+-->
+
+<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 7.0 Servlet 2.3//EN" "http://www.sun.com/software/sunone/appserver/dtds/sun-web-app_2_3-0.dtd">
+
+<sun-web-app>
+<description>tomcat-test</description>
+
+<security-role-mapping>
+   <role-name>tomcat</role-name>
+   <principal-name>tomcat</principal-name>
+   <group-name>tomcat</group-name>
+</security-role-mapping>
+
+</sun-web-app>
+
diff --git a/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/descriptor/web.xml b/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/descriptor/web.xml
new file mode 100644
index 0000000..f9861df
--- /dev/null
+++ b/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/descriptor/web.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright (c) 1997, 2018 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
+
+-->
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+         http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+         version="2.4">
+     
+    <filter>
+        <filter-name>FilterTest</filter-name>
+        <filter-class>test.FilterTest</filter-class>
+    </filter>    
+        
+    <filter-mapping>
+        <filter-name>FilterTest</filter-name>
+        <url-pattern>/*</url-pattern>
+        <dispatcher>REQUEST</dispatcher>
+        <dispatcher>INCLUDE</dispatcher>
+        <dispatcher>FORWARD</dispatcher>  
+        <dispatcher>ERROR</dispatcher> 
+    </filter-mapping>
+    
+    <servlet>
+        <display-name>ServletTest</display-name>
+        <servlet-name>ServletTest</servlet-name>
+        <servlet-class>test.ServletTest</servlet-class>
+    </servlet>  
+    <servlet>
+        <display-name>ServletTest2</display-name>
+        <servlet-name>ServletTest2</servlet-name>
+        <servlet-class>test.ServletTest2</servlet-class>
+    </servlet>  
+    <servlet>
+        <display-name>ServletTest3</display-name>
+        <servlet-name>ServletTest3</servlet-name>
+        <servlet-class>test.ServletTest3</servlet-class>
+    </servlet>  
+    
+   <servlet-mapping>
+        <servlet-name>ServletTest</servlet-name>
+        <url-pattern>/ServletTest</url-pattern>
+    </servlet-mapping>
+   <servlet-mapping>
+        <servlet-name>ServletTest2</servlet-name>
+        <url-pattern>/ServletTest2</url-pattern>
+    </servlet-mapping>
+   <servlet-mapping>
+        <servlet-name>ServletTest3</servlet-name>
+        <url-pattern>/ServletTest3</url-pattern>
+    </servlet-mapping>
+    
+    <session-config>
+        <session-timeout>10</session-timeout>
+    </session-config>
+
+</web-app>
+
diff --git a/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/servlet/FilterTest.java b/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/servlet/FilterTest.java
new file mode 100644
index 0000000..57a5e16
--- /dev/null
+++ b/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/servlet/FilterTest.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 1997, 2018 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
+ */
+
+package test;
+
+import javax.servlet.*;
+import javax.servlet.http.*;
+public class FilterTest implements Filter{
+    
+    private ServletContext context;
+    
+    public void destroy() {
+        System.out.println("[Filter.destroy]");
+    }    
+    
+    public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws java.io.IOException, javax.servlet.ServletException {
+        System.out.println("[Filter.doFilter]");
+          
+        ((HttpServletRequest)request).getSession().setAttribute("FILTER", "PASS");
+        filterChain.doFilter(request, response);
+        
+    }    
+    
+    
+    public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException {
+        System.out.println("[Filter.init]");
+        context = filterConfig.getServletContext();
+    }
+    
+}
diff --git a/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/servlet/ServletTest.java b/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/servlet/ServletTest.java
new file mode 100644
index 0000000..9fe46d3
--- /dev/null
+++ b/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/servlet/ServletTest.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 1997, 2018 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
+ */
+
+package test;
+
+import java.io.*;
+import java.net.*;
+import java.util.*;
+import javax.servlet.*;
+import javax.servlet.http.*;
+import org.xml.sax.InputSource;
+import org.w3c.dom.Element;
+import org.w3c.dom.Document;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Node;
+
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.SAXException;
+
+// jaxp 1.0.1 imports
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.DocumentBuilder;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import javax.naming.*;
+import javax.sql.*;
+import java.sql.*;
+
+public class ServletTest extends HttpServlet implements HttpSessionListener {
+
+    private ServletContext context;
+    
+    public void init(ServletConfig config) throws ServletException {
+        super.init(config);
+        System.out.println("[Servlet.init]");        
+        context = config.getServletContext();
+        System.out.println("[Servlet.init] " + context.getMajorVersion());
+        
+    }
+
+    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        System.out.println("[Servlet.doGet]");
+        doPost(request, response);
+    }
+
+    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {        
+        System.out.println("[Servlet.doPost]");
+        
+        response.setContentType("text/html");
+        PrintWriter out = response.getWriter();
+        
+        request.getSession().setAttribute("FILTER-REQUEST", request.getSession().getAttribute("FILTER"));
+        request.getSession().setAttribute("FILTER", "FAIL");        
+        	
+        RequestDispatcher rd = context.getRequestDispatcher("/ServletTest2");
+        rd.forward(request, response);       
+    }
+
+    public void sessionCreated(javax.servlet.http.HttpSessionEvent httpSessionEvent) {
+        System.out.println("[Servlet.sessionCreated]");
+    }
+    
+    public void sessionDestroyed(javax.servlet.http.HttpSessionEvent httpSessionEvent) {
+        System.out.println("[Servlet.sessionDestroyed]");
+        System.out.println("Attributes: " + httpSessionEvent.getSession().getAttribute("test"));
+    }
+}
+
+
+
diff --git a/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/servlet/ServletTest2.java b/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/servlet/ServletTest2.java
new file mode 100644
index 0000000..f517cce
--- /dev/null
+++ b/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/servlet/ServletTest2.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 1997, 2018 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
+ */
+
+package test;
+
+import java.io.*;
+import java.net.*;
+import java.util.*;
+import javax.servlet.*;
+import javax.servlet.http.*;
+
+public class ServletTest2 extends HttpServlet implements HttpSessionListener {
+
+    private ServletContext context;
+    
+    public void init(ServletConfig config) throws ServletException {
+        super.init(config);
+        System.out.println("[Servlet2.init]");        
+        context = config.getServletContext();
+    }
+
+    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        System.out.println("[Servlet2.doGet]");
+        doPost(request, response);
+    }
+
+    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {        
+        System.out.println("[Servlet2.doPost]");
+      
+        response.setContentType("text/html");
+        PrintWriter out = response.getWriter();
+        
+        request.getSession().setAttribute("FILTER-FORWARD",request.getSession().getAttribute("FILTER"));
+        request.getSession().setAttribute("FILTER", "FAIL");        
+        
+        RequestDispatcher rd = request.getRequestDispatcher("/ServletTest3");
+        rd.include(request, response);     
+    }
+ 
+    public void sessionCreated(javax.servlet.http.HttpSessionEvent httpSessionEvent) {
+        System.out.println("[Servlet.sessionCreated]");
+    }
+    
+    public void sessionDestroyed(javax.servlet.http.HttpSessionEvent httpSessionEvent) {
+        System.out.println("[Servlet.sessionDestroyed]");
+        System.out.println("Attributes: " + httpSessionEvent.getSession().getAttribute("test"));
+    }
+
+}
+
+
diff --git a/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/servlet/ServletTest3.java b/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/servlet/ServletTest3.java
new file mode 100644
index 0000000..4b9b240
--- /dev/null
+++ b/appserver/tests/appserv-tests/devtests/web/readerThreadsConfig/servlet/ServletTest3.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 1997, 2018 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
+ */
+
+package test;
+
+import java.io.*;
+import java.net.*;
+import java.util.*;
+import javax.servlet.*;
+import javax.servlet.http.*;
+import org.xml.sax.InputSource;
+import org.w3c.dom.Element;
+import org.w3c.dom.Document;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Node;
+
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.SAXException;
+
+// jaxp 1.0.1 imports
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.DocumentBuilder;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import javax.naming.*;
+import javax.sql.*;
+import java.sql.*;
+
+public class ServletTest3 extends HttpServlet{
+
+    private ServletContext context;
+    
+    public void init(ServletConfig config) throws ServletException {
+        super.init(config);
+        System.out.println("[Servlet3.init]");        
+        context = config.getServletContext();     
+    }
+
+    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        System.out.println("[Servlet3.doGet]");
+        doPost(request, response);
+    }
+
+    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {        
+        System.out.println("[Servlet3.doPost]");
+        
+        response.setContentType("text/html");
+        PrintWriter out = response.getWriter();
+        
+        out.println("FILTER-REQUEST:" + request.getSession().getAttribute("FILTER-REQUEST"));
+        out.println("FILTER-FORWARD:" + request.getSession().getAttribute("FILTER-FORWARD"));
+        out.println("FILTER-INCLUDE:" + request.getSession().getAttribute("FILTER"));
+    }
+
+}
+
+
+