Forum Home » Fuse Distributions » Fuse Mediation Router

Thread: CamelBlueprintTestSupport and org.osgi.vendor.framework property

 

Permlink Replies: 1 - Last Post: Mar 12, 2012 11:48 PM Last Post By: doug.smith@fmr....
doug.smith@fmr....

Posts: 7
Registered: 02/14/12
CamelBlueprintTestSupport and org.osgi.vendor.framework property
Posted: Mar 12, 2012 11:32 PM
  Click to reply to this thread Reply
I am using CamelBlueprintTestSupport to write a unit test for a route, and am getting the following error originating from the test setUp method:

java.lang.NoClassDefFoundError: org.osgi.vendor.framework property not set

This is with camel 2.9.1 and the 2.10-SNAPSHOT version of camel-test-blueprint

Should I simply set this property (and to what) or does this represent a deeper problem?

I am fairly new to OSGi and am trying to figure out how to unit test route components that depend on OSGi services. Stripping down my test to bare scaffolding does not eliminate the problem. Stack trace is below.

Thanks,

--doug

java.lang.NoClassDefFoundError: org.osgi.vendor.framework property not set
at org.osgi.framework.FrameworkUtil$ImplHolder.run(FrameworkUtil.java:69)
at java.security.AccessController.doPrivileged(Native Method)
at org.osgi.framework.FrameworkUtil$ImplHolder.<clinit>(FrameworkUtil.java:59)
at org.osgi.framework.FrameworkUtil.createFilter(FrameworkUtil.java:127)
at de.kalpatec.pojosr.framework.launch.ClasspathScanner.scanForBundles(ClasspathScanner.java:44)
at org.apache.camel.test.blueprint.CamelBlueprintTestSupport.getBundleDescriptors(CamelBlueprintTestSupport.java:113)
at org.apache.camel.test.blueprint.CamelBlueprintTestSupport.setUp(CamelBlueprintTestSupport.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:48)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:199)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

java.lang.NullPointerException
at org.apache.camel.test.blueprint.CamelBlueprintTestSupport.tearDown(CamelBlueprintTestSupport.java:89)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:37)
at org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:48)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:199)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

doug.smith@fmr....

Posts: 7
Registered: 02/14/12
Re: CamelBlueprintTestSupport and org.osgi.vendor.framework property
Posted: Mar 12, 2012 11:48 PM   in response to: doug.smith@fmr.... in response to: doug.smith@fmr....
  Click to reply to this thread Reply
I am going to backtrack and start with the camel-archetype-blueprint project - this generates test scaffolding that works. I will add a note to indicate success or failure.