felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r1204549 - in /felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test: bnd.bnd recipes/resolver.b022.bnd recipes/resolver.b023.bnd recipes/resolver.b024.bnd src/org/apache/felix/framework/test/TestResolver.java
Date Mon, 21 Nov 2011 15:44:37 GMT
Author: rickhall
Date: Mon Nov 21 15:44:37 2011
New Revision: 1204549

URL: http://svn.apache.org/viewvc?rev=1204549&view=rev
Log:
Add test case for cyclic failure issue from FELIX-3178.

Added:
    felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/recipes/resolver.b022.bnd
    felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/recipes/resolver.b023.bnd
    felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/recipes/resolver.b024.bnd
Modified:
    felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/bnd.bnd
    felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/src/org/apache/felix/framework/test/TestResolver.java

Modified: felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/bnd.bnd
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/bnd.bnd?rev=1204549&r1=1204548&r2=1204549&view=diff
==============================================================================
--- felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/bnd.bnd (original)
+++ felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/bnd.bnd Mon Nov 21 15:44:37
2011
@@ -11,7 +11,8 @@ Include-Resource: \
  resolver.b009.jar, resolver.b010.jar, resolver.b011.jar, resolver.b012.jar, \
  resolver.b013.jar, resolver.b014.jar, resolver.b015.jar, resolver.b016a.jar, \
  resolver.b016b.jar, resolver.b017.jar, resolver.b018.jar, resolver.b019.jar, \
- resolver.b020.jar, resolver.b021.jar, \
+ resolver.b020.jar, resolver.b021.jar, resolver.b022.jar, resolver.b023.jar, \
+ resolver.b024.jar, \
  fragment.b001.jar, fragment.b002.jar, fragment.b003.jar, \
  fragment.b004.jar, fragment.b005.jar, \
  fragment.b006.jar, fragment.b007.jar, fragment.b008.jar, \

Added: felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/recipes/resolver.b022.bnd
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/recipes/resolver.b022.bnd?rev=1204549&view=auto
==============================================================================
--- felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/recipes/resolver.b022.bnd
(added)
+++ felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/recipes/resolver.b022.bnd
Mon Nov 21 15:44:37 2011
@@ -0,0 +1,5 @@
+Bundle-SymbolicName: org.apache.felix.framework.test.resolver.b022
+Fragment-Host: does.not.exist
+Import-Package: foo
+Export-Package: bar;-noimport:=true
+Include-Resource: bar/resource.txt; literal="BAR"

Added: felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/recipes/resolver.b023.bnd
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/recipes/resolver.b023.bnd?rev=1204549&view=auto
==============================================================================
--- felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/recipes/resolver.b023.bnd
(added)
+++ felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/recipes/resolver.b023.bnd
Mon Nov 21 15:44:37 2011
@@ -0,0 +1,4 @@
+Bundle-SymbolicName: org.apache.felix.framework.test.resolver.b023
+Import-Package: bar
+Export-Package: foo;-noimport:=true
+Include-Resource: foo/resource.txt; literal="FOO"

Added: felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/recipes/resolver.b024.bnd
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/recipes/resolver.b024.bnd?rev=1204549&view=auto
==============================================================================
--- felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/recipes/resolver.b024.bnd
(added)
+++ felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/recipes/resolver.b024.bnd
Mon Nov 21 15:44:37 2011
@@ -0,0 +1,3 @@
+Bundle-SymbolicName: org.apache.felix.framework.test.resolver.b024
+Export-Package: bar;-noimport:=true
+Include-Resource: bar/resource.txt; literal="BAR"

Modified: felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/src/org/apache/felix/framework/test/TestResolver.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/src/org/apache/felix/framework/test/TestResolver.java?rev=1204549&r1=1204548&r2=1204549&view=diff
==============================================================================
--- felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/src/org/apache/felix/framework/test/TestResolver.java
(original)
+++ felix/sandbox/rickhall/bnd-test/org.apache.felix.framework.test/src/org/apache/felix/framework/test/TestResolver.java
Mon Nov 21 15:44:37 2011
@@ -489,4 +489,40 @@ public class TestResolver extends FelixT
             cleanupBundles();
         }
     }
+
+    public void testFragmentFailure() throws Exception
+    {
+        InputStream is = null;
+
+        // Scenario 1
+        //
+        // Bundle 22 is a fragment for a non-existent host. It imports a package
+        // from a bundle that in turn imports a package from the fragment, which
+        // is also has another provider. See FELIX-3178.
+        try
+        {
+            is = this.getClass().getClassLoader().getResourceAsStream("resolver.b022.jar");
+            addBundle("A", getBundleContext().installBundle("resolver.b022.jar", is));
+            is = this.getClass().getClassLoader().getResourceAsStream("resolver.b023.jar");
+            addBundle("B", getBundleContext().installBundle("resolver.b023.jar", is));
+            is = this.getClass().getClassLoader().getResourceAsStream("resolver.b024.jar");
+            addBundle("C", getBundleContext().installBundle("resolver.b024.jar", is));
+
+            assertFalse("Bundle should not resolve",
+                getPackageAdmin().resolveBundles(new Bundle[] { getBundle("A") }));
+
+            assertEquals("Bundle state should be installed.",
+                Bundle.INSTALLED, getBundle("A").getState());
+
+            assertEquals("Bundle state should be installed.",
+                Bundle.INSTALLED, getBundle("B").getState());
+
+            assertEquals("Bundle state should be installed.",
+                Bundle.INSTALLED, getBundle("C").getState());
+        }
+        finally
+        {
+            cleanupBundles();
+        }
+    }
 }
\ No newline at end of file



Mime
View raw message