use of org.n52.janmayen.http.MediaType in project arctic-sea by 52North.
the class MediaTypeTest method applicationXml.
@Test
public void applicationXml() {
MediaType mt = MediaType.parse("application/xml");
errors.checkThat(mt.getType(), is("application"));
errors.checkThat(mt.getSubtype(), is("xml"));
errors.checkThat(mt.isWildcard(), is(false));
errors.checkThat(mt.isWildcardType(), is(false));
errors.checkThat(mt.isWildcardSubtype(), is(false));
errors.checkThat(mt.getParameters().size(), is(0));
}
use of org.n52.janmayen.http.MediaType in project arctic-sea by 52North.
the class MediaTypeTest method applicationXmlWithQAndSpace.
@Test
public void applicationXmlWithQAndSpace() {
MediaType mt = MediaType.parse("application/xml; q=1");
errors.checkThat(mt.getType(), is("application"));
errors.checkThat(mt.getSubtype(), is("xml"));
errors.checkThat(mt.getParameters().size(), is(1));
errors.checkThat(mt.getParameter("q").iterator().next(), is("1"));
}
use of org.n52.janmayen.http.MediaType in project arctic-sea by 52North.
the class MediaTypeTest method testSlashEscape.
@Test
public void testSlashEscape() {
MediaType mt = MediaType.parse("a/b; x=\"a/1\"");
errors.checkThat(mt.toString(), is("a/b; x=\"a/1\""));
}
use of org.n52.janmayen.http.MediaType in project arctic-sea by 52North.
the class MediaTypeTest method applicationXmlWithQuotedParameterAndQuotesWithin.
@Test
public void applicationXmlWithQuotedParameterAndQuotesWithin() {
MediaType mt = MediaType.parse("application/xml;a=\"as\\\" = df\"");
errors.checkThat(mt.getType(), is("application"));
errors.checkThat(mt.getSubtype(), is("xml"));
errors.checkThat(mt.getParameters().size(), is(1));
errors.checkThat(mt.getParameter("a").iterator().next(), is("as\" = df"));
}
use of org.n52.janmayen.http.MediaType in project arctic-sea by 52North.
the class MediaTypeTest method applicationXmlWithQAndThreeSpace.
@Test
public void applicationXmlWithQAndThreeSpace() {
MediaType mt = MediaType.parse("application/xml; q=1");
errors.checkThat(mt.getType(), is("application"));
errors.checkThat(mt.getSubtype(), is("xml"));
errors.checkThat(mt.getParameters().size(), is(1));
errors.checkThat(mt.getParameter("q").iterator().next(), is("1"));
}
Aggregations