use of com.adaptris.util.KeyValuePairSet in project interlok by adaptris.
the class VerifyIdentityServiceTest method testMetadataVerification.
@Test
public void testMetadataVerification() throws Exception {
AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage();
msg.addMetadata(USER, "user");
msg.addMetadata(PASSWORD, "password");
msg.addMetadata("dbUser", "user");
msg.addMetadata("dbPassword", "password");
MetadataIdentityVerifier verifier = new MetadataIdentityVerifier(new KeyValuePairSet(Arrays.asList(new KeyValuePair[] { new KeyValuePair(USER, "dbUser"), new KeyValuePair(PASSWORD, "dbPassword") })));
MetadataIdentityBuilder builder = new MetadataIdentityBuilder(MetadataSource.Standard, new ArrayList<String>(Arrays.asList(USER, PASSWORD)));
VerifyIdentityService service = new VerifyIdentityService(builder, verifier);
execute(service, msg);
}
use of com.adaptris.util.KeyValuePairSet in project interlok by adaptris.
the class XpathCacheValueTranslatorTest method createTranslator.
private XpathCacheValueTranslator createTranslator() {
XpathCacheValueTranslator translator = new XpathCacheValueTranslator();
KeyValuePairSet set = new KeyValuePairSet();
set.add(new KeyValuePair("test", "uri:test"));
translator.setNamespaceContext(set);
translator.setXpath("/test:root/test:element[@id='one']");
return translator;
}
use of com.adaptris.util.KeyValuePairSet in project interlok by adaptris.
the class JdbcServiceExample method applyDefaultConfig.
public static DatabaseConnection applyDefaultConfig(DatabaseConnection connection) {
connection.setConnectionAttempts(2);
connection.setUsername("my_db_username");
connection.setPassword("plain or encoded password");
connection.setConnectionRetryInterval(new TimeInterval(3L, "SECONDS"));
KeyValuePairSet connectionProps = new KeyValuePairSet();
connectionProps.add(new KeyValuePair("dontTrackOpenResources", "true"));
connectionProps.add(new KeyValuePair("autoReconnect", "true"));
connection.setConnectionProperties(connectionProps);
return connection;
}
use of com.adaptris.util.KeyValuePairSet 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.KeyValuePairSet 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());
}
Aggregations