Search in sources :

Example 16 with ComponentConfiguration

use of org.apache.camel.ComponentConfiguration in project camel by apache.

the class ControlBusComponentConfigurationAndDocumentationTest method testComponentConfiguration.

@Test
public void testComponentConfiguration() throws Exception {
    ControlBusComponent comp = context.getComponent("controlbus", ControlBusComponent.class);
    EndpointConfiguration conf = comp.createConfiguration("controlbus:route?routeId=bar&action=stop");
    assertEquals("bar", conf.getParameter("routeId"));
    assertEquals("stop", conf.getParameter("action"));
    ComponentConfiguration compConf = comp.createComponentConfiguration();
    String json = compConf.createParameterJsonSchema();
    assertNotNull(json);
    assertTrue(json.contains("\"action\": { \"kind\": \"parameter\", \"displayName\": \"Action\", \"group\": \"producer\", \"type\": \"string\""));
    assertTrue(json.contains("\"async\": { \"kind\": \"parameter\", \"displayName\": \"Async\", \"group\": \"producer\", \"type\": \"boolean\""));
}
Also used : ComponentConfiguration(org.apache.camel.ComponentConfiguration) EndpointConfiguration(org.apache.camel.EndpointConfiguration) ControlBusComponent(org.apache.camel.component.controlbus.ControlBusComponent) Test(org.junit.Test)

Example 17 with ComponentConfiguration

use of org.apache.camel.ComponentConfiguration in project camel by apache.

the class DataSetComponentConfigurationAndDocumentationTest method testComponentConfiguration.

@Test
public void testComponentConfiguration() throws Exception {
    DataSetComponent comp = context.getComponent("dataset", DataSetComponent.class);
    EndpointConfiguration conf = comp.createConfiguration("dataset:foo?minRate=3&produceDelay=33&consumeDelay=333&preloadSize=3333&initialDelay=33333&disableDataSetIndex=true");
    assertEquals("Unexpected endpoint configuration value for minRate", "3", conf.getParameter("minRate"));
    assertEquals("Unexpected endpoint configuration value for produceDelay", "33", conf.getParameter("produceDelay"));
    assertEquals("Unexpected endpoint configuration value for consumeDelay", "333", conf.getParameter("consumeDelay"));
    assertEquals("Unexpected endpoint configuration value for preloadSize", "3333", conf.getParameter("preloadSize"));
    assertEquals("Unexpected endpoint configuration value for initialDelay", "33333", conf.getParameter("initialDelay"));
    assertEquals("Unexpected endpoint configuration value for disableDataSetIndex", "true", conf.getParameter("disableDataSetIndex"));
    ComponentConfiguration compConf = comp.createComponentConfiguration();
    String json = compConf.createParameterJsonSchema();
    assertNotNull(json);
    assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"displayName\": \"Name\", \"group\": \"common\", \"required\": true, \"type\""));
    assertTrue(json.contains("\"retainFirst\": { \"kind\": \"parameter\", \"displayName\": \"Retain First\", \"group\": \"producer\", \"label\": \"producer\", \"type\": \"integer"));
}
Also used : ComponentConfiguration(org.apache.camel.ComponentConfiguration) DataSetComponent(org.apache.camel.component.dataset.DataSetComponent) EndpointConfiguration(org.apache.camel.EndpointConfiguration) Test(org.junit.Test)

Example 18 with ComponentConfiguration

use of org.apache.camel.ComponentConfiguration in project camel by apache.

the class XsltComponentConfigurationAndDocumentationTest method testComponentConfiguration.

@Test
public void testComponentConfiguration() throws Exception {
    XsltComponent comp = context.getComponent("xslt", XsltComponent.class);
    EndpointConfiguration conf = comp.createConfiguration("xslt:foo?deleteOutputFile=true");
    assertEquals("true", conf.getParameter("deleteOutputFile"));
    ComponentConfiguration compConf = comp.createComponentConfiguration();
    String json = compConf.createParameterJsonSchema();
    assertNotNull(json);
    assertTrue(json.contains("\"resourceUri\": { \"kind\": \"path\", \"displayName\": \"Resource Uri\", \"group\": \"producer\", \"required\": true"));
    assertTrue(json.contains("\"allowStAX\": { \"kind\": \"parameter\", \"displayName\": \"Allow StAX\", \"group\": \"producer\", \"type\": \"boolean\""));
    assertTrue(json.contains("\"transformerFactoryClass\": { \"kind\": \"parameter\", \"displayName\": \"Transformer Factory Class\", \"group\": \"advanced\", \"label\": \"advanced\""));
}
Also used : ComponentConfiguration(org.apache.camel.ComponentConfiguration) XsltComponent(org.apache.camel.component.xslt.XsltComponent) EndpointConfiguration(org.apache.camel.EndpointConfiguration) Test(org.junit.Test)

Example 19 with ComponentConfiguration

use of org.apache.camel.ComponentConfiguration in project camel by apache.

the class FileComponentConfigurationAndDocumentationTest method testComponentConfiguration.

@Test
public void testComponentConfiguration() throws Exception {
    FileComponent comp = context.getComponent("file", FileComponent.class);
    EndpointConfiguration conf = comp.createConfiguration("file:target/foo?delete=true");
    assertEquals("true", conf.getParameter("delete"));
    ComponentConfiguration compConf = comp.createComponentConfiguration();
    String json = compConf.createParameterJsonSchema();
    assertNotNull(json);
    assertTrue(json.contains("\"directoryName\": { \"kind\": \"path\", \"displayName\": \"Directory Name\", \"group\": \"common\", \"required\": true"));
    assertTrue(json.contains("\"autoCreate\": { \"kind\": \"parameter\", \"displayName\": \"Auto Create\", \"group\": \"advanced\", \"label\": \"advanced\", \"type\": \"boolean\""));
    assertTrue(json.contains("\"readLockMinAge\": { \"kind\": \"parameter\", \"displayName\": \"Read Lock Min Age\", \"group\": \"lock\", \"label\": \"consumer,lock\""));
}
Also used : ComponentConfiguration(org.apache.camel.ComponentConfiguration) FileComponent(org.apache.camel.component.file.FileComponent) EndpointConfiguration(org.apache.camel.EndpointConfiguration) Test(org.junit.Test)

Example 20 with ComponentConfiguration

use of org.apache.camel.ComponentConfiguration in project camel by apache.

the class FtpComponentConfigurationAndDocumentationTest method testComponentConfiguration.

@Test
public void testComponentConfiguration() throws Exception {
    FtpComponent comp = context.getComponent("ftp", FtpComponent.class);
    EndpointConfiguration conf = comp.createConfiguration("ftp://myhost?username=foo&password=secret&soTimeout=1234");
    assertEquals("foo", conf.getParameter("username"));
    assertEquals("secret", conf.getParameter("password"));
    assertEquals("1234", conf.getParameter("soTimeout"));
    ComponentConfiguration compConf = comp.createComponentConfiguration();
    String json = compConf.createParameterJsonSchema();
    assertNotNull(json);
    assertTrue(json.contains("\"minDepth\": { \"kind\": \"parameter\", \"displayName\": \"Min Depth\", \"group\": \"filter\", \"label\": \"consumer,filter\", \"type\": \"integer\", \"javaType\": \"int\""));
    assertTrue(json.contains("\"username\": { \"kind\": \"parameter\", \"displayName\": \"Username\", \"group\": \"security\", \"label\": \"security\", \"type\": \"string\""));
}
Also used : ComponentConfiguration(org.apache.camel.ComponentConfiguration) EndpointConfiguration(org.apache.camel.EndpointConfiguration) FtpComponent(org.apache.camel.component.file.remote.FtpComponent) Test(org.junit.Test)

Aggregations

ComponentConfiguration (org.apache.camel.ComponentConfiguration)31 Test (org.junit.Test)29 EndpointConfiguration (org.apache.camel.EndpointConfiguration)16 Component (org.apache.camel.Component)14 SedaComponent (org.apache.camel.component.seda.SedaComponent)11 InvalidPropertyException (org.apache.camel.InvalidPropertyException)4 Map (java.util.Map)2 SortedMap (java.util.SortedMap)2 MSPTest (org.apache.camel.component.salesforce.dto.generated.MSPTest)2 SedaEndpoint (org.apache.camel.component.seda.SedaEndpoint)2 ParameterConfiguration (org.apache.camel.impl.ParameterConfiguration)2 ArrayList (java.util.ArrayList)1 ResolveEndpointFailedException (org.apache.camel.ResolveEndpointFailedException)1 BeanComponent (org.apache.camel.component.bean.BeanComponent)1 BrowseComponent (org.apache.camel.component.browse.BrowseComponent)1 ControlBusComponent (org.apache.camel.component.controlbus.ControlBusComponent)1 DataFormatComponent (org.apache.camel.component.dataformat.DataFormatComponent)1 DataSetComponent (org.apache.camel.component.dataset.DataSetComponent)1 DirectComponent (org.apache.camel.component.direct.DirectComponent)1 DirectVmComponent (org.apache.camel.component.directvm.DirectVmComponent)1