Examples of ServletConfiguration


Examples of com.hmsonline.dropwizard.spring.web.ServletConfiguration

     */
    @SuppressWarnings("unchecked")
    private void loadServlets(Map<String, ServletConfiguration> servlets, Environment environment) throws ClassNotFoundException {
        if (servlets != null) {
            for (Map.Entry<String, ServletConfiguration> servletEntry : servlets.entrySet()) {
                ServletConfiguration servlet = servletEntry.getValue();

                // Create servlet holder
                ServletHolder servletHolder = new ServletHolder((Class<? extends Servlet>) Class.forName(servlet.getClazz()));

                // Set name of servlet
                servletHolder.setName(servletEntry.getKey());

                // Set params
                if (servlet.getParam() != null) {
                    for (Map.Entry<String, String> entry : servlet.getParam().entrySet()) {
                        servletHolder.setInitParameter(entry.getKey(), entry.getValue());
                    }
                }

                // Add servlet
                environment.getApplicationContext().addServlet(servletHolder, servlet.getUrl());
            }
        }
    }
View Full Code Here

Examples of org.apache.cactus.configuration.ServletConfiguration

     * @see AbstractTestCase#runTest()
     */
    protected void runTest() throws Throwable
    {
        WebClientTestCaseDelegate delegator = new WebClientTestCaseDelegate(
            this, this, new ServletConfiguration());       

        try
        {
            // Call the begin method
            WebRequest request = new WebRequest(
View Full Code Here

Examples of org.apache.cactus.configuration.ServletConfiguration

     * Verify that an exception is thrown when an invalid HTTP METHOD is used
     * when adding an HTTP parameter.
     */
    public void testAddParameterInvalidMethod()
    {
        WebRequest request = new WebRequest(new ServletConfiguration());

        try
        {
            request.addParameter("param1", "value1", "INVALIDMETHOD");
            fail("Should have thrown an exception");
View Full Code Here

Examples of org.apache.cactus.configuration.ServletConfiguration

     * Verify that <code>getParameterGet</code> returns the first parameter
     * that was added to the request.
     */
    public void testGetParametersGetOk()
    {
        WebRequest request = new WebRequest(new ServletConfiguration());

        request.addParameter("param1", "value1", WebRequest.GET_METHOD);
        request.addParameter("param1", "value2", WebRequest.GET_METHOD);

        String result = request.getParameterGet("param1");
View Full Code Here

Examples of org.apache.cactus.configuration.ServletConfiguration

     * Verify that <code>getParameterGet</code> returns null if no parameter
     * of a given name was added to the request.
     */
    public void testGetParameterGetNull()
    {
        WebRequest request = new WebRequest(new ServletConfiguration());

        request.addParameter("param1", "value1", WebRequest.POST_METHOD);

        String result = request.getParameterGet("param1");

View Full Code Here

Examples of org.apache.cactus.configuration.ServletConfiguration

     * Verify that <code>getParameterPost</code> returns the first parameter
     * that was added to the request.
     */
    public void testGetParametersPostOk()
    {
        WebRequest request = new WebRequest(new ServletConfiguration());

        request.addParameter("param1", "value1", WebRequest.POST_METHOD);
        request.addParameter("param1", "value2", WebRequest.POST_METHOD);

        String result = request.getParameterPost("param1");
View Full Code Here

Examples of org.apache.cactus.configuration.ServletConfiguration

     * Verify that <code>getParameterPost</code> returns null if no parameter
     * of a given name was added to the request.
     */
    public void testGetParameterPostNull()
    {
        WebRequest request = new WebRequest(new ServletConfiguration());

        request.addParameter("param1", "value1", WebRequest.GET_METHOD);

        String result = request.getParameterPost("param1");

View Full Code Here

Examples of org.apache.cactus.configuration.ServletConfiguration

     * Verify that <code>getHeader</code> returns the first header
     * that was added to the request.
     */
    public void testGetHeaderOk()
    {
        WebRequest request = new WebRequest(new ServletConfiguration());

        request.addHeader("header1", "value1");
        request.addHeader("header2", "value2");

        String result = request.getHeader("header1");
View Full Code Here

Examples of org.apache.cactus.configuration.ServletConfiguration

     * Verify that <code>getHeader</code> returns null if no header
     * of a given name was added to the request.
     */
    public void testGetHeaderNull()
    {
        WebRequest request = new WebRequest(new ServletConfiguration());

        String result = request.getHeader("header1");

        assertNull(result);
    }
View Full Code Here

Examples of org.apache.cactus.configuration.ServletConfiguration

     * Verify that <Code>toString()</code> returns a nice string representation
     * of the <code>WebRequest</code>.
     */
    public void testToString()
    {
        WebRequest request = new WebRequest(new ServletConfiguration());

        request.addHeader("header1", "value1");
        request.addHeader("header1", "value2");
        request.addParameter("param1", "value1", WebRequest.GET_METHOD);
        request.addParameter("param1", "value1", WebRequest.POST_METHOD);
View Full Code Here
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.