Author: gnodet
Date: Wed Feb 18 19:18:06 2009
New Revision: 745622
URL: http://svn.apache.org/viewvc?rev=745622&view=rev
Log:
SMX4KNL-203: When installing a feature, the service should first install all
bundles, then start them all in order
Modified:
servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/FeaturesServiceImpl.java
servicemix/smx4/kernel/trunk/gshell/gshell-features/src/test/java/org/apache/servicemix/kernel/gshell/features/FeaturesServiceTest.java
Modified:
servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/FeaturesServiceImpl.java
URL:
http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/FeaturesServiceImpl.java?rev=745622&r1=745621&r2=745622&view=diff
==============================================================================
---
servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/FeaturesServiceImpl.java
(original)
+++
servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/FeaturesServiceImpl.java
Wed Feb 18 19:18:06 2009
@@ -189,9 +189,11 @@
Set<Long> bundles = new HashSet<Long>();
for (String bundleLocation : f.getBundles()) {
Bundle b = installBundleIfNeeded(bundleLocation);
- b.start();
bundles.add(b.getBundleId());
}
+ for (long id : bundles) {
+ bundleContext.getBundle(id).start();
+ }
featuresRegistry.registerInstalled(f);
installed.put(f, bundles);
Modified:
servicemix/smx4/kernel/trunk/gshell/gshell-features/src/test/java/org/apache/servicemix/kernel/gshell/features/FeaturesServiceTest.java
URL:
http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-features/src/test/java/org/apache/servicemix/kernel/gshell/features/FeaturesServiceTest.java?rev=745622&r1=745621&r2=745622&view=diff
==============================================================================
---
servicemix/smx4/kernel/trunk/gshell/gshell-features/src/test/java/org/apache/servicemix/kernel/gshell/features/FeaturesServiceTest.java
(original)
+++
servicemix/smx4/kernel/trunk/gshell/gshell-features/src/test/java/org/apache/servicemix/kernel/gshell/features/FeaturesServiceTest.java
Wed Feb 18 19:18:06 2009
@@ -105,8 +105,9 @@
expect(bundleContext.getBundles()).andReturn(new Bundle[0]);
expect(bundleContext.installBundle(isA(String.class),
isA(InputStream.class))).andReturn(installedBundle);
- installedBundle.start();
expect(installedBundle.getBundleId()).andReturn(12345L);
+ expect(bundleContext.getBundle(12345L)).andReturn(installedBundle);
+ installedBundle.start();
expect(preferencesService.getUserPreferences("FeaturesServiceState")).andStubReturn(prefs);
expect(prefs.node("repositories")).andReturn(repositoriesNode);