Search in sources :

Example 31 with XmlParser

use of org.codice.ddf.parser.xml.XmlParser in project ddf by codice.

the class XmlResponseQueueTransformerTest method setup.

@Before
public void setup() throws MimeTypeParseException {
    parser = new XmlParser();
    PrintWriterProvider printWriterProvider = new PrintWriterProviderImpl();
    MetacardMarshaller metacardMarshaller = new MetacardMarshallerImpl(parser, printWriterProvider);
    mimeType = getMimeType();
    transformer = new XmlResponseQueueTransformer(parser, printWriterProvider, metacardMarshaller, mimeType);
}
Also used : XmlParser(org.codice.ddf.parser.xml.XmlParser) MetacardMarshallerImpl(ddf.catalog.transformer.xml.MetacardMarshallerImpl) PrintWriterProvider(ddf.catalog.transformer.api.PrintWriterProvider) MetacardMarshaller(ddf.catalog.transformer.api.MetacardMarshaller) PrintWriterProviderImpl(ddf.catalog.transformer.xml.PrintWriterProviderImpl) XmlResponseQueueTransformer(ddf.catalog.transformer.xml.XmlResponseQueueTransformer) Before(org.junit.Before)

Example 32 with XmlParser

use of org.codice.ddf.parser.xml.XmlParser in project ddf by codice.

the class XacmlPdpTest method setup.

@Before()
public void setup() throws PdpException, IOException {
    temporaryFolder.create();
    File policy = temporaryFolder.newFile("policy.xml");
    FileOutputStream policyOutStream = new FileOutputStream(policy);
    InputStream policyStream = XacmlPdp.class.getResourceAsStream("/policies/test-policy.xml");
    IOUtils.copy(policyStream, policyOutStream);
    testRealm = new XacmlPdp(new File(policy.getParent()).getAbsolutePath(), new XmlParser(), Arrays.asList("item0=item0Val1", "item1=item1Val1,item1Val2", "item2=item2Val1,item2Val2,item2Val3"), mock(SecurityLogger.class));
}
Also used : XmlParser(org.codice.ddf.parser.xml.XmlParser) InputStream(java.io.InputStream) FileOutputStream(java.io.FileOutputStream) File(java.io.File) Before(org.junit.Before)

Aggregations

XmlParser (org.codice.ddf.parser.xml.XmlParser)32 Test (org.junit.Test)16 Before (org.junit.Before)14 ReceivedToken (org.apache.cxf.sts.request.ReceivedToken)9 TokenValidatorParameters (org.apache.cxf.sts.token.validator.TokenValidatorParameters)9 SecurityLogger (ddf.security.audit.SecurityLogger)7 JAXBContext (javax.xml.bind.JAXBContext)7 TokenValidatorResponse (org.apache.cxf.sts.token.validator.TokenValidatorResponse)7 File (java.io.File)5 HashSet (java.util.HashSet)5 RegistryObjectMetacardType (org.codice.ddf.registry.common.metacard.RegistryObjectMetacardType)5 MetacardMarshaller (org.codice.ddf.registry.schemabindings.helper.MetacardMarshaller)5 MetacardMarshaller (ddf.catalog.transformer.api.MetacardMarshaller)4 MetacardMarshallerImpl (ddf.catalog.transformer.xml.MetacardMarshallerImpl)4 PrintWriterProviderImpl (ddf.catalog.transformer.xml.PrintWriterProviderImpl)4 ArrayList (java.util.ArrayList)4 MetacardImpl (ddf.catalog.data.impl.MetacardImpl)3 XmlMetacardTransformer (ddf.catalog.transformer.xml.XmlMetacardTransformer)3 StringWriter (java.io.StringWriter)3 Writer (java.io.Writer)3