Search in sources :

Example 81 with KeyValuePair

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

the class AdvancedActiveMqConsumerTest method createVendorImpl.

@Override
protected BasicActiveMqImplementation createVendorImpl() {
    AdvancedActiveMqImplementation result = new AdvancedActiveMqImplementation();
    result.getConnectionFactoryProperties().addKeyValuePair(new KeyValuePair("DisableTimeStampsByDefault", "true"));
    result.getConnectionFactoryProperties().addKeyValuePair(new KeyValuePair("NestedMapAndListEnabled", "true"));
    return result;
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair)

Example 82 with KeyValuePair

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

the class AdvancedActiveMqImplementationTest method createFactoryProperties.

private static KeyValuePairSet createFactoryProperties() {
    KeyValuePairSet props = new KeyValuePairSet();
    props.addKeyValuePair(new KeyValuePair("Unsupported_Property", "99"));
    props.addAll(createClient53Properties());
    props.addAll(createClient59Properties());
    return props;
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair) KeyValuePairSet(com.adaptris.util.KeyValuePairSet)

Example 83 with KeyValuePair

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

the class AdvancedActiveMqProducerTest method createVendorImpl.

@Override
protected BasicActiveMqImplementation createVendorImpl() {
    AdvancedActiveMqImplementation result = new AdvancedActiveMqImplementation();
    result.getConnectionFactoryProperties().addKeyValuePair(new KeyValuePair("DisableTimeStampsByDefault", "true"));
    result.getConnectionFactoryProperties().addKeyValuePair(new KeyValuePair("NestedMapAndListEnabled", "true"));
    result.setPrefetchPolicy(new PrefetchPolicyFactory());
    result.setRedeliveryPolicy(new RedeliveryPolicyFactory());
    result.setBlobTransferPolicy(new BlobTransferPolicyFactory());
    return result;
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair)

Example 84 with KeyValuePair

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

the class MultiPayloadXmlTransformServiceTest method testXSLT_XslMessageTerminate.

@Test
public void testXSLT_XslMessageTerminate() throws Exception {
    MultiPayloadAdaptrisMessage m1 = MessageHelper.createMultiPayloadMessage(PAYLOAD_ID_SOURCE, PROPERTIES.getProperty(KEY_XML_TEST_INPUT));
    MultiPayloadXmlTransformService service = createBaseExample();
    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) XsltTransformerFactory(com.adaptris.util.text.xml.XsltTransformerFactory) MultiPayloadAdaptrisMessage(com.adaptris.core.MultiPayloadAdaptrisMessage) TransformerException(javax.xml.transform.TransformerException) Test(org.junit.Test)

Example 85 with KeyValuePair

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

the class AdapterStateSummaryTest method testSetAdapterStateKeyValuePair.

@Test
public void testSetAdapterStateKeyValuePair() {
    AdapterStateSummary s1 = new AdapterStateSummary();
    s1.setAdapterState(new KeyValuePair(DEFAULT_KEY, ClosedState.getInstance().getClass().getName()));
    assertEquals(DEFAULT_KEY, s1.getAdapterState().getKey());
    assertEquals(ClosedState.getInstance().getClass().getName(), s1.getAdapterState().getValue());
    try {
        s1.setAdapterState(new KeyValuePair("", "ABC"));
        fail("Null Key in KeyValuePair");
    } catch (IllegalArgumentException expected) {
    }
    try {
        s1.setAdapterState(new KeyValuePair("ABC", ""));
        fail("Null Value in KeyValuePair");
    } catch (IllegalArgumentException expected) {
    }
    try {
        s1.setAdapterState(null);
        fail("Null KeyValuePair");
    } catch (IllegalArgumentException expected) {
    }
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair) Test(org.junit.Test)

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