Search in sources :

Example 91 with KeyValuePair

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;
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair) KeyValuePairSet(com.adaptris.util.KeyValuePairSet)

Example 92 with KeyValuePair

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;
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair) KeyValuePairSet(com.adaptris.util.KeyValuePairSet)

Example 93 with KeyValuePair

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);
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair) StandardJndiImplementation(com.adaptris.core.jms.jndi.StandardJndiImplementation)

Example 94 with KeyValuePair

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;
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair) SimpleFactoryConfiguration(com.adaptris.core.jms.jndi.SimpleFactoryConfiguration) KeyValuePairSet(com.adaptris.util.KeyValuePairSet)

Example 95 with KeyValuePair

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;
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair) TimeInterval(com.adaptris.util.TimeInterval) ArrayList(java.util.ArrayList) JdbcConnection(com.adaptris.core.jdbc.JdbcConnection) KeyValuePairSet(com.adaptris.util.KeyValuePairSet) ServiceException(com.adaptris.core.ServiceException) SQLException(java.sql.SQLException) CoreException(com.adaptris.core.CoreException) JdbcService(com.adaptris.core.jdbc.JdbcService)

Aggregations

KeyValuePair (com.adaptris.util.KeyValuePair)143 Test (org.junit.Test)79 KeyValuePairSet (com.adaptris.util.KeyValuePairSet)55 AdaptrisMessage (com.adaptris.core.AdaptrisMessage)26 KeyValuePairList (com.adaptris.util.KeyValuePairList)12 StandardJndiImplementation (com.adaptris.core.jms.jndi.StandardJndiImplementation)11 StandaloneProducer (com.adaptris.core.StandaloneProducer)10 Channel (com.adaptris.core.Channel)9 MockMessageProducer (com.adaptris.core.stubs.MockMessageProducer)9 TimeInterval (com.adaptris.util.TimeInterval)9 ServiceException (com.adaptris.core.ServiceException)7 JmsConnection (com.adaptris.core.jms.JmsConnection)6 ArrayList (java.util.ArrayList)6 CoreException (com.adaptris.core.CoreException)5 StandardWorkflow (com.adaptris.core.StandardWorkflow)5 PasProducer (com.adaptris.core.jms.PasProducer)5 MetadataCollection (com.adaptris.core.MetadataCollection)4 MetadataElement (com.adaptris.core.MetadataElement)4 StandaloneConsumer (com.adaptris.core.StandaloneConsumer)4 StandaloneRequestor (com.adaptris.core.StandaloneRequestor)3