camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1407923 - in /camel/branches/camel-2.10.x: ./ components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/ components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/ components/camel-test-blueprint/src...
Date Sun, 11 Nov 2012 07:42:44 GMT
Author: davsclaus
Date: Sun Nov 11 07:42:43 2012
New Revision: 1407923

URL: http://svn.apache.org/viewvc?rev=1407923&view=rev
Log:
CAMEL-5783 Added bundle directives in the generated test bundles by camel-test-blueprint with
thanks to Aki

Added:
    camel/branches/camel-2.10.x/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/IgnoreDatatypesTest.java
      - copied unchanged from r1407818, camel/trunk/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/IgnoreDatatypesTest.java
    camel/branches/camel-2.10.x/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/ignoreDatatypes.xml
      - copied unchanged from r1407818, camel/trunk/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/ignoreDatatypes.xml
Modified:
    camel/branches/camel-2.10.x/   (props changed)
    camel/branches/camel-2.10.x/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintHelper.java
    camel/branches/camel-2.10.x/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1407818

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.10.x/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintHelper.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintHelper.java?rev=1407923&r1=1407922&r2=1407923&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintHelper.java
(original)
+++ camel/branches/camel-2.10.x/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintHelper.java
Sun Nov 11 07:42:43 2012
@@ -84,11 +84,16 @@ public final class CamelBlueprintHelper 
 
     public static BundleContext createBundleContext(String name, String descriptors, boolean
includeTestBundle,
                                                     String bundleFilter, String testBundleVersion)
throws Exception {
+        return createBundleContext(name, descriptors, includeTestBundle, bundleFilter, testBundleVersion,
null);
+    }
+    
+    public static BundleContext createBundleContext(String name, String descriptors, boolean
includeTestBundle,
+                                                    String bundleFilter, String testBundleVersion,
String testBundleDirectives) throws Exception {
         TinyBundle bundle = null;
 
         if (includeTestBundle) {
             // add ourselves as a bundle
-            bundle = createTestBundle(name, testBundleVersion, descriptors);
+            bundle = createTestBundle(testBundleDirectives == null ? name : name + ';' +
testBundleDirectives, testBundleVersion, descriptors);
         }
 
         return createBundleContext(name, bundleFilter, bundle);

Modified: camel/branches/camel-2.10.x/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java?rev=1407923&r1=1407922&r2=1407923&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java
(original)
+++ camel/branches/camel-2.10.x/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java
Sun Nov 11 07:42:43 2012
@@ -39,7 +39,7 @@ public abstract class CamelBlueprintTest
     public void setUp() throws Exception {
         String symbolicName = getClass().getSimpleName();
         this.bundleContext = CamelBlueprintHelper.createBundleContext(symbolicName, getBlueprintDescriptor(),
-                true, getBundleFilter(), getBundleVersion());
+                true, getBundleFilter(), getBundleVersion(), getBundleDirectives());
 
         // must register override properties early in OSGi containers
         Properties extra = useOverridePropertiesWithPropertiesComponent();
@@ -102,6 +102,15 @@ public abstract class CamelBlueprintTest
         return CamelBlueprintHelper.BUNDLE_VERSION;
     }
 
+    /**
+     * Gets the bundle directives.
+     * Modify this method if you wish to add some directives.
+     * @return
+     */
+    protected String getBundleDirectives() {
+        return null;
+    }
+    
     @Override
     protected CamelContext createCamelContext() throws Exception {
         CamelContext answer = CamelBlueprintHelper.getOsgiService(bundleContext, CamelContext.class);



Mime
View raw message