Package org.sentinel.framework

Source Code of org.sentinel.framework.ApplicationTest

package org.sentinel.framework;

import java.net.MalformedURLException;
import static org.junit.Assert.*;
import org.junit.Test;
import org.sentinel.servers.http.protocol.HTTPRequest;

public class ApplicationTest
{

    public class ApplicationImpl extends Application
    {
    }

    @Test
    public void testGetParam() throws MalformedURLException
    {
        ApplicationImpl impl = new ApplicationImpl();
        impl.request = new HTTPRequest();
        assertNull(impl.getParam("test", null));
       
        URL url = new URL("http://localhost/something?test=1&test2=abc");
        impl.request.setRequestURL(url);
        assertEquals("1", impl.getParam("test"));
        assertEquals("abc", impl.getParam("test2"));
    }

}
TOP

Related Classes of org.sentinel.framework.ApplicationTest

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.