Package javax.ws.rs.core.Variant

Examples of javax.ws.rs.core.Variant.VariantListBuilder.languages()


        List<Variant> list = null;

        list = builder.languages(Locale.ENGLISH).encodings("UTF-8").add().build();
        assertList(new Variant[] {variant1}, list);

        list = builder.languages(Locale.ENGLISH).encodings("UTF-16").add().build();
        assertList(new Variant[] {variant2}, list);

        list = builder.languages(Locale.ENGLISH).encodings("UTF-8", "UTF-16").add().build();
        assertList(new Variant[] {variant1, variant2}, list);
View Full Code Here


        assertList(new Variant[] {variant1}, list);

        list = builder.languages(Locale.ENGLISH).encodings("UTF-16").add().build();
        assertList(new Variant[] {variant2}, list);

        list = builder.languages(Locale.ENGLISH).encodings("UTF-8", "UTF-16").add().build();
        assertList(new Variant[] {variant1, variant2}, list);

        list = builder.languages(Locale.ENGLISH, Locale.CHINESE).encodings("UTF-8").add().build();
        assertList(new Variant[] {variant1, variant3}, list);
View Full Code Here

        assertList(new Variant[] {variant2}, list);

        list = builder.languages(Locale.ENGLISH).encodings("UTF-8", "UTF-16").add().build();
        assertList(new Variant[] {variant1, variant2}, list);

        list = builder.languages(Locale.ENGLISH, Locale.CHINESE).encodings("UTF-8").add().build();
        assertList(new Variant[] {variant1, variant3}, list);

        list =
            builder.languages(Locale.ENGLISH, Locale.CHINESE).encodings("UTF-8", "UTF-16").add()
                .build();
View Full Code Here

        list = builder.languages(Locale.ENGLISH, Locale.CHINESE).encodings("UTF-8").add().build();
        assertList(new Variant[] {variant1, variant3}, list);

        list =
            builder.languages(Locale.ENGLISH, Locale.CHINESE).encodings("UTF-8", "UTF-16").add()
                .build();
        assertList(new Variant[] {variant1, variant2, variant3, variant4}, list);
    }

    public void testBuildMediaTypesAndLanguagesAndEncodings() {
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.