[ 
https://issues.apache.org/jira/browse/CAMEL-6132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15880903#comment-15880903
 ] 

A. Soroka commented on CAMEL-6132:
----------------------------------

I would love to help, and I am currently wresting with getting an example up. I 
keep running into errors with JNDI (?!), e.g. as shown below. I have experience 
with Camel and Karaf, but it dates from five or more years ago, and times have 
changed. I am subclassing {{CamelKarafTestSupport}} and I show below the 
stacktrace my current {{@Configuration}} method. Any advice much appreciated, 
and if I can get a working example I will make a point of at least writing a 
tutorial and hopefully sending a PR with whatever improvements I can find. I'm 
just stumped by this JNDI business. I think I must be missing something 
obvious... 

{noformat}
javax.naming.NoInitialContextException: Unable to find the 
InitialContextFactory org.apache.camel.util.jndi.CamelInitialContextFactory.
        at 
org.apache.aries.jndi.ContextHelper.getInitialContext(ContextHelper.java:150)
        at 
org.apache.aries.jndi.OSGiInitialContextFactoryBuilder.getInitialContext(OSGiInitialContextFactoryBuilder.java:51)
        at 
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
        at 
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
        at javax.naming.InitialContext.init(InitialContext.java:244)
        at javax.naming.InitialContext.<init>(InitialContext.java:216)
        at 
org.apache.camel.test.junit4.CamelTestSupport.createJndiContext(CamelTestSupport.java:592)
        at 
org.apache.camel.test.junit4.CamelTestSupport.createRegistry(CamelTestSupport.java:578)
        at 
org.apache.camel.test.junit4.CamelTestSupport.createCamelContext(CamelTestSupport.java:572)
        at 
org.apache.camel.test.junit4.CamelTestSupport.doSetUp(CamelTestSupport.java:278)
        at 
org.apache.camel.test.junit4.CamelTestSupport.setUp(CamelTestSupport.java:246)

{noformat}

{noformat}
    @Configuration
    public Option[] config() {
        MavenUrlReference camelRepo = 
maven().groupId("org.apache.camel.karaf").artifactId("apache-camel")
                        
.classifier("features").type("xml").version(CAMEL_VERSION);
        MavenUrlReference jenaRepo = 
maven().groupId("org.apache.jena").artifactId("jena-osgi-features")
                        .classifier("features").type("xml").version("3.2.0");
        MavenUrlReference enterpriseRepo = 
maven().groupId("org.apache.karaf.features").artifactId("enterprise")
                        .classifier("features").type("xml").version("4.0.7");

        MavenArtifactProvisionOption shim = 
mavenBundle().groupId("edu.si").artifactId("fcrepo3-shim-core")
                        .version("0.0.1-SNAPSHOT").start();
        
        Option[] options = new Option[] { features(enterpriseRepo, "jndi"), 
features(jenaRepo, "jena"),
                features(camelRepo, "camel-test"), shim };
        return ArrayUtils.addAll(configure(), options);
    }
{noformat}

> camel-test-karaf - To allow end users more easily do Camel and Karaf 
> integration test
> -------------------------------------------------------------------------------------
>
>                 Key: CAMEL-6132
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6132
>             Project: Camel
>          Issue Type: New Feature
>          Components: karaf
>            Reporter: Claus Ibsen
>            Assignee: Quinn Stevenson
>             Fix For: 2.19.0
>
>
> We should introduce a proper camel-test-karaf component that *end users* can 
> use to do Camel and Karaf integration tests.
> The code we have in tests/camel-itest-karaf is for internal usage and testing 
> of Camel. The code is not polished and intended for end users.
> We should create a new module for that, and take the good parts of 
> camel-itest-karaf and make it user friendly etc. And of course have docs to 
> go with as well.
> And when its good, we can use that in camel-itest-karaf also (eat our own dog 
> food)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to