use of org.apache.camel.impl.ParameterConfiguration in project camel by apache.
the class SalesforceComponentConfigurationIntegrationTest method testConfiguration.
@Test
public void testConfiguration() throws Exception {
Component component = context().getComponent(componentName);
ComponentConfiguration configuration = component.createComponentConfiguration();
SortedMap<String, ParameterConfiguration> parameterConfigurationMap = configuration.getParameterConfigurationMap();
if (verbose) {
Set<Map.Entry<String, ParameterConfiguration>> entries = parameterConfigurationMap.entrySet();
for (Map.Entry<String, ParameterConfiguration> entry : entries) {
String name = entry.getKey();
ParameterConfiguration config = entry.getValue();
LOG.info("Has name: {} with type {}", name, config.getParameterType().getName());
}
}
assertParameterConfig(configuration, "format", PayloadFormat.class);
assertParameterConfig(configuration, "sObjectName", String.class);
assertParameterConfig(configuration, "sObjectFields", String.class);
assertParameterConfig(configuration, "updateTopic", boolean.class);
configuration.setParameter("format", PayloadFormat.XML);
configuration.setParameter("sObjectName", "Merchandise__c");
configuration.setParameter("sObjectFields", "Description__c,Total_Inventory__c");
configuration.setParameter("updateTopic", false);
// operation name is base uri
configuration.setBaseUri(componentName + ":getSObject");
SalesforceEndpoint endpoint = assertIsInstanceOf(SalesforceEndpoint.class, configuration.createEndpoint());
final SalesforceEndpointConfig endpointConfig = endpoint.getConfiguration();
assertEquals("endpoint.format", PayloadFormat.XML, endpointConfig.getFormat());
assertEquals("endpoint.sObjectName", "Merchandise__c", endpointConfig.getSObjectName());
assertEquals("endpoint.sObjectFields", "Description__c,Total_Inventory__c", endpointConfig.getSObjectFields());
assertEquals("endpoint.updateTopic", false, endpointConfig.isUpdateTopic());
}
use of org.apache.camel.impl.ParameterConfiguration in project camel by apache.
the class SalesforceComponentConfigurationIntegrationTest method assertParameterConfig.
public static void assertParameterConfig(ComponentConfiguration configuration, String name, Class<?> parameterType) {
ParameterConfiguration config = configuration.getParameterConfiguration(name);
assertNotNull("ParameterConfiguration should exist for parameter name " + name, config);
assertEquals("ParameterConfiguration." + name + ".getName()", name, config.getName());
assertEquals("ParameterConfiguration." + name + ".getParameterType()", parameterType, config.getParameterType());
}
use of org.apache.camel.impl.ParameterConfiguration in project camel by apache.
the class JmsComponentConfigurationTest method testConfiguration.
@Test
public void testConfiguration() throws Exception {
Component component = context().getComponent(componentName);
ComponentConfiguration configuration = component.createComponentConfiguration();
SortedMap<String, ParameterConfiguration> parameterConfigurationMap = configuration.getParameterConfigurationMap();
if (verbose) {
Set<Map.Entry<String, ParameterConfiguration>> entries = parameterConfigurationMap.entrySet();
for (Map.Entry<String, ParameterConfiguration> entry : entries) {
String name = entry.getKey();
ParameterConfiguration config = entry.getValue();
LOG.info("Has name: {} with type {}", name, config.getParameterType().getName());
}
}
assertParameterConfig(configuration, "concurrentConsumers", int.class);
assertParameterConfig(configuration, "clientId", String.class);
assertParameterConfig(configuration, "disableReplyTo", boolean.class);
assertParameterConfig(configuration, "timeToLive", long.class);
configuration.setParameter("concurrentConsumers", 10);
configuration.setParameter("clientId", "foo");
configuration.setParameter("disableReplyTo", true);
configuration.setParameter("timeToLive", 1000L);
JmsEndpoint endpoint = assertIsInstanceOf(JmsEndpoint.class, configuration.createEndpoint());
assertEquals("endpoint.concurrentConsumers", 10, endpoint.getConcurrentConsumers());
assertEquals("endpoint.clientId", "foo", endpoint.getClientId());
assertEquals("endpoint.disableReplyTo", true, endpoint.isDisableReplyTo());
assertEquals("endpoint.timeToLive", 1000L, endpoint.getTimeToLive());
}
use of org.apache.camel.impl.ParameterConfiguration in project camel by apache.
the class JmsComponentConfigurationTest method assertParameterConfig.
public static void assertParameterConfig(ComponentConfiguration configuration, String name, Class<?> parameterType) {
ParameterConfiguration config = configuration.getParameterConfiguration(name);
assertNotNull("ParameterConfiguration should exist for parameter name " + name, config);
assertEquals("ParameterConfiguration." + name + ".getName()", name, config.getName());
assertEquals("ParameterConfiguration." + name + ".getParameterType()", parameterType, config.getParameterType());
}
Aggregations