use of org.n52.janmayen.http.MediaType in project arctic-sea by 52North.
the class MediaTypeTest method applicationXmlWithQ.
@Test
public void applicationXmlWithQ() {
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 applicationXmlWithQAndTwoSpace.
@Test
public void applicationXmlWithQAndTwoSpace() {
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 applicationXmlWithQAndFiveSpace.
@Test
public void applicationXmlWithQAndFiveSpace() {
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 testSlashEscape3.
@Test
public void testSlashEscape3() {
MediaType mt = new MediaType("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 UVFEncoder method createEncoderKeys.
private Set<EncoderKey> createEncoderKeys() {
Set<EncoderKey> keys = Sets.newHashSet();
for (String s : MEDIA_TYPES) {
MediaType mediaType = MediaType.parse(s);
keys.add((EncoderKey) new OperationResponseEncoderKey(SosConstants.SOS, Sos1Constants.SERVICEVERSION, SosConstants.Operations.GetObservation, mediaType));
keys.add((EncoderKey) new OperationResponseEncoderKey(SosConstants.SOS, Sos2Constants.SERVICEVERSION, SosConstants.Operations.GetObservation, mediaType));
keys.add((EncoderKey) new OperationResponseEncoderKey(SosConstants.SOS, Sos1Constants.SERVICEVERSION, SosConstants.Operations.GetObservationById, mediaType));
keys.add((EncoderKey) new OperationResponseEncoderKey(SosConstants.SOS, Sos2Constants.SERVICEVERSION, SosConstants.Operations.GetObservationById, mediaType));
}
return keys;
}
Aggregations