Search in sources :

Example 86 with KeyValuePair

use of com.adaptris.util.KeyValuePair in project interlok by adaptris.

the class AdapterStateSummaryTest method testToString.

@Test
public void testToString() {
    AdapterStateSummary s1 = new AdapterStateSummary();
    s1.addChannelState(new KeyValuePair(DEFAULT_KEY, ClosedState.getInstance().getClass().getName()));
    assertNotNull(s1.toString());
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair) Test(org.junit.Test)

Example 87 with KeyValuePair

use of com.adaptris.util.KeyValuePair in project interlok by adaptris.

the class JdbcMapInsert method buildStatementParam.

protected StatementParam buildStatementParam(String key, final String value) {
    KeyValuePair kp = fieldMappings().getKeyValuePair(key);
    StatementParam result = (i, p) -> {
        p.setString(i, value);
    };
    if (kp != null) {
        result = basicWrapper(kp, value);
        if (result == null) {
            result = reflectConversion(kp.getValue(), value);
        }
    }
    return result;
}
Also used : ServiceException(com.adaptris.core.ServiceException) Connection(java.sql.Connection) NotBlank(javax.validation.constraints.NotBlank) KeyValuePair(com.adaptris.util.KeyValuePair) InputFieldDefault(com.adaptris.annotation.InputFieldDefault) AdaptrisMessage(com.adaptris.core.AdaptrisMessage) JdbcUtil(com.adaptris.core.util.JdbcUtil) BooleanUtils(org.apache.commons.lang3.BooleanUtils) ArrayList(java.util.ArrayList) CharUtils(org.apache.commons.lang3.CharUtils) Valid(javax.validation.Valid) SQLException(java.sql.SQLException) ExceptionHelper(com.adaptris.core.util.ExceptionHelper) Map(java.util.Map) KeyValuePairSet(com.adaptris.util.KeyValuePairSet) StringUtils.defaultIfEmpty(org.apache.commons.lang3.StringUtils.defaultIfEmpty) Iterator(java.util.Iterator) PreparedStatement(java.sql.PreparedStatement) AdvancedConfig(com.adaptris.annotation.AdvancedConfig) InputFieldHint(com.adaptris.annotation.InputFieldHint) CoreException(com.adaptris.core.CoreException) JdbcService(com.adaptris.core.jdbc.JdbcService) Args(com.adaptris.core.util.Args) List(java.util.List) StringUtils.isBlank(org.apache.commons.lang3.StringUtils.isBlank) KeyValuePair(com.adaptris.util.KeyValuePair)

Example 88 with KeyValuePair

use of com.adaptris.util.KeyValuePair in project interlok by adaptris.

the class FtpConsumerTest method create.

private FtpConnection create(FakeFtpServer server) {
    FtpConnection consumeConnection = new FtpConnection();
    consumeConnection.setDefaultControlPort(server.getServerControlPort());
    consumeConnection.setDefaultPassword(DEFAULT_PASSWORD);
    consumeConnection.setDefaultUserName(DEFAULT_USERNAME);
    consumeConnection.setCacheConnection(true);
    consumeConnection.setAdditionalDebug(true);
    KeyValuePairSet settings = new KeyValuePairSet();
    settings.add(new KeyValuePair(ClientSettings.FTP.RemoteVerificationEnabled.name(), "false"));
    consumeConnection.setAdditionalSettings(settings);
    return consumeConnection;
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair) KeyValuePairSet(com.adaptris.util.KeyValuePairSet)

Example 89 with KeyValuePair

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

Example 90 with KeyValuePair

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

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