You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2012/01/23 15:48:27 UTC
svn commit: r1234828 -
/camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java
Author: davsclaus
Date: Mon Jan 23 14:48:26 2012
New Revision: 1234828
URL: http://svn.apache.org/viewvc?rev=1234828&view=rev
Log:
CAMEL-4914: Ensure all stuff is stored in target directory.
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=1234828&r1=1234827&r2=1234828&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 Mon Jan 23 14:48:26 2012
@@ -65,7 +65,8 @@ public abstract class CamelBlueprintTest
deleteDirectory("target/test-bundle");
createDirectory("target/test-bundle");
- System.setProperty("org.bundles.framework.storage", "target/bundles/" + System.currentTimeMillis());
+ // 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=*)");
TinyBundle bundle = createTestBundle();
bundles.add(getBundleDescriptor("target/test-bundle/test-bundle.jar", bundle));
@@ -77,6 +78,13 @@ public abstract class CamelBlueprintTest
super.setUp();
}
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ bundleContext.getBundle().stop();
+ System.clearProperty("org.osgi.framework.storage");
+ }
+
protected TinyBundle createTestBundle() throws FileNotFoundException {
TinyBundle bundle = TinyBundles.newBundle();
for (URL url : getBlueprintDescriptors()) {
@@ -94,7 +102,7 @@ public abstract class CamelBlueprintTest
* <p/>
* It is preferred to override the {@link #getBlueprintDescriptor()} method, and return the
* location as a String, which is easier to deal with than a {@link Collection} type.
- *
+ *
* @return the bundle descriptors.
* @throws FileNotFoundException is thrown if a bundle descriptor cannot be found
*/
@@ -124,8 +132,8 @@ public abstract class CamelBlueprintTest
* Return the location(s) of the bundle descriptors from the classpath.
* Separate multiple locations by comma, or return a single location.
* <p/>
- * For example override this method and return <tt>OSGI-INF/blueprint/myApp.xml</tt>
- *
+ * For example override this method and return <tt>OSGI-INF/blueprint/camel-context.xml</tt>
+ *
* @return the location of the bundle descriptor file.
*/
protected String getBlueprintDescriptor() {
@@ -137,12 +145,6 @@ public abstract class CamelBlueprintTest
return getOsgiService(CamelContext.class);
}
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- bundleContext.getBundle().stop();
- }
-
protected <T> T getOsgiService(Class<T> type, long timeout) {
return getOsgiService(type, null, timeout);
}