use of com.adaptris.util.KeyValuePair in project interlok by adaptris.
the class JdbcMapInsertTest method testService_InvalidConversion.
@Test
public void testService_InvalidConversion() throws Exception {
createDatabase();
KeyValuePairSet mappings = new KeyValuePairSet();
mappings.add(new KeyValuePair("dob", "com.adaptris.does.not.Exist"));
mappings.add(new KeyValuePair("firstname", "java.lang.String"));
// mappings.add(new KeyValuePair("lastname", "Date"));
InsertProperties service = configureForTests(createService());
service.setFieldMappings(mappings);
AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage(CONTENT);
ExampleServiceCase.execute(service, msg);
doAssert(1);
}
use of com.adaptris.util.KeyValuePair in project interlok by adaptris.
the class JdbcQueryServiceCaseXmlResults method testSetNamespaceContext.
@Test
public void testSetNamespaceContext() throws Exception {
JdbcDataQueryService service = new JdbcDataQueryService();
assertNull(service.getNamespaceContext());
KeyValuePairSet kvps = new KeyValuePairSet();
kvps.add(new KeyValuePair("hello", "world"));
service.setNamespaceContext(kvps);
assertEquals(kvps, service.getNamespaceContext());
service.setNamespaceContext(null);
assertNull(service.getNamespaceContext());
}
use of com.adaptris.util.KeyValuePair in project interlok by adaptris.
the class CopyMetadataServiceTest method testBug2101_SameSourceKeyMultipleDestinationKeys.
@Test
public void testBug2101_SameSourceKeyMultipleDestinationKeys() throws Exception {
CopyMetadataService service = createService();
service.getMetadataKeys().add(new KeyValuePair(KEY_TO_BE_COPIED, NEW_KEY_2));
service.getMetadataKeys().add(new KeyValuePair(KEY_TO_BE_COPIED, NEW_KEY_3));
service.getMetadataKeys().add(new KeyValuePair(KEY_TO_BE_COPIED, NEW_KEY_4));
AdaptrisMessage msg = createMessage();
execute(service, msg);
assertTrue(msg.getMetadataValue(KEY_TO_BE_COPIED).equals(METADATA_VALUE));
assertTrue(NEW_KEY_1 + " must exist as metadata", msg.containsKey(NEW_KEY_1));
assertTrue(NEW_KEY_2 + " must exist as metadata", msg.containsKey(NEW_KEY_2));
assertTrue(NEW_KEY_3 + " must exist as metadata", msg.containsKey(NEW_KEY_3));
assertTrue(NEW_KEY_4 + " must exist as metadata", msg.containsKey(NEW_KEY_4));
assertEquals(METADATA_VALUE, msg.getMetadataValue(NEW_KEY_1));
assertEquals(METADATA_VALUE, msg.getMetadataValue(NEW_KEY_2));
assertEquals(METADATA_VALUE, msg.getMetadataValue(NEW_KEY_3));
assertEquals(METADATA_VALUE, msg.getMetadataValue(NEW_KEY_4));
}
use of com.adaptris.util.KeyValuePair in project interlok by adaptris.
the class XpathMetadataServiceTest method createContextEntries.
public static KeyValuePairSet createContextEntries() {
KeyValuePairSet contextEntries = new KeyValuePairSet();
contextEntries.add(new KeyValuePair("svrl", "http://purl.oclc.org/dsdl/svrl"));
contextEntries.add(new KeyValuePair("xsd", "http://www.w3.org/2001/XMLSchema"));
contextEntries.add(new KeyValuePair("xs", "http://www.w3.org/2001/XMLSchema"));
contextEntries.add(new KeyValuePair("sch", "http://www.ascc.net/xml/schematron"));
contextEntries.add(new KeyValuePair("iso", "http://purl.oclc.org/dsdl/schematron"));
contextEntries.add(new KeyValuePair("dp", "http://www.dpawson.co.uk/ns#"));
return contextEntries;
}
use of com.adaptris.util.KeyValuePair in project interlok by adaptris.
the class XpathMetadataServiceTest method testSetNamespaceContext.
@Test
public void testSetNamespaceContext() {
XpathMetadataService obj = new XpathMetadataService();
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());
}
Aggregations