Search in sources :

Example 6 with Parser

use of org.codice.ddf.parser.Parser in project ddf by codice.

the class TestGml3ToWktImpl method testBadParser.

@Test(expected = ValidationException.class)
public void testBadParser() throws ParserException, ValidationException {
    Parser parser = mock(XmlParser.class);
    when(parser.configureParser(anyList(), any(ClassLoader.class))).thenCallRealMethod();
    when(parser.unmarshal(any(ParserConfigurator.class), any(Class.class), any(InputStream.class))).thenThrow(new ParserException());
    gtw = new Gml3ToWktImpl(parser);
    gtw.convert(createGmlPoint(0, 0));
}
Also used : ParserConfigurator(org.codice.ddf.parser.ParserConfigurator) ParserException(org.codice.ddf.parser.ParserException) InputStream(java.io.InputStream) Parser(org.codice.ddf.parser.Parser) XmlParser(org.codice.ddf.parser.xml.XmlParser) Test(org.junit.Test)

Aggregations

Parser (org.codice.ddf.parser.Parser)6 XmlParser (org.codice.ddf.parser.xml.XmlParser)6 Test (org.junit.Test)5 InputStream (java.io.InputStream)4 ParserConfigurator (org.codice.ddf.parser.ParserConfigurator)3 MetacardMarshaller (ddf.catalog.transformer.api.MetacardMarshaller)2 MetacardMarshallerImpl (ddf.catalog.transformer.xml.MetacardMarshallerImpl)2 PrintWriterProviderImpl (ddf.catalog.transformer.xml.PrintWriterProviderImpl)2 XmlMetacardTransformer (ddf.catalog.transformer.xml.XmlMetacardTransformer)2 Attribute (ddf.catalog.data.Attribute)1 AttributeDescriptor (ddf.catalog.data.AttributeDescriptor)1 BinaryContent (ddf.catalog.data.BinaryContent)1 Metacard (ddf.catalog.data.Metacard)1 InputTransformer (ddf.catalog.transform.InputTransformer)1 MetacardTransformer (ddf.catalog.transform.MetacardTransformer)1 XmlInputTransformer (ddf.catalog.transformer.xml.XmlInputTransformer)1 RegistryObjectType (oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryObjectType)1 ParserException (org.codice.ddf.parser.ParserException)1 BaseAuthenticationToken (org.codice.ddf.security.handler.api.BaseAuthenticationToken)1 UPAuthenticationToken (org.codice.ddf.security.handler.api.UPAuthenticationToken)1