Author: davsclaus
Date: Wed Feb 22 14:15:08 2012
New Revision: 1292299

URL: http://svn.apache.org/viewvc?rev=1292299&view=rev
Log:
CAMEL-5029: Allow customizing list of bundles for camel-test-blueprint. Thanks 
to Lukasz for the patch.

Modified:
    
camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java

Modified: 
camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java?rev=1292299&r1=1292298&r2=1292299&view=diff
==============================================================================
--- 
camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java
 (original)
+++ 
camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java
 Wed Feb 22 14:15:08 2012
@@ -71,7 +71,7 @@ public abstract class CamelBlueprintTest
 
         // ensure pojosr stores bundles in an unique target directory
         System.setProperty("org.osgi.framework.storage", "target/bundles/" + 
System.currentTimeMillis());
-        List<BundleDescriptor> bundles = new 
ClasspathScanner().scanForBundles("(Bundle-SymbolicName=*)");
+        List<BundleDescriptor> bundles = getBundleDescriptors();
         TinyBundle bundle = createTestBundle();
         bundles.add(getBundleDescriptor("target/test-bundle/test-bundle.jar", 
bundle));
         Map<String, List<BundleDescriptor>> config = new HashMap<String, 
List<BundleDescriptor>>();
@@ -103,6 +103,17 @@ public abstract class CamelBlueprintTest
     }
 
     /**
+     * Gets list of bundle descriptors. Modify this method if you wish to 
change
+     * default behavior.
+     * 
+     * @return List pointers to OSGi bundles.
+     * @throws Exception If looking up the bundles fails.
+     */
+    protected List<BundleDescriptor> getBundleDescriptors() throws Exception {
+        return new 
ClasspathScanner().scanForBundles("(Bundle-SymbolicName=*)");
+    }
+
+    /**
      * Gets the bundle descriptors as {@link URL} resources.
      * <p/>
      * It is preferred to override the {@link #getBlueprintDescriptor()} 
method, and return the


Reply via email to