Search in sources :

Example 36 with KeyValuePairSet

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

the class ReplaceNodeTest method testSetNamespaceContext.

@Test
public void testSetNamespaceContext() {
    ReplaceNode obj = new ReplaceNode();
    assertNull(obj.getNamespaceContext());
    KeyValuePairSet kvps = new KeyValuePairSet();
    kvps.add(new KeyValuePair("hello", "world"));
    obj.setNamespaceContext(kvps);
    assertEquals(kvps, obj.getNamespaceContext());
    obj.setNamespaceContext(null);
    assertNull(obj.getNamespaceContext());
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair) KeyValuePairSet(com.adaptris.util.KeyValuePairSet) Test(org.junit.Test)

Example 37 with KeyValuePairSet

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

the class SimpleNamespaceContextTest method createNamespaceEntries.

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)

Example 38 with KeyValuePairSet

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

the class SimpleNamespaceContextTest method testCreateKeyValuePairSetAdaptrisMessage.

@Test
public void testCreateKeyValuePairSetAdaptrisMessage() {
    AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage();
    assertNull(SimpleNamespaceContext.create(null, msg));
    assertNull(SimpleNamespaceContext.create(new KeyValuePairSet(), msg));
    NamespaceContext ctx = SimpleNamespaceContext.create(createNamespaceEntries());
    msg.addObjectHeader(SimpleNamespaceContext.class.getCanonicalName(), ctx);
    NamespaceContext ctx2 = SimpleNamespaceContext.create(null, msg);
    assertEquals(ctx, ctx2);
    NamespaceContext ctx3 = SimpleNamespaceContext.create(createNamespaceEntries(), msg);
    assertNotSame(ctx, ctx3);
}
Also used : AdaptrisMessage(com.adaptris.core.AdaptrisMessage) NamespaceContext(javax.xml.namespace.NamespaceContext) KeyValuePairSet(com.adaptris.util.KeyValuePairSet) Test(org.junit.Test)

Example 39 with KeyValuePairSet

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

the class SimpleNamespaceContextTest method createWithDefaultEntries.

private static KeyValuePairSet createWithDefaultEntries() {
    KeyValuePairSet result = createNamespaceEntries();
    result.add(new KeyValuePair(XMLConstants.XML_NS_PREFIX, XMLConstants.XML_NS_URI));
    result.add(new KeyValuePair(XMLConstants.XMLNS_ATTRIBUTE, XMLConstants.XMLNS_ATTRIBUTE_NS_URI));
    return result;
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair) KeyValuePairSet(com.adaptris.util.KeyValuePairSet)

Example 40 with KeyValuePairSet

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

the class SimpleNamespaceContextTest method createBrokenEntries.

private static KeyValuePairSet createBrokenEntries() {
    KeyValuePairSet result = createNamespaceEntries();
    // XmlConstants.XML_NS_URI == http://www.w3.org/XML/1998/namespace
    // so this should now fail.
    result.add(new KeyValuePair("xml", "http://www.w3.org/XML/2001/namespace"));
    return result;
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair) KeyValuePairSet(com.adaptris.util.KeyValuePairSet)

Aggregations

KeyValuePairSet (com.adaptris.util.KeyValuePairSet)62 KeyValuePair (com.adaptris.util.KeyValuePair)54 Test (org.junit.Test)30 AdaptrisMessage (com.adaptris.core.AdaptrisMessage)5 StandardJndiImplementation (com.adaptris.core.jms.jndi.StandardJndiImplementation)5 TimeInterval (com.adaptris.util.TimeInterval)4 SimpleFactoryConfiguration (com.adaptris.core.jms.jndi.SimpleFactoryConfiguration)3 Connection (java.sql.Connection)3 ArrayList (java.util.ArrayList)3 CoreException (com.adaptris.core.CoreException)2 ServiceException (com.adaptris.core.ServiceException)2 StandaloneConsumer (com.adaptris.core.StandaloneConsumer)2 StandaloneProducer (com.adaptris.core.StandaloneProducer)2 Execution (com.adaptris.core.common.Execution)2 MetadataDataInputParameter (com.adaptris.core.common.MetadataDataInputParameter)2 StringPayloadDataInputParameter (com.adaptris.core.common.StringPayloadDataInputParameter)2 JdbcConnection (com.adaptris.core.jdbc.JdbcConnection)2 JunitBootstrapProperties (com.adaptris.core.stubs.JunitBootstrapProperties)2 MockMessageListener (com.adaptris.core.stubs.MockMessageListener)2 ComboPooledDataSource (com.mchange.v2.c3p0.ComboPooledDataSource)2