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());
}
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;
}
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);
}
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;
}
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;
}
Aggregations