You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Freeman Fang (JIRA)" <ji...@apache.org> on 2019/06/20 20:10:00 UTC

[jira] [Comment Edited] (CAMEL-13664) OSGi tests broken for both JDK8 and JDK11

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

Freeman Fang edited comment on CAMEL-13664 at 6/20/19 8:09 PM:
---------------------------------------------------------------

OK, the thing is that any blueprint bundle(like drop a blueprint file in karaf deploy folder, a bundle based on this blueprint file will be generated on the fly, with some OSGi headers added automatically) in Karaf will be added "DynamicImport-Package = 
	*", but it's not this case in OSGi test of camel, this is the problem, it can't reflect exactly the same behavior as it should be in real Karaf container.

We should do the change like this
{code}
--- a/components/camel-test-karaf/src/main/java/org/apache/camel/test/karaf/AbstractFeatureTest.java
+++ b/components/camel-test-karaf/src/main/java/org/apache/camel/test/karaf/AbstractFeatureTest.java
@@ -121,7 +121,8 @@ public abstract class AbstractFeatureTest {
         bundle.set("Manifest-Version", "2")
                 .set("Bundle-ManifestVersion", "2")
                 .set("Bundle-SymbolicName", name)
-                .set("Bundle-Version", "1.0.0");
+                .set("Bundle-Version", "1.0.0")
+                .set("DynamicImport-Package", "*");
{code}

in installBlueprintAsBundle method


was (Author: ffang):
OK, the thing is that any blueprint bundle(like drop a blueprint file in karaf deploy folder, a bundle based on this blueprint file will be generated on the fly, with some OSGi headers added automatically) in Karaf will be added "DynamicImport-Package = 
	*", but it's not this case in OSGi test of camel, this is the problem, it can't reflect exactly the same behavior as it should be in real Karaf container.

We should do the change like this
{code}
--- a/components/camel-test-karaf/src/main/java/org/apache/camel/test/karaf/AbstractFeatureTest.java
+++ b/components/camel-test-karaf/src/main/java/org/apache/camel/test/karaf/AbstractFeatureTest.java
@@ -121,7 +121,8 @@ public abstract class AbstractFeatureTest {
         bundle.set("Manifest-Version", "2")
                 .set("Bundle-ManifestVersion", "2")
                 .set("Bundle-SymbolicName", name)
-                .set("Bundle-Version", "1.0.0");
+                .set("Bundle-Version", "1.0.0")
+                .set("DynamicImport-Package", "*");
{code}

> OSGi tests broken for both JDK8 and JDK11
> -----------------------------------------
>
>                 Key: CAMEL-13664
>                 URL: https://issues.apache.org/jira/browse/CAMEL-13664
>             Project: Camel
>          Issue Type: Test
>          Components: osgi
>            Reporter: Freeman Fang
>            Assignee: Freeman Fang
>            Priority: Major
>             Fix For: 3.0.0, 3.0.0.M4
>
>
> [ERROR] Errors: 
> [ERROR]   CamelGroovyTest.testCamelGroovy:48 » WrappedTestContainer [testCamelGroovy(org...
> [ERROR]   CamelJacksonFallbackConverterTest.test:56 » NoTypeConversionAvailable No type ...



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)