use of com.adaptris.util.KeyValuePair 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.KeyValuePair 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;
}
use of com.adaptris.util.KeyValuePair in project interlok by adaptris.
the class JmsAsyncProducerTest method createArtemisConnection.
protected JmsConnection createArtemisConnection() {
StandardJndiImplementation jndiImplementation = new StandardJndiImplementation();
jndiImplementation.setJndiName("ConnectionFactory");
jndiImplementation.getJndiParams().addKeyValuePair(new KeyValuePair("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory"));
jndiImplementation.getJndiParams().addKeyValuePair(new KeyValuePair("java.naming.provider.url", "tcp://localhost:61616?type=CF"));
return new JmsConnection(jndiImplementation);
}
use of com.adaptris.util.KeyValuePair in project interlok by adaptris.
the class JndiExtraConfigPtpProducerTest method createJndiVendorImpExample.
static JmsConnection createJndiVendorImpExample(StandardJndiImplementation jndi, JmsConnection c) {
JndiPtpProducerTest.createJndiVendorImpExample(jndi, c);
SimpleFactoryConfiguration sfc = new SimpleFactoryConfiguration();
KeyValuePairSet jndiExtras = sfc.getProperties();
jndiExtras.add(new KeyValuePair("ConnectID", "MyConnectId"));
jndiExtras.add(new KeyValuePair("PingInterval", "10"));
jndi.setExtraFactoryConfiguration(sfc);
return c;
}
use of com.adaptris.util.KeyValuePair in project interlok by adaptris.
the class JdbcQueryServiceCase method buildExamples.
@Override
protected List<JdbcService> buildExamples() {
ArrayList<JdbcService> objects = new ArrayList<>();
JdbcDataQueryService service = new JdbcDataQueryService();
try {
JdbcConnection connection = new JdbcConnection("jdbc:mysql://localhost:3306/mydatabase", "com.mysql.jdbc.Driver");
KeyValuePairSet connectionProperties = new KeyValuePairSet();
connectionProperties.add(new KeyValuePair("useCompression", "true"));
connection.setConnectionProperties(connectionProperties);
connection.setConnectionAttempts(2);
connection.setConnectionRetryInterval(new TimeInterval(3L, "SECONDS"));
service.setConnection(connection);
service.setResultSetTranslator(configureForExample(createTranslatorForConfig()));
String additionalParams = "";
boolean first = true;
for (QueryClasses qc : QueryClasses.values()) {
service.addStatementParameter(qc.create());
if (first) {
additionalParams += qc.name() + "=?";
first = false;
} else {
additionalParams += " AND " + qc.name() + "=?";
}
}
service.setStatementCreator(new ConfiguredSQLStatement("SELECT StringColumn1, DateColumn2, IntegerColumn3, BlobColumn, ClobColumn FROM tablename WHERE " + additionalParams));
} catch (Exception e) {
throw new RuntimeException(e);
}
objects.add(service);
return objects;
}
Aggregations