Search in sources :

Example 1 with EndpointConfiguration

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

the class TimerComponentConfigurationAndDocumentationTest method testComponentConfiguration.

@Test
public void testComponentConfiguration() throws Exception {
    TimerComponent comp = context.getComponent("timer", TimerComponent.class);
    EndpointConfiguration conf = comp.createConfiguration("timer:foo?period=2000");
    assertEquals("2000", conf.getParameter("period"));
    ComponentConfiguration compConf = comp.createComponentConfiguration();
    String json = compConf.createParameterJsonSchema();
    assertNotNull(json);
    assertTrue(json.contains("\"timerName\": { \"kind\": \"path\", \"displayName\": \"Timer Name\", \"group\": \"consumer\", \"required\": true"));
    assertTrue(json.contains("\"delay\": { \"kind\": \"parameter\", \"displayName\": \"Delay\", \"group\": \"consumer\", \"type\": \"integer\""));
    assertTrue(json.contains("\"timer\": { \"kind\": \"parameter\", \"displayName\": \"Timer\", \"group\": \"advanced\", \"label\": \"advanced\""));
}
Also used : ComponentConfiguration(org.apache.camel.ComponentConfiguration) EndpointConfiguration(org.apache.camel.EndpointConfiguration) TimerComponent(org.apache.camel.component.timer.TimerComponent) Test(org.junit.Test)

Example 2 with EndpointConfiguration

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

the class DataFormatComponentConfigurationAndDocumentationTest method testComponentConfiguration.

@Test
public void testComponentConfiguration() throws Exception {
    DataFormatComponent comp = context.getComponent("dataformat", DataFormatComponent.class);
    EndpointConfiguration conf = comp.createConfiguration("dataformaat:marshal:string?charset=iso-8859-1");
    assertEquals("iso-8859-1", conf.getParameter("charset"));
    ComponentConfiguration compConf = comp.createComponentConfiguration();
    String json = compConf.createParameterJsonSchema();
    assertNotNull(json);
    assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"displayName\": \"Name\", \"group\": \"producer\", \"required\": true, \"type\": \"string\", \"javaType\": \"java.lang.String\"," + " \"deprecated\": false, \"secret\": false, \"description\": \"Name of data format\" }"));
    assertTrue(json.contains("\"operation\": { \"kind\": \"path\", \"displayName\": \"Operation\", \"group\": \"producer\", \"required\": true, \"type\": \"string\""));
    assertTrue(json.contains("\"synchronous\": { \"kind\": \"parameter\", \"displayName\": \"Synchronous\", \"group\": \"advanced\", \"label\": \"advanced\", \"type\": \"boolean\""));
}
Also used : DataFormatComponent(org.apache.camel.component.dataformat.DataFormatComponent) ComponentConfiguration(org.apache.camel.ComponentConfiguration) EndpointConfiguration(org.apache.camel.EndpointConfiguration) Test(org.junit.Test)

Example 3 with EndpointConfiguration

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

the class DirectComponentConfigurationAndDocumentationTest method testComponentConfiguration.

@Test
public void testComponentConfiguration() throws Exception {
    DirectComponent comp = context.getComponent("direct", DirectComponent.class);
    EndpointConfiguration conf = comp.createConfiguration("direct:foo?block=true");
    assertEquals("true", conf.getParameter("block"));
    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("\"timeout\": { \"kind\": \"parameter\", \"displayName\": \"Timeout\", \"group\": \"producer\", \"label\": \"producer\", \"type\": \"integer\""));
}
Also used : ComponentConfiguration(org.apache.camel.ComponentConfiguration) EndpointConfiguration(org.apache.camel.EndpointConfiguration) DirectComponent(org.apache.camel.component.direct.DirectComponent) Test(org.junit.Test)

Example 4 with EndpointConfiguration

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

the class DirectVmComponentConfigurationAndDocumentationTest method testComponentConfiguration.

@Test
public void testComponentConfiguration() throws Exception {
    DirectVmComponent comp = context.getComponent("direct-vm", DirectVmComponent.class);
    EndpointConfiguration conf = comp.createConfiguration("direct-vm:foo?block=false");
    assertEquals("false", conf.getParameter("block"));
    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("\"timeout\": { \"kind\": \"parameter\", \"displayName\": \"Timeout\", \"group\": \"producer\", \"label\": \"producer\", \"type\": \"integer\""));
}
Also used : DirectVmComponent(org.apache.camel.component.directvm.DirectVmComponent) ComponentConfiguration(org.apache.camel.ComponentConfiguration) EndpointConfiguration(org.apache.camel.EndpointConfiguration) Test(org.junit.Test)

Example 5 with EndpointConfiguration

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

the class LanguageComponentConfigurationAndDocumentationTest method testComponentConfiguration.

@Test
public void testComponentConfiguration() throws Exception {
    LanguageComponent comp = context.getComponent("language", LanguageComponent.class);
    EndpointConfiguration conf = comp.createConfiguration("language:simple:foo?transform=false");
    assertEquals("false", conf.getParameter("transform"));
    ComponentConfiguration compConf = comp.createComponentConfiguration();
    String json = compConf.createParameterJsonSchema();
    assertNotNull(json);
    assertTrue(json.contains("\"languageName\": { \"kind\": \"path\", \"displayName\": \"Language Name\", \"group\": \"producer\", \"required\": true"));
    assertTrue(json.contains("\"script\": { \"kind\": \"parameter\", \"displayName\": \"Script\", \"group\": \"producer\", \"type\": \"string\""));
}
Also used : ComponentConfiguration(org.apache.camel.ComponentConfiguration) LanguageComponent(org.apache.camel.component.language.LanguageComponent) 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