}
private void doTestDefaultJaxbProviderCloned(ProviderFactory pf, String property) {
Message message = new MessageImpl();
message.put(Message.QUERY_STRING, "uri=" + property);
MessageBodyReader customJaxbReader = pf.createMessageBodyReader((Class<?>)Book.class, null, null,
MediaType.TEXT_XML_TYPE, message);
assertTrue(customJaxbReader instanceof JAXBElementProvider);
JAXBElementProvider provider = (JAXBElementProvider)customJaxbReader;
MessageContext mc = provider.getContext();
assertNotNull(mc);
UriInfo ui = mc.getUriInfo();
MultivaluedMap<String, String> queries = ui.getQueryParameters();
assertEquals(1, queries.size());
List<String> uriQuery = queries.get("uri");
assertEquals(1, uriQuery.size());
assertEquals(property, uriQuery.get(0));
MessageBodyReader customJaxbReader2 = pf.createMessageBodyReader((Class<?>)Book.class, null, null,
MediaType.TEXT_XML_TYPE, message);
assertSame(customJaxbReader, customJaxbReader2);
MessageBodyWriter customJaxbWriter = pf.createMessageBodyWriter((Class<?>)Book.class, null, null,
MediaType.TEXT_XML_TYPE, message);
assertSame(customJaxbReader, customJaxbWriter);
MessageBodyReader jaxbReader = ProviderFactory.getSharedInstance().createMessageBodyReader(
(Class<?>)Book.class, null, null, MediaType.TEXT_XML_TYPE, message);
assertTrue(jaxbReader instanceof JAXBElementProvider);
assertNotSame(jaxbReader, customJaxbReader);
}