use of org.apache.cxf.jaxrs.JAXBContextProvider in project cxf by apache.
the class ProviderFactoryTest method testCustomResolverProxy.
@Test
public void testCustomResolverProxy() throws Exception {
ProviderFactory pf = ServerProviderFactory.getInstance();
pf.registerUserProvider(new JAXBContextProvider());
pf.registerUserProvider(new JAXBContextProvider2());
Message message = prepareMessage("text/xml+*", null);
ContextResolver<JAXBContext> cr = pf.createContextResolver(JAXBContext.class, message);
assertTrue(cr instanceof ProviderFactory.ContextResolverProxy);
assertTrue(((ProviderFactory.ContextResolverProxy<?>) cr).getResolvers().get(0) instanceof JAXBContextProvider);
assertTrue(((ProviderFactory.ContextResolverProxy<?>) cr).getResolvers().get(1) instanceof JAXBContextProvider2);
}
Aggregations