Package KFM.ServletFramework.test

Source Code of KFM.ServletFramework.test.KFM_PropertyServlet2Test

/*
*  This software and supporting documentation were developed by
*
*    Siemens Corporate Technology
*    Competence Center Knowledge Management and Business Transformation
*    D-81730 Munich, Germany
*
*    Authors (representing a really great team ;-) )
*            Stefan B. Augustin, Thorbj�rn Hansen, Manfred Langen
*
*  This software is Open Source under GNU General Public License (GPL).
*  Read the text of this license in LICENSE.TXT
*  or look at www.opensource.org/licenses/
*
*  Once more we emphasize, that:
*  THIS SOFTWARE IS MADE AVAILABLE,  AS IS,  WITHOUT ANY WARRANTY
*  REGARDING  THE  SOFTWARE,  ITS  PERFORMANCE OR
*  FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES OR
*  ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND
*  PERFORMANCE OF THE SOFTWARE IS WITH THE USER.
*
*/


package KFM.ServletFramework.test;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import com.mockobjects.servlet.*;

import junit.framework.*;
import KFM.ServletFramework.KFM_PropertyServlet2;

public class KFM_PropertyServlet2Test extends TestCase
{
    public KFM_PropertyServlet2Test(String s)
    {
        super(s);
    }

    public void testProcessRequestCatchesErrors()
        throws IOException, ServletException
    {
        KFM_PropertyServlet2 tServlet = new KFM_PropertyServlet2() {
            public void doInit(ServletConfig aServletConfig)
                    throws ServletException
            {
            }

            public void processRequest2(HttpServletRequest aReq, HttpServletResponse aRes)
                    throws ServletException, IOException
            {
                throw new Error();
            }
        };

        try {
            tServlet.processRequest(new MockHttpServletRequest(), new MockHttpServletResponse());
        } catch(Error e) {
            fail("Expected processRequest to catch the Error.");
        }
    }
}
TOP

Related Classes of KFM.ServletFramework.test.KFM_PropertyServlet2Test

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.