Search in sources :

Example 16 with TreeUnmarshaller

use of com.thoughtworks.xstream.core.TreeUnmarshaller in project ddf by codice.

the class CswTransformProviderTest method testUnmarshalNoTransformers.

@Test(expected = ConversionException.class)
public void testUnmarshalNoTransformers() throws Exception {
    when(mockInputManager.getTransformerBySchema(anyString())).thenReturn(null);
    HierarchicalStreamReader reader = new WstxDriver().createReader(new StringReader(getRecord()));
    CswTransformProvider provider = new CswTransformProvider(null, mockInputManager);
    UnmarshallingContext context = new TreeUnmarshaller(null, null, null, null);
    provider.unmarshal(reader, context);
}
Also used : WstxDriver(com.thoughtworks.xstream.io.xml.WstxDriver) StringReader(java.io.StringReader) HierarchicalStreamReader(com.thoughtworks.xstream.io.HierarchicalStreamReader) UnmarshallingContext(com.thoughtworks.xstream.converters.UnmarshallingContext) TreeUnmarshaller(com.thoughtworks.xstream.core.TreeUnmarshaller) Test(org.junit.Test)

Aggregations

UnmarshallingContext (com.thoughtworks.xstream.converters.UnmarshallingContext)16 TreeUnmarshaller (com.thoughtworks.xstream.core.TreeUnmarshaller)16 Test (org.junit.Test)16 HierarchicalStreamReader (com.thoughtworks.xstream.io.HierarchicalStreamReader)14 StringReader (java.io.StringReader)12 WstxDriver (com.thoughtworks.xstream.io.xml.WstxDriver)6 XppReader (com.thoughtworks.xstream.io.xml.XppReader)6 InputTransformer (ddf.catalog.transform.InputTransformer)6 InputStream (java.io.InputStream)6 HashMap (java.util.HashMap)4 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)4 Matchers.anyString (org.mockito.Matchers.anyString)4 DomReader (com.thoughtworks.xstream.io.xml.DomReader)2 StaxDriver (com.thoughtworks.xstream.io.xml.StaxDriver)2 Metacard (ddf.catalog.data.Metacard)2 Map (java.util.Map)2 DocumentBuilder (javax.xml.parsers.DocumentBuilder)2 DocumentBuilderFactory (javax.xml.parsers.DocumentBuilderFactory)2 Document (org.w3c.dom.Document)2