Examples of registerServlet()


Examples of org.osgi.service.http.HttpService.registerServlet()

     */
    public void testSimpleCookie() throws ServletException, NamespaceException, IOException
    {
        HttpService httpService = getHTTPService( registry.getBundleContext() );
        CookieServlet servlet = new CookieServlet( MODE_SIMPLE );
        httpService.registerServlet( "/test", servlet, null, null );

        //Test that no cookies are currently set.
        HttpURLConnection client = getConnection( DEFAULT_BASE_URL + "/test", "GET" );

        //Set the cookie in the response
View Full Code Here

Examples of org.osgi.service.http.HttpService.registerServlet()

     */
    public void testMultipleCookies() throws ServletException, NamespaceException, IOException
    {
        HttpService httpService = getHTTPService( registry.getBundleContext() );
        CookieServlet servlet = new CookieServlet( MODE_MULTI );
        httpService.registerServlet( "/test", servlet, null, null );

        //Test that no cookies are currently set.
        HttpURLConnection client = getConnection( DEFAULT_BASE_URL + "/test", "GET" );

        //Set the cookie in the response
View Full Code Here

Examples of org.osgi.service.http.HttpService.registerServlet()

    public void testQueryString() throws ServletException, NamespaceException, IOException
    {
        HttpService httpService = getHTTPService( registry.getBundleContext() );

        BasicTestingServlet testServlet = new BasicTestingServlet();
        httpService.registerServlet( "/test", testServlet, null, null );

        StringBuffer qs = new StringBuffer( "?" );
        int parameterCount = 16;
        for ( int i = 0; i < parameterCount; ++i )
        {
View Full Code Here

Examples of org.osgi.service.http.HttpService.registerServlet()

     */
    public void testCanReregisterAlias() throws ServletException, NamespaceException
    {
        HttpService httpService = getHTTPService( registry.getBundleContext() );

        httpService.registerServlet( "/alias", new BasicTestingServlet(), null, null );

        httpService.unregister( "/alias" );

        httpService.registerServlet( "/alias", new BasicTestingServlet(), null, null );
    }
View Full Code Here

Examples of org.osgi.service.http.HttpService.registerServlet()

        httpService.registerServlet( "/alias", new BasicTestingServlet(), null, null );

        httpService.unregister( "/alias" );

        httpService.registerServlet( "/alias", new BasicTestingServlet(), null, null );
    }


    /**
     * Test resources can be registered.
View Full Code Here

Examples of org.osgi.service.http.HttpService.registerServlet()

    public void testExecuteGET() throws ServletException, NamespaceException, IOException
    {
        HttpService httpService = getHTTPService( registry.getBundleContext() );

        BasicTestingServlet testServlet = new BasicTestingServlet();
        httpService.registerServlet( "/test", testServlet, null, null );

        HttpURLConnection client = getConnection( DEFAULT_BASE_URL + "/test", "GET" );

        client.connect();
View Full Code Here

Examples of org.osgi.service.http.HttpService.registerServlet()

    public void testExecutePOST() throws ServletException, NamespaceException, IOException
    {
        HttpService httpService = getHTTPService( registry.getBundleContext() );

        BasicTestingServlet testServlet = new BasicTestingServlet();
        httpService.registerServlet( "/test", testServlet, null, null );

        HttpURLConnection client = getConnection( DEFAULT_BASE_URL + "/test", "POST" );
        client.connect();

        assertTrue( client.getResponseCode() == 200 );
View Full Code Here

Examples of org.osgi.service.http.HttpService.registerServlet()

    public void testExecutePUT() throws ServletException, NamespaceException, IOException
    {
        HttpService httpService = getHTTPService( registry.getBundleContext() );

        BasicTestingServlet testServlet = new BasicTestingServlet();
        httpService.registerServlet( "/test", testServlet, null, null );

        HttpURLConnection client = getConnection( DEFAULT_BASE_URL + "/test", "PUT" );

        client.connect();
View Full Code Here

Examples of org.osgi.service.http.HttpService.registerServlet()

    public void testExecuteDELETE() throws ServletException, NamespaceException, IOException
    {
        HttpService httpService = getHTTPService( registry.getBundleContext() );

        BasicTestingServlet testServlet = new BasicTestingServlet();
        httpService.registerServlet( "/test", testServlet, null, null );

        HttpURLConnection client = getConnection( DEFAULT_BASE_URL + "/test", "DELETE" );

        client.connect();
View Full Code Here

Examples of org.osgi.service.http.HttpService.registerServlet()

        HttpService httpService = getHTTPService( registry.getBundleContext() );

        String content = "test content";

        BasicTestingServlet testServlet = new BasicTestingServlet( content, false );
        httpService.registerServlet( "/test", testServlet, null, null );

        HttpURLConnection client = getConnection( DEFAULT_BASE_URL + "/test", "GET" );

        client.connect();
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.