Search in sources :

Example 6 with DefaultCamelCatalog

use of org.apache.camel.catalog.DefaultCamelCatalog in project camel by apache.

the class CamelCatalogLuceneTest method createCamelCatalog.

@Before
public void createCamelCatalog() {
    catalog = new DefaultCamelCatalog();
    catalog.setSuggestionStrategy(new LuceneSuggestionStrategy());
}
Also used : DefaultCamelCatalog(org.apache.camel.catalog.DefaultCamelCatalog) Before(org.junit.Before)

Example 7 with DefaultCamelCatalog

use of org.apache.camel.catalog.DefaultCamelCatalog in project camel by apache.

the class MavenArtifactProviderTest method testAddConnector.

@Test
public void testAddConnector() {
    CamelCatalog camelCatalog = new DefaultCamelCatalog();
    CamelConnectorCatalog camelConnectorCatalog = new DefaultCamelConnectorCatalog();
    MavenArtifactProvider provider = new DefaultMavenArtifactProvider();
    provider.setCacheDirectory("target/cache");
    int before = camelCatalog.findComponentNames().size();
    List<ConnectorDto> list = camelConnectorCatalog.findConnector("foo", false);
    assertEquals(0, list.size());
    Set<String> names = provider.addArtifactToCatalog(camelCatalog, camelConnectorCatalog, "org.apache.camel", "myfoo-connector", camelCatalog.getCatalogVersion());
    assertTrue(names.contains("MyFoo"));
    int after = camelCatalog.findComponentNames().size();
    assertTrue("Should find 1 new component", after - before == 1);
    list = camelConnectorCatalog.findConnector("foo", false);
    assertEquals(1, list.size());
    assertEquals("MyFoo", list.get(0).getName());
    assertTrue(camelCatalog.findComponentNames().contains("my-foo"));
}
Also used : DefaultCamelConnectorCatalog(org.apache.camel.catalog.connector.DefaultCamelConnectorCatalog) CamelCatalog(org.apache.camel.catalog.CamelCatalog) DefaultCamelCatalog(org.apache.camel.catalog.DefaultCamelCatalog) CamelConnectorCatalog(org.apache.camel.catalog.connector.CamelConnectorCatalog) DefaultCamelConnectorCatalog(org.apache.camel.catalog.connector.DefaultCamelConnectorCatalog) ConnectorDto(org.apache.camel.catalog.connector.ConnectorDto) DefaultCamelCatalog(org.apache.camel.catalog.DefaultCamelCatalog) Test(org.junit.Test)

Example 8 with DefaultCamelCatalog

use of org.apache.camel.catalog.DefaultCamelCatalog in project camel by apache.

the class SpringBootRuntimeProviderTest method createCamelCatalog.

@BeforeClass
public static void createCamelCatalog() {
    catalog = new DefaultCamelCatalog();
    catalog.setRuntimeProvider(new SpringBootRuntimeProvider());
}
Also used : DefaultCamelCatalog(org.apache.camel.catalog.DefaultCamelCatalog) BeforeClass(org.junit.BeforeClass)

Example 9 with DefaultCamelCatalog

use of org.apache.camel.catalog.DefaultCamelCatalog in project camel by apache.

the class MavenVersionManagerTest method testRuntimeProviderLoadVersion.

@Test
public void testRuntimeProviderLoadVersion() throws Exception {
    CamelCatalog catalog = new DefaultCamelCatalog(false);
    catalog.setVersionManager(new MavenVersionManager());
    catalog.setRuntimeProvider(new SpringBootRuntimeProvider());
    String version = "2.18.2";
    boolean loaded = catalog.loadVersion(version);
    assertTrue(loaded);
    loaded = catalog.loadRuntimeProviderVersion(catalog.getRuntimeProvider().getProviderGroupId(), catalog.getRuntimeProvider().getProviderArtifactId(), version);
    assertTrue(loaded);
    assertEquals(version, catalog.getLoadedVersion());
    assertEquals(version, catalog.getRuntimeProviderLoadedVersion());
    List<String> names = catalog.findComponentNames();
    assertTrue(names.contains("file"));
    assertTrue(names.contains("ftp"));
    assertTrue(names.contains("jms"));
    // camel-ejb does not work in spring-boot
    assertFalse(names.contains("ejb"));
    // camel-pac-logging does not work in spring-boot
    assertFalse(names.contains("paxlogging"));
}
Also used : CamelCatalog(org.apache.camel.catalog.CamelCatalog) DefaultCamelCatalog(org.apache.camel.catalog.DefaultCamelCatalog) SpringBootRuntimeProvider(org.apache.camel.catalog.springboot.SpringBootRuntimeProvider) DefaultCamelCatalog(org.apache.camel.catalog.DefaultCamelCatalog) Test(org.junit.Test)

Aggregations

DefaultCamelCatalog (org.apache.camel.catalog.DefaultCamelCatalog)9 CamelCatalog (org.apache.camel.catalog.CamelCatalog)6 Test (org.junit.Test)5 BeforeClass (org.junit.BeforeClass)2 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 InputStream (java.io.InputStream)1 ArrayList (java.util.ArrayList)1 LinkedHashSet (java.util.LinkedHashSet)1 List (java.util.List)1 EndpointValidationResult (org.apache.camel.catalog.EndpointValidationResult)1 SimpleValidationResult (org.apache.camel.catalog.SimpleValidationResult)1 CamelConnectorCatalog (org.apache.camel.catalog.connector.CamelConnectorCatalog)1 ConnectorDto (org.apache.camel.catalog.connector.ConnectorDto)1 DefaultCamelConnectorCatalog (org.apache.camel.catalog.connector.DefaultCamelConnectorCatalog)1 LuceneSuggestionStrategy (org.apache.camel.catalog.lucene.LuceneSuggestionStrategy)1 MavenVersionManager (org.apache.camel.catalog.maven.MavenVersionManager)1 SpringBootRuntimeProvider (org.apache.camel.catalog.springboot.SpringBootRuntimeProvider)1 CamelEndpointDetails (org.apache.camel.parser.model.CamelEndpointDetails)1 CamelSimpleExpressionDetails (org.apache.camel.parser.model.CamelSimpleExpressionDetails)1