/*
 * JBoss, Home of Professional Open Source.
 * Copyright 2011, Red Hat, Inc., and individual contributors
 * as indicated by the @author tags. See the copyright.txt file in the
 * distribution for a full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package org.jboss.as.test.integration.security.loginmodules.common.servlets;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.Writer;

/**
 * @author Jan Lanik
 *         <p/>
 *         Servlet class to be used in DatabaseLoginModule test cases
 */
public abstract class AbstractLoginModuleTestServlet extends HttpServlet {

   private static final long serialVersionUID = 1L;

   @Override
   protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
      Writer writer = resp.getWriter();
      writer.write("GOOD");
   }
}

@@ -1094,16 +1094,73 @@
 vlets;%0A%0A
+import java.io.IOException;%0Aimport java.io.PrintWriter;%0A%0A
 import j
@@ -1326,170 +1326,216 @@
 se;%0A
-import java.io.IOException;%0Aimport java.io.Writer;%0A%0A/**%0A * @author Jan Lanik%0A *         %3Cp/%3E%0A *         Servlet class to be used in DatabaseLoginModule test cases
+%0A/**%0A * Abstract simple servlet class which implements %7B@link #doGet(HttpServletRequest, HttpServletResponse)%7D method and writes a%0A * plain-text response (%7B@link #RESPONSE_BODY%7D).%0A * %0A * @author Jan Lanik%0A * 
 %0A */
@@ -1614,16 +1614,17 @@
 t %7B%0A%0A   
+ 
 private 
@@ -1665,16 +1665,415 @@
  = 1L;%0A%0A
+    /** The String returned in the HTTP response body. */%0A    public static final String RESPONSE_BODY = %22GOOD%22;%0A%0A    /**%0A     * Writes simple text response.%0A     * %0A     * @param req%0A     * @param resp%0A     * @throws ServletException%0A     * @throws IOException%0A     * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)%0A     */%0A 
    @Over
@@ -2077,16 +2077,17 @@
 verride%0A
+ 
    prote
@@ -2197,16 +2197,72 @@
 %7B%0A      
+  
+resp.setContentType(%22text/plain%22);%0A        final Print
 Writer w
@@ -2293,16 +2293,18 @@
 ;%0A      
+  
 writer.w
@@ -2312,17 +2312,49 @@
 ite(
-%22GOOD%22
+RESPONSE_BODY);%0A        writer.close(
 );%0A
+ 
    %7D

Improve reusability of the AbstractLoginModuleTestServlet.java