Examples of host()


Examples of javax.ws.rs.core.UriBuilder.host()

    }

    public void testBuildMethods() {
        UriBuilder builder = new UriBuilderImpl();
        String[] segments = new String[] {"some", "{v1}", "path{v2}", "{v3}", "a+b{v4}"};
        builder.host("localhost").port(8080).segment(segments).fragment("{v5}");

        // build
        URI uri = builder.build("path", "Ex", "a#b", "c%2Bd", "frag");
        String uriString = uri.toString();
        assertEquals("//localhost:8080/some/path/pathEx/a%23b/a+bc%252Bd#frag", uriString);
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.host()

        assertEquals("", uriBuilder.build().toString());
    }

    public void testNullHost() {
        UriBuilder uriBuilder = UriBuilder.fromPath("/path");
        uriBuilder = uriBuilder.host("localhost");
        assertEquals("//localhost/path", uriBuilder.build().toString());

        uriBuilder = uriBuilder.host(null);
        assertEquals("/path", uriBuilder.build().toString());
    }
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.host()

    public void testNullHost() {
        UriBuilder uriBuilder = UriBuilder.fromPath("/path");
        uriBuilder = uriBuilder.host("localhost");
        assertEquals("//localhost/path", uriBuilder.build().toString());

        uriBuilder = uriBuilder.host(null);
        assertEquals("/path", uriBuilder.build().toString());
    }

    public void testBuildWithQueryParam() {
        URI uri = UriBuilder.fromPath("http://localhost:8080").queryParam("a", "b").build();
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.host()

            }
            if (expectedUserInfo != null) {
                expectedUriBuilder.userInfo(expectedUserInfo);
            }
            if (expectedHost != null) {
                expectedUriBuilder.host(expectedHost);
            }
            if (expectedUriBuilder instanceof UriBuilderImpl) {
                ((UriBuilderImpl) expectedUriBuilder).port(expectedPort);
            } else if (expectedUriBuilder instanceof ExtendedUriBuilder) {
                ((ExtendedUriBuilder) expectedUriBuilder).port(expectedPort);
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.host()

     * {@link org.restlet.ext.jaxrs.impl.UriBuilderImpl#encode(boolean)} .
     */
    public void testEncode() throws Exception {
        final UriBuilder uriBuilder = RuntimeDelegate.getInstance()
                .createUriBuilder();
        uriBuilder.host("www.xyz.de");
        uriBuilder.scheme("http");
        uriBuilder.segment("path1", "path2");
        uriBuilder.path("hh ho");
        assertEqualsURI("http://www.xyz.de/path1/path2/hh%20ho", uriBuilder,
                true);
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.host()

        assertEquals("", uriBuilder.build().toString());
    }

    public void testNullHost() {
        UriBuilder uriBuilder = UriBuilder.fromPath("/path");
        uriBuilder = uriBuilder.host("localhost");
        assertEquals("//localhost/path", uriBuilder.build().toString());

        uriBuilder = uriBuilder.host(null);
        assertEquals("/path", uriBuilder.build().toString());
    }
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.host()

    public void testNullHost() {
        UriBuilder uriBuilder = UriBuilder.fromPath("/path");
        uriBuilder = uriBuilder.host("localhost");
        assertEquals("//localhost/path", uriBuilder.build().toString());

        uriBuilder = uriBuilder.host(null);
        assertEquals("/path", uriBuilder.build().toString());
    }

    public void testBuildWithQueryParam() {
        URI uri = UriBuilder.fromPath("http://localhost:8080").queryParam("a", "b").build();
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.host()

    }

    public void testBuildMethods() {
        UriBuilder builder = new UriBuilderImpl();
        String[] segments = new String[] {"some", "{v1}", "path{v2}", "{v3}", "a+b{v4}"};
        builder.host("localhost").port(8080).segment(segments).fragment("{v5}");

        // build
        URI uri = builder.build("path", "Ex", "a#b", "c%2Bd", "frag");
        String uriString = uri.toString();
        assertEquals("//localhost:8080/some/path/pathEx/a%23b/a+bc%252Bd#frag", uriString);
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.host()

        assertEquals("", uriBuilder.build().toString());
    }

    public void testNullHost() {
        UriBuilder uriBuilder = UriBuilder.fromPath("/path");
        uriBuilder = uriBuilder.host("localhost");
        assertEquals("//localhost/path", uriBuilder.build().toString());

        uriBuilder = uriBuilder.host(null);
        assertEquals("/path", uriBuilder.build().toString());
    }
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.host()

    public void testNullHost() {
        UriBuilder uriBuilder = UriBuilder.fromPath("/path");
        uriBuilder = uriBuilder.host("localhost");
        assertEquals("//localhost/path", uriBuilder.build().toString());

        uriBuilder = uriBuilder.host(null);
        assertEquals("/path", uriBuilder.build().toString());
    }

    public void testBuildWithQueryParam() {
        URI uri = UriBuilder.fromPath("http://localhost:8080").queryParam("a", "b").build();
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.