Search in sources :

Example 41 with KeyValuePair

use of com.adaptris.util.KeyValuePair in project interlok by adaptris.

the class XmlTransformServiceTest method testXSLT_XslMessageTerminate.

@Test
public void testXSLT_XslMessageTerminate() throws Exception {
    AdaptrisMessage m1 = MessageHelper.createMessage(PROPERTIES.getProperty(KEY_XML_TEST_INPUT));
    XmlTransformService service = new XmlTransformService();
    XsltTransformerFactory fac = new XsltTransformerFactory();
    fac.getTransformerFactoryAttributes().add(new KeyValuePair("http://saxon.sf.net/feature/messageEmitterClass", MessageWarner.class.getCanonicalName()));
    fac.getTransformerFactoryFeatures().add(new KeyValuePair(XMLConstants.FEATURE_SECURE_PROCESSING, "true"));
    service.setXmlTransformerFactory(fac);
    service.setUrl(PROPERTIES.getProperty(KEY_XML_TEST_TRANSFORM_URL_XSL_MESSAGE));
    try {
        execute(service, m1);
        fail();
    } catch (ServiceException expected) {
        assertExceptionCause(expected, TransformerException.class, UncheckedXPathException.class);
    }
}
Also used : UncheckedXPathException(net.sf.saxon.trans.UncheckedXPathException) KeyValuePair(com.adaptris.util.KeyValuePair) ServiceException(com.adaptris.core.ServiceException) AdaptrisMessage(com.adaptris.core.AdaptrisMessage) XsltTransformerFactory(com.adaptris.util.text.xml.XsltTransformerFactory) TransformerException(javax.xml.transform.TransformerException) Test(org.junit.Test)

Example 42 with KeyValuePair

use of com.adaptris.util.KeyValuePair in project interlok by adaptris.

the class XmlRuleValidatorTest method createNamespaceHolder.

static KeyValuePairSet createNamespaceHolder() {
    KeyValuePairSet result = new KeyValuePairSet();
    result.add(new KeyValuePair("titan", "http://www.adaptris.com/titans"));
    result.add(new KeyValuePair("olympian", "http://www.adaptris.com/olympians"));
    return result;
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair) KeyValuePairSet(com.adaptris.util.KeyValuePairSet)

Example 43 with KeyValuePair

use of com.adaptris.util.KeyValuePair in project interlok by adaptris.

the class MetadataHelperTest method testConvertFromKeyValuePairs.

@Test
public void testConvertFromKeyValuePairs() {
    KeyValuePairCollection elements = new KeyValuePairCollection();
    elements.add(new KeyValuePair("test", "value"));
    assertNotNull(convertFromKeyValuePairs(elements));
    assertTrue(convertFromKeyValuePairs(elements).contains(new MetadataElement("test", "")));
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair) KeyValuePairCollection(com.adaptris.util.KeyValuePairCollection) MetadataElement(com.adaptris.core.MetadataElement) Test(org.junit.Test)

Example 44 with KeyValuePair

use of com.adaptris.util.KeyValuePair in project interlok by adaptris.

the class ResolvableExpressionParameterTest method setUp.

@Before
public void setUp() throws Exception {
    message = createMessage();
    message.setContent(CONTENT, "UTF-8");
    expressions = new KeyValuePairList();
    expressions.add(new KeyValuePair("beer", CONTENT));
    existing = new HashMap<>();
    existing.put("key", "value");
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair) KeyValuePairList(com.adaptris.util.KeyValuePairList) Before(org.junit.Before)

Example 45 with KeyValuePair

use of com.adaptris.util.KeyValuePair in project interlok by adaptris.

the class DocumentBuilderFactoryBuilderTest method createNamespaceEntries.

public static KeyValuePairSet createNamespaceEntries() {
    KeyValuePairSet result = new KeyValuePairSet();
    result.add(new KeyValuePair("xsd", "http://www.w3.org/2001/XMLSchema"));
    result.add(new KeyValuePair("xs", "http://www.w3.org/2001/XMLSchema"));
    return result;
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair) KeyValuePairSet(com.adaptris.util.KeyValuePairSet)

Aggregations

KeyValuePair (com.adaptris.util.KeyValuePair)143 Test (org.junit.Test)79 KeyValuePairSet (com.adaptris.util.KeyValuePairSet)55 AdaptrisMessage (com.adaptris.core.AdaptrisMessage)26 KeyValuePairList (com.adaptris.util.KeyValuePairList)12 StandardJndiImplementation (com.adaptris.core.jms.jndi.StandardJndiImplementation)11 StandaloneProducer (com.adaptris.core.StandaloneProducer)10 Channel (com.adaptris.core.Channel)9 MockMessageProducer (com.adaptris.core.stubs.MockMessageProducer)9 TimeInterval (com.adaptris.util.TimeInterval)9 ServiceException (com.adaptris.core.ServiceException)7 JmsConnection (com.adaptris.core.jms.JmsConnection)6 ArrayList (java.util.ArrayList)6 CoreException (com.adaptris.core.CoreException)5 StandardWorkflow (com.adaptris.core.StandardWorkflow)5 PasProducer (com.adaptris.core.jms.PasProducer)5 MetadataCollection (com.adaptris.core.MetadataCollection)4 MetadataElement (com.adaptris.core.MetadataElement)4 StandaloneConsumer (com.adaptris.core.StandaloneConsumer)4 StandaloneRequestor (com.adaptris.core.StandaloneRequestor)3