Package javax.ws.rs.core.Variant

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


    public void testBuildLanguages() {
        Variant variant1 = new Variant(null, Locale.ENGLISH, null);
        Variant variant2 = new Variant(null, Locale.CHINESE, null);

        VariantListBuilder builder = new VariantListBuilderImpl();
        List<Variant> list = builder.languages(Locale.ENGLISH).add().build();
        assertList(new Variant[] {variant1}, list);

        list = builder.languages(Locale.ENGLISH, Locale.CHINESE).add().build();
        assertList(new Variant[] {variant1, variant2}, list);
    }
View Full Code Here


        VariantListBuilder builder = new VariantListBuilderImpl();
        List<Variant> list = builder.languages(Locale.ENGLISH).add().build();
        assertList(new Variant[] {variant1}, list);

        list = builder.languages(Locale.ENGLISH, Locale.CHINESE).add().build();
        assertList(new Variant[] {variant1, variant2}, list);
    }

    public void testBuildEncodings() {
        Variant variant1 = new Variant(null, null, "UTF-8");
View Full Code Here

        Variant variant4 = new Variant(null, Locale.CHINESE, "UTF-16");

        VariantListBuilder builder = new VariantListBuilderImpl();
        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);
View Full Code Here

        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

    public void testBuildLanguages() {
        Variant variant1 = new Variant(null, Locale.ENGLISH, null);
        Variant variant2 = new Variant(null, Locale.CHINESE, null);

        VariantListBuilder builder = new VariantListBuilderImpl();
        List<Variant> list = builder.languages(Locale.ENGLISH).add().build();
        assertList(new Variant[] {variant1}, list);

        list = builder.languages(Locale.ENGLISH, Locale.CHINESE).add().build();
        assertList(new Variant[] {variant1, variant2}, list);
    }
View Full Code Here

        VariantListBuilder builder = new VariantListBuilderImpl();
        List<Variant> list = builder.languages(Locale.ENGLISH).add().build();
        assertList(new Variant[] {variant1}, list);

        list = builder.languages(Locale.ENGLISH, Locale.CHINESE).add().build();
        assertList(new Variant[] {variant1, variant2}, list);
    }

    public void testBuildEncodings() {
        Variant variant1 = new Variant(null, null, "UTF-8");
View Full Code Here

        Variant variant4 = new Variant(null, Locale.CHINESE, "UTF-16");

        VariantListBuilder builder = new VariantListBuilderImpl();
        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);
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.