Search in sources :

Example 6 with JndiRegistry

use of org.apache.camel.impl.JndiRegistry in project camel by apache.

the class ElSqlComponentTest method createRegistry.

@Override
protected JndiRegistry createRegistry() throws Exception {
    JndiRegistry jndi = super.createRegistry();
    // this is the database we create with some initial data for our unit test
    db = new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.DERBY).addScript("sql/createAndPopulateDatabase.sql").build();
    jndi.bind("dataSource", db);
    return jndi;
}
Also used : JndiRegistry(org.apache.camel.impl.JndiRegistry) EmbeddedDatabaseBuilder(org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder)

Example 7 with JndiRegistry

use of org.apache.camel.impl.JndiRegistry in project camel by apache.

the class ElSqlConsumerTest method createRegistry.

@Override
protected JndiRegistry createRegistry() throws Exception {
    JndiRegistry jndi = super.createRegistry();
    // this is the database we create with some initial data for our unit test
    db = new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.DERBY).addScript("sql/createAndPopulateDatabase.sql").build();
    jndi.bind("dataSource", db);
    return jndi;
}
Also used : JndiRegistry(org.apache.camel.impl.JndiRegistry) EmbeddedDatabaseBuilder(org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder)

Example 8 with JndiRegistry

use of org.apache.camel.impl.JndiRegistry in project camel by apache.

the class FlinkProducerTest method createRegistry.

@Override
protected JndiRegistry createRegistry() throws Exception {
    JndiRegistry registry = super.createRegistry();
    registry.bind("myDataSet", executionEnvironment.readTextFile("src/test/resources/testds.txt"));
    registry.bind("myDataStream", streamExecutionEnvironment.readTextFile("src/test/resources/testds.txt"));
    registry.bind("countLinesContaining", new DataSetCallback() {

        @Override
        public Object onDataSet(DataSet ds, Object... payloads) {
            try {
                return ds.count();
            } catch (Exception e) {
                return null;
            }
        }
    });
    return registry;
}
Also used : JndiRegistry(org.apache.camel.impl.JndiRegistry) AnnotatedDataSetCallback(org.apache.camel.component.flink.annotations.AnnotatedDataSetCallback) DataSet(org.apache.flink.api.java.DataSet) IOException(java.io.IOException)

Example 9 with JndiRegistry

use of org.apache.camel.impl.JndiRegistry in project camel by apache.

the class FileToFtpsExplicitSSLWithoutClientAuthAndSSLContextParametersTest method createRegistry.

@Override
protected JndiRegistry createRegistry() throws Exception {
    KeyStoreParameters ksp = new KeyStoreParameters();
    ksp.setResource("server.jks");
    ksp.setPassword("password");
    TrustManagersParameters tmp = new TrustManagersParameters();
    tmp.setKeyStore(ksp);
    SSLContextParameters sslContextParameters = new SSLContextParameters();
    sslContextParameters.setSecureSocketProtocol("SSL");
    sslContextParameters.setTrustManagers(tmp);
    JndiRegistry registry = super.createRegistry();
    registry.bind("sslContextParameters", sslContextParameters);
    return registry;
}
Also used : JndiRegistry(org.apache.camel.impl.JndiRegistry) TrustManagersParameters(org.apache.camel.util.jsse.TrustManagersParameters) KeyStoreParameters(org.apache.camel.util.jsse.KeyStoreParameters) SSLContextParameters(org.apache.camel.util.jsse.SSLContextParameters)

Example 10 with JndiRegistry

use of org.apache.camel.impl.JndiRegistry in project camel by apache.

the class FromFtpRemoteFileFilterTest method createRegistry.

@Override
protected JndiRegistry createRegistry() throws Exception {
    JndiRegistry jndi = super.createRegistry();
    jndi.bind("myFilter", new MyFileFilter<Object>());
    return jndi;
}
Also used : JndiRegistry(org.apache.camel.impl.JndiRegistry)

Aggregations

JndiRegistry (org.apache.camel.impl.JndiRegistry)608 SSLContextParameters (org.apache.camel.util.jsse.SSLContextParameters)19 HttpUrlRewrite (org.apache.camel.component.urlrewrite.HttpUrlRewrite)18 KeyStoreParameters (org.apache.camel.util.jsse.KeyStoreParameters)17 DeadLetterChannelBuilder (org.apache.camel.builder.DeadLetterChannelBuilder)16 Properties (java.util.Properties)15 Test (org.junit.Test)14 TrustManagersParameters (org.apache.camel.util.jsse.TrustManagersParameters)13 ArrayList (java.util.ArrayList)11 KeyManagersParameters (org.apache.camel.util.jsse.KeyManagersParameters)11 EmbeddedDatabaseBuilder (org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder)11 File (java.io.File)10 RouteBuilder (org.apache.camel.builder.RouteBuilder)8 ExchangeCookieHandler (org.apache.camel.http.common.cookie.ExchangeCookieHandler)8 InstanceCookieHandler (org.apache.camel.http.common.cookie.InstanceCookieHandler)8 CamelContext (org.apache.camel.CamelContext)6 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)6 BookCatalog (org.apache.camel.component.routebox.demo.BookCatalog)5 SimpleRouteBuilder (org.apache.camel.component.routebox.demo.SimpleRouteBuilder)5 DefaultCamelContext (org.apache.camel.impl.DefaultCamelContext)5