Package javax.ws.rs.core

Examples of javax.ws.rs.core.Form


    @Test
    public void testFormParamTypes() throws ExecutionException, InterruptedException {
        initiateWebApplication(FormParamTypes.class);

        Form form = new Form();
        form.param("int", "1");
        form.param("float", "3.14");
        form.param("decimal", "3.14");

        final ContainerResponse responseContext = apply(
                RequestContextBuilder.from("/", "POST").type(MediaType.APPLICATION_FORM_URLENCODED).entity(form).build()
        );
View Full Code Here


    @Test
    public void testFormDefaultValueParamTypes() throws ExecutionException, InterruptedException {
        initiateWebApplication(FormDefaultValueParamTypes.class);

        Form form = new Form();

        final ContainerResponse responseContext = apply(
                RequestContextBuilder.from("/", "POST").type(MediaType.APPLICATION_FORM_URLENCODED).entity(form).build()
        );
View Full Code Here

    @Test
    public void testFormConstructorValueParamTypes() throws ExecutionException, InterruptedException {
        initiateWebApplication(FormConstructorValueParamTypes.class);

        Form form = new Form();

        final ContainerResponse responseContext = apply(
                RequestContextBuilder.from("/", "POST").type(MediaType.APPLICATION_FORM_URLENCODED).entity(form).build()
        );
View Full Code Here

    @Test
    public void testFormParamJAXB() throws ExecutionException, InterruptedException {
        initiateWebApplication(FormResourceJAXB.class);

        Form form = new Form();
        form.param("a", "<jaxbBean><value>a</value></jaxbBean>");
        form.param("b", "<jaxbBean><value>b1</value></jaxbBean>");
        form.param("b", "<jaxbBean><value>b2</value></jaxbBean>");


        final ContainerResponse responseContext = apply(RequestContextBuilder.from("/", "POST")
                .accept(MediaType.APPLICATION_XML)
                .type(MediaType.APPLICATION_FORM_URLENCODED)
View Full Code Here

    @Test
    public void testFormParamJAXBError() throws ExecutionException, InterruptedException {
        initiateWebApplication(FormResourceJAXB.class);

        Form form = new Form();
        form.param("a", "<x><value>a</value></jaxbBean>");
        form.param("b", "<x><value>b1</value></jaxbBean>");
        form.param("b", "<x><value>b2</value></jaxbBean>");

        final ContainerResponse responseContext = apply(
                RequestContextBuilder.from("/", "POST").type(MediaType.APPLICATION_FORM_URLENCODED).entity(form).build()
        );
View Full Code Here

        String date_RFC1123 = "Sun, 06 Nov 1994 08:49:37 GMT";
        String date_RFC1036 = "Sunday, 06-Nov-94 08:49:37 GMT";
        String date_ANSI_C = "Sun Nov  6 08:49:37 1994";

        Form form = new Form();
        form.param("a", date_RFC1123);
        form.param("b", date_RFC1036);
        form.param("c", date_ANSI_C);

        final ContainerResponse responseContext = apply(
                RequestContextBuilder.from("/", "POST").type(MediaType.APPLICATION_FORM_URLENCODED).entity(form).build()
        );
View Full Code Here

    }

    @Test
    public void testEncodedOnPostClass() throws ExecutionException, InterruptedException {
        initiateWebApplication(EncodedOnPostClass.class);
        Form form = new Form();
        form.param("f", ":f");
        RequestContextBuilder requestBuilder = RequestContextBuilder.from("/%20u;m=%20m?q=%20q",
                "POST").type(MediaType.APPLICATION_FORM_URLENCODED_TYPE).entity(form);
        assertEquals("content", apply(requestBuilder.build()).getEntity());
    }
View Full Code Here

    }

    @Test
    public void testCombinedEncodedOnPostClass() throws ExecutionException, InterruptedException {
        initiateWebApplication(EncodedOnPostClass.class);
        Form form = new Form();
        form.param("f", ":f");
        form.param("f2", ":f2");
        RequestContextBuilder requestBuilder = RequestContextBuilder.from("/%20u/combined;m=%20m?q=%20q",
                "POST").type(MediaType.APPLICATION_FORM_URLENCODED_TYPE).entity(form);
        assertEquals("content", apply(requestBuilder.build()).getEntity());
    }
View Full Code Here

    public void testEncodedOnFormParameters() throws ExecutionException, InterruptedException {
        initiateWebApplication(EncodedOnFormParameters.class);

        final RequestContextBuilder requestBuilder = RequestContextBuilder.from("/", "POST")
                .type(MediaType.APPLICATION_FORM_URLENCODED)
                .entity(new Form("u", "\u0161"));

        apply(requestBuilder.build());
    }
View Full Code Here

    }

    @Test
    public void testRepresentation() {
        Form form = new Form();

        form.param("name", "\u00A9 CONTENT \u00FF \u2200 \u22FF");
        form.param("name", "� � �");
        _test(form, FormResource.class, MediaType.APPLICATION_FORM_URLENCODED_TYPE);
    }
View Full Code Here

TOP

Related Classes of javax.ws.rs.core.Form

Copyright © 2018 www.massapicom. 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.