Package org.jibx.ws.codec.MediaType

Examples of org.jibx.ws.codec.MediaType.Parameter


   
    @Test
    public final void toString_shouldReturnDifferentStringAfterParametersAdded() throws Exception {
        MediaType mediaType = new MediaType(" text/hTMl;   charset=UTF-8 ");
        assertThat(mediaType.toString(), is("text/html; charset=UTF-8"));
        mediaType.addParameter(new Parameter("action", "man"));
        assertThat(mediaType.toString(), is("text/html; charset=UTF-8; action=man"))
    }
View Full Code Here


        assertThat(mediaType.getBaseType(), is("text/html"))// check cached version too
    }
   
    @Test
    public final void toStringWithParams_shouldAddParametersToString() throws Exception {
        Parameter charset = new Parameter("charset", "utf-16");
        Parameter action = new Parameter("action", "man");
        assertThat(new MediaType("text/html").toStringWithParams(new Parameter[] {charset, action}),
                is("text/html; charset=utf-16; action=man"));
    }
View Full Code Here

                is("text/html; charset=utf-16; action=man"));
    }
   
    @Test
    public final void toStringWithParams_shouldIgnoreNullParameters1() throws Exception {
        Parameter charset = new Parameter("charset", "utf-16");
        assertThat(new MediaType("text/html").toStringWithParams(new Parameter[] {charset, null}),
                is("text/html; charset=utf-16"));
    }
View Full Code Here

                is("text/html"));
    }

    @Test(expected=IllegalStateException.class)
    public final void addParameter_shouldThrowIllegalStateExceptionIfMediaTypeFrozen() throws Exception {
        new MediaType("text/html").freeze().addParameter(new Parameter("action", "man"));
    }
View Full Code Here

TOP

Related Classes of org.jibx.ws.codec.MediaType.Parameter

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.