Search in sources :

Example 11 with EndpointConfiguration

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

the class BrowseComponentConfigurationAndDocumentationTest method testComponentConfiguration.

@Test
public void testComponentConfiguration() throws Exception {
    BrowseComponent comp = context.getComponent("browse", BrowseComponent.class);
    EndpointConfiguration conf = comp.createConfiguration("browse:seda:foo?synchronous=true");
    assertEquals("true", conf.getParameter("synchronous"));
    ComponentConfiguration compConf = comp.createComponentConfiguration();
    String json = compConf.createParameterJsonSchema();
    assertNotNull(json);
    assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"displayName\": \"Name\", \"group\": \"common\", \"required\": true, \"type\": \"string\""));
    assertTrue(json.contains("\"synchronous\": { \"kind\": \"parameter\", \"displayName\": \"Synchronous\", \"group\": \"advanced\", \"label\": \"advanced\", \"type\": \"boolean\""));
}
Also used : ComponentConfiguration(org.apache.camel.ComponentConfiguration) BrowseComponent(org.apache.camel.component.browse.BrowseComponent) EndpointConfiguration(org.apache.camel.EndpointConfiguration) Test(org.junit.Test)

Example 12 with EndpointConfiguration

use of org.apache.camel.EndpointConfiguration 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 13 with EndpointConfiguration

use of org.apache.camel.EndpointConfiguration 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 14 with EndpointConfiguration

use of org.apache.camel.EndpointConfiguration 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 15 with EndpointConfiguration

use of org.apache.camel.EndpointConfiguration 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)

Aggregations

EndpointConfiguration (org.apache.camel.EndpointConfiguration)27 Test (org.junit.Test)26 ComponentConfiguration (org.apache.camel.ComponentConfiguration)16 Component (org.apache.camel.Component)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 FileComponent (org.apache.camel.component.file.FileComponent)1 FtpComponent (org.apache.camel.component.file.remote.FtpComponent)1 LanguageComponent (org.apache.camel.component.language.LanguageComponent)1 LogComponent (org.apache.camel.component.log.LogComponent)1 MockComponent (org.apache.camel.component.mock.MockComponent)1 SedaComponent (org.apache.camel.component.seda.SedaComponent)1 TestComponent (org.apache.camel.component.test.TestComponent)1 TimerComponent (org.apache.camel.component.timer.TimerComponent)1 XsltComponent (org.apache.camel.component.xslt.XsltComponent)1