@Test public void testJAXBUnmarshallingWithDTDServerConfigurable() throws Exception { final Properties props = new Properties(); props.put("wink.supportDTDEntityExpansion", "true"); checking(new Expectations() {{ allowing(winkConfiguration).getProperties(); will(returnValue(props)); }}); assertTrue(sourceProviderReader.isReadable(DOMSource.class, null, null, MediaType.TEXT_XML_TYPE)); ByteArrayInputStream bais = new ByteArrayInputStream(xmlWithDTD.getBytes()); Object obj = sourceProviderReader.readFrom(DOMSource.class, null, null, MediaType.TEXT_XML_TYPE, null, bais); assertTrue(obj instanceof DOMSource); }
protected boolean isReadable(MediaType mediaType) { return MediaTypeUtils.isXmlType(mediaType); }
SourceProvider implements MessageBodyWriter<Source> { protected boolean isReadable(MediaType mediaType) { return MediaTypeUtils.isXmlType(mediaType); } }
SourceProvider implements MessageBodyWriter<Source> { protected boolean isReadable(MediaType mediaType) { return MediaTypeUtils.isXmlType(mediaType); }  }
SourceProvider implements MessageBodyWriter<Source> { protected boolean isReadable(MediaType mediaType) { return MediaTypeUtils.isXmlType(mediaType); }  long getSize(Source t,
                        Class<?> type,
                        Type genericType,
                        Annotation[] annotations,
                        MediaType mediaType); boolean isWriteable(Class<?> type,
                               Type genericType,
                               Annotation[] annotations,
                               MediaType mediaType); void writeTo(Source t,
                        Class<?> type,
                        Type genericType,
                        Annotation[] annotations,
                        MediaType mediaType,
                        MultivaluedMap<String, Object> httpHeaders,
                        OutputStream entityStream); }
SourceProvider implements MessageBodyWriter<Source> { protected boolean isReadable(MediaType mediaType) { return MediaTypeUtils.isXmlType(mediaType); }  long getSize(Source t,
                        Class<?> type,
                        Type genericType,
                        Annotation[] annotations,
                        MediaType mediaType); boolean isWriteable(Class<?> type,
                               Type genericType,
                               Annotation[] annotations,
                               MediaType mediaType); void writeTo(Source t,
                        Class<?> type,
                        Type genericType,
                        Annotation[] annotations,
                        MediaType mediaType,
                        MultivaluedMap<String, Object> httpHeaders,
                        OutputStream entityStream);  }