felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1546537 - /felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/integration/common/TestBase.java
Date Fri, 29 Nov 2013 11:05:18 GMT
Author: pderop
Date: Fri Nov 29 11:05:18 2013
New Revision: 1546537

URL: http://svn.apache.org/r1546537
Log:
FELIX-4334: Added getBundle method, which is needed by "ModifiedBundleDependencyTest" test.

Modified:
    felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/integration/common/TestBase.java

Modified: felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/integration/common/TestBase.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/integration/common/TestBase.java?rev=1546537&r1=1546536&r2=1546537&view=diff
==============================================================================
--- felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/integration/common/TestBase.java
(original)
+++ felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/integration/common/TestBase.java
Fri Nov 29 11:05:18 2013
@@ -198,8 +198,6 @@ public abstract class TestBase implement
      * 
      * @param symbolicName
      *            the symbolic name of the bundle to be stopped.
-     * @param context
-     *            the context used to lookup all installed bundles.
      */
     protected void stopBundle(String symbolicName) {
         // Stop the test.annotation bundle
@@ -220,6 +218,21 @@ public abstract class TestBase implement
     }
 
     /**
+     * Helper method used to get a given bundle.
+     * 
+     * @param symbolicName
+     *            the symbolic name of the bundle to get.
+     */
+    protected Bundle getBundle(String symbolicName) {
+        for (Bundle b : context.getBundles()) {
+            if (b.getSymbolicName().equals(symbolicName)) {
+                return b;
+            }
+        }
+        throw new IllegalStateException("bundle " + symbolicName + " not found");
+    }
+
+    /**
      * Stops our test bundle.
      */
     protected void stopTestBundle() { 



Mime
View raw message