servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r733675 - in /servicemix/smx4/kernel/trunk: assembly/src/main/filtered-resources/ gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/ gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/fe...
Date Mon, 12 Jan 2009 10:30:30 GMT
Author: ffang
Date: Mon Jan 12 02:30:19 2009
New Revision: 733675

URL: http://svn.apache.org/viewvc?rev=733675&view=rev
Log:
[SMX4KNL-76]support to install/uninstall different version of features

Added:
    servicemix/smx4/kernel/trunk/gshell/gshell-features/src/test/java/org/apache/servicemix/kernel/gshell/features/FeatureTest.java
  (with props)
Modified:
    servicemix/smx4/kernel/trunk/assembly/src/main/filtered-resources/features.xml
    servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/Feature.java
    servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/FeaturesService.java
    servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/commands/InstallFeatureCommand.java
    servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/commands/UninstallFeatureCommand.java
    servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/FeatureImpl.java
    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/main/java/org/apache/servicemix/kernel/gshell/features/internal/RepositoryImpl.java
    servicemix/smx4/kernel/trunk/gshell/gshell-features/src/test/java/org/apache/servicemix/kernel/gshell/features/FeaturesServiceTest.java
    servicemix/smx4/kernel/trunk/gshell/gshell-features/src/test/java/org/apache/servicemix/kernel/gshell/features/RepositoryTest.java

Modified: servicemix/smx4/kernel/trunk/assembly/src/main/filtered-resources/features.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/assembly/src/main/filtered-resources/features.xml?rev=733675&r1=733674&r2=733675&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/assembly/src/main/filtered-resources/features.xml (original)
+++ servicemix/smx4/kernel/trunk/assembly/src/main/filtered-resources/features.xml Mon Jan
12 02:30:19 2009
@@ -20,6 +20,9 @@
     <feature name="wrapper" version="${version}">
         <bundle>mvn:org.apache.servicemix.kernel.gshell/org.apache.servicemix.kernel.gshell.wrapper/${version}</bundle>
     </feature>
+    <feature name="wrapper" version="1.0.0">
+        <bundle>mvn:org.apache.servicemix.kernel.gshell/org.apache.servicemix.kernel.gshell.wrapper/1.0.0</bundle>
+    </feature>
     <feature name="obr" version="${version}">
         <bundle>mvn:org.apache.felix/org.apache.felix.bundlerepository/${felix.bundlerepository.version}</bundle>
         <bundle>org.apache.servicemix.kernel.gshell:org.apache.servicemix.kernel.gshell.obr/${version}</bundle>

Modified: servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/Feature.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/Feature.java?rev=733675&r1=733674&r2=733675&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/Feature.java
(original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/Feature.java
Mon Jan 12 02:30:19 2009
@@ -28,7 +28,7 @@
 
     String getVersion();
 
-    List<String> getDependencies();
+    List<Feature> getDependencies();
 
     List<String> getBundles();
 

Modified: servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/FeaturesService.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/FeaturesService.java?rev=733675&r1=733674&r2=733675&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/FeaturesService.java
(original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/FeaturesService.java
Mon Jan 12 02:30:19 2009
@@ -31,8 +31,12 @@
     Repository[] listRepositories();
 
     void installFeature(String name) throws Exception;
+    
+    void installFeature(String name, String version) throws Exception;
 
     void uninstallFeature(String name) throws Exception;
+    
+    void uninstallFeature(String name, String version) throws Exception;
 
     String[] listFeatures() throws Exception;
 

Modified: servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/commands/InstallFeatureCommand.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/commands/InstallFeatureCommand.java?rev=733675&r1=733674&r2=733675&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/commands/InstallFeatureCommand.java
(original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/commands/InstallFeatureCommand.java
Mon Jan 12 02:30:19 2009
@@ -23,8 +23,14 @@
 
     @Argument(required = true, description = "The name of the feature")
     String name;
+    @Argument(description = "The version of the feature", index = 1)
+    String version;
 
     protected void doExecute(FeaturesService admin) throws Exception {
-        admin.installFeature(name);
+    	if (version != null && version.length() > 0) {
+    		admin.installFeature(name, version);
+    	} else {
+    		admin.installFeature(name);
+    	}
     }
 }
\ No newline at end of file

Modified: servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/commands/UninstallFeatureCommand.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/commands/UninstallFeatureCommand.java?rev=733675&r1=733674&r2=733675&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/commands/UninstallFeatureCommand.java
(original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/commands/UninstallFeatureCommand.java
Mon Jan 12 02:30:19 2009
@@ -23,8 +23,14 @@
 
     @Argument(required = true, description = "The name of the feature")
     String name;
+    @Argument(description = "The version of the feature", index = 1)
+    String version;
 
     protected void doExecute(FeaturesService admin) throws Exception {
-        admin.uninstallFeature(name);
+    	if (version != null && version.length() > 0) {
+    		admin.uninstallFeature(name, version);
+    	} else {
+    		admin.uninstallFeature(name );
+    	}
     }
 }
\ No newline at end of file

Modified: servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/FeatureImpl.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/FeatureImpl.java?rev=733675&r1=733674&r2=733675&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/FeatureImpl.java
(original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/FeatureImpl.java
Mon Jan 12 02:30:19 2009
@@ -30,13 +30,19 @@
 
     private String name;
     private String version;
-    private List<String> dependencies = new ArrayList<String>();
+    private List<Feature> dependencies = new ArrayList<Feature>();
     private List<String> bundles = new ArrayList<String>();
     private Map<String, Map<String,String>> configs = new HashMap<String,
Map<String,String>>();
+    public static String SPLIT_FOR_NAME_AND_VERSION = "_split_for_name_and_version_";
+    public static String DEFAULT_VERSION = "0.0.0";
     
     public FeatureImpl(String name) {
-        this.name = name;
-        this.version = "0.0.0";
+        this(name, DEFAULT_VERSION);
+    }
+    
+    public FeatureImpl(String name, String version) {
+    	this.name = name;
+    	this.version = version;
     }
 
     public String getName() {
@@ -46,12 +52,12 @@
     public String getVersion() {
 		return version;
 	}
-
+    
 	public void setVersion(String version) {
 		this.version = version;
 	}
 
-    public List<String> getDependencies() {
+    public List<Feature> getDependencies() {
         return dependencies;
     }
 
@@ -63,7 +69,7 @@
         return configs;
     }
 
-    public void addDependency(String dependency) {
+    public void addDependency(Feature dependency) {
         dependencies.add(dependency);
     }
 
@@ -75,4 +81,21 @@
         configs.put(name, properties);
     }
 
+    public String toString() {
+    	String ret = getName() + SPLIT_FOR_NAME_AND_VERSION + getVersion();
+    	return ret;
+    }
+    
+    public static Feature valueOf(String str) {
+    	if (str.indexOf(SPLIT_FOR_NAME_AND_VERSION) >= 0) {
+    		String strName = str.substring(0, str.indexOf(SPLIT_FOR_NAME_AND_VERSION));
+        	String strVersion = str.substring(str.indexOf(SPLIT_FOR_NAME_AND_VERSION) 
+        			+ SPLIT_FOR_NAME_AND_VERSION.length(), str.length());
+        	return new FeatureImpl(strName, strVersion);
+    	} else {
+    		return new FeatureImpl(str);
+    	}
+    			
+    	
+    }
 }

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=733675&r1=733674&r2=733675&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
Mon Jan 12 02:30:19 2009
@@ -70,8 +70,8 @@
     private PreferencesService preferences;
     private Set<URI> uris;
     private Map<URI, RepositoryImpl> repositories = new HashMap<URI, RepositoryImpl>();
-    private Map<String, Feature> features;
-    private Map<String, Set<Long>> installed = new HashMap<String, Set<Long>>();
+    private Map<String, Map<String, Feature>> features;
+    private Map<Feature, Set<Long>> installed = new HashMap<Feature, Set<Long>>();
     private String boot;
     private boolean bootFeaturesInstalled;
 
@@ -142,12 +142,17 @@
     }
 
     public void installFeature(String name) throws Exception {
-        Feature f = getFeature(name);
+    	installFeature(name, FeatureImpl.DEFAULT_VERSION);//install feature with default version
+    }
+
+    public void installFeature(String name, String version) throws Exception {
+        Feature f = getFeature(name, version);
         if (f == null) {
-            throw new Exception("No feature named '" + name + "' available");
+            throw new Exception("No feature named '" + name 
+            		+ "' with version '" + version + "' available");
         }
-        for (String dependency : f.getDependencies()) {
-            installFeature(dependency);
+        for (Feature dependency : f.getDependencies()) {
+        	installFeature(dependency.getName(), dependency.getVersion());
         }
         for (String config : f.getConfigurations().keySet()) {
             Dictionary<String,String> props = new Hashtable<String, String>(f.getConfigurations().get(config));
@@ -167,10 +172,10 @@
             b.start();
             bundles.add(b.getBundleId());
         }
-        installed.put(name, bundles);
+        
+        installed.put(f, bundles);
         saveState();
     }
-
     protected Bundle installBundleIfNeeded(String bundleLocation) throws IOException, BundleException
{
         LOGGER.debug("Checking " + bundleLocation);
         InputStream is = new BufferedInputStream(new URL(bundleLocation).openStream());
@@ -205,13 +210,19 @@
     }
 
     public void uninstallFeature(String name) throws Exception {
-        if (!installed.containsKey(name)) {
-            throw new Exception("Feature named '" + name + "' is not installed");
+        uninstallFeature(name, FeatureImpl.DEFAULT_VERSION);//uninstall feature with default
version
+    }
+    
+    public void uninstallFeature(String name, String version) throws Exception {
+    	Feature feature = getFeature(name, version);
+        if (feature == null || !installed.containsKey(feature)) {
+            throw new Exception("Feature named '" + name 
+            		+ "' with version '" + version + "' is not installed");
         }
         // Grab all the bundles installed by this feature
         // and remove all those who will still be in use.
         // This gives this list of bundles to uninstall.
-        Set<Long> bundles = installed.remove(name);
+        Set<Long> bundles = installed.remove(feature);
         for (Set<Long> b : installed.values()) {
             bundles.removeAll(b);
         }
@@ -223,20 +234,32 @@
 
     public String[] listFeatures() throws Exception {
         Collection<String> features = new ArrayList<String>();
-        for (Feature f : getFeatures().values()) {
-            String installStatus = installed.containsKey(f.getName()) ? "installed  " : "uninstalled";
-            String version = f.getVersion();
-            switch (version.length()) {
-            case 1: version = "       " + version;
-            case 2: version = "      " + version;
-            case 3: version = "     " + version;
-            case 4: version = "    " + version;
-            case 5: version = "   " + version;
-            case 6: version = "  " + version;
-            case 7: version = " " + version;
-            }
-            features.add("[" + installStatus + "] " + " [" + version + "] " + f.getName());
-        }
+        for (Map<String, Feature> featureWithDifferentVersion : getFeatures()
+				.values()) {
+			for (Feature f : featureWithDifferentVersion.values()) {
+				String installStatus = installed.containsKey(f) ? "installed  "
+						: "uninstalled";
+				String version = f.getVersion();
+				switch (version.length()) {
+				case 1:
+					version = "       " + version;
+				case 2:
+					version = "      " + version;
+				case 3:
+					version = "     " + version;
+				case 4:
+					version = "    " + version;
+				case 5:
+					version = "   " + version;
+				case 6:
+					version = "  " + version;
+				case 7:
+					version = " " + version;
+				}
+				features.add("[" + installStatus + "] " + " [" + version + "] "
+						+ f.getName());
+			}
+		}
         return features.toArray(new String[features.size()]);
     }
 
@@ -244,13 +267,14 @@
         return installed.keySet().toArray(new String[installed.size()]);
     }
 
-    protected Feature getFeature(String name) throws Exception {
-        return getFeatures().get(name);
+    protected Feature getFeature(String name, String version) throws Exception {
+        return getFeatures().get(name).get(version);
     }
 
-    protected Map<String, Feature> getFeatures() throws Exception {
+    protected Map<String, Map<String, Feature>> getFeatures() throws Exception
{
         if (features == null) {
-            Map<String, Feature> map = new HashMap<String, Feature>();
+        	//the outer map's key is feature name, the inner map's key is feature version  
    
+            Map<String, Map<String, Feature>> map = new HashMap<String, Map<String,
Feature>>();
             // Two phase load:
             // * first load dependent repositories
             for (;;) {
@@ -270,7 +294,13 @@
             // * then load all features
             for (Repository repo : repositories.values()) {
                 for (Feature f : repo.getFeatures()) {
-                    map.put(f.getName(), f);
+                	if (map.get(f.getName()) == null) {
+                		Map<String, Feature> versionMap = new HashMap<String, Feature>();
+                		versionMap.put(f.getVersion(), f);
+                		map.put(f.getName(), versionMap);
+                	} else {
+                		map.get(f.getName()).put(f.getVersion(), f);
+                	}
                 }
             }
             features = map;
@@ -387,21 +417,21 @@
         return l;
     }
 
-    protected void saveMap(Preferences node, Map<String, Set<Long>> map) throws
BackingStoreException {
+    protected void saveMap(Preferences node, Map<Feature, Set<Long>> map) throws
BackingStoreException {
         node.clear();
-        for (Map.Entry<String, Set<Long>> entry : map.entrySet()) {
-            String key = entry.getKey();
+        for (Map.Entry<Feature, Set<Long>> entry : map.entrySet()) {
+            Feature key = entry.getKey();
             String val = createValue(entry.getValue());
-            node.put(key, val);
+            node.put(key.toString(), val);
         }
     }
 
-    protected Map<String, Set<Long>> loadMap(Preferences node) throws BackingStoreException
{
-        Map<String, Set<Long>> map = new HashMap<String, Set<Long>>();
+    protected Map<Feature, Set<Long>> loadMap(Preferences node) throws BackingStoreException
{
+        Map<Feature, Set<Long>> map = new HashMap<Feature, Set<Long>>();
         for (String key : node.keys()) {
             String val = node.get(key, null);
             Set<Long> set = readValue(val);
-            map.put(key, set);
+            map.put(FeatureImpl.valueOf(key), set);
         }
         return map;
     }

Modified: servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/RepositoryImpl.java?rev=733675&r1=733674&r2=733675&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/RepositoryImpl.java
(original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/kernel/gshell/features/internal/RepositoryImpl.java
Mon Jan 12 02:30:19 2009
@@ -96,7 +96,12 @@
                     NodeList featureNodes = e.getElementsByTagName("feature");
                     for (int j = 0; j < featureNodes.getLength(); j++) {
                         Element b = (Element) featureNodes.item(j);
-                        f.addDependency(b.getTextContent());
+                        String dependencyFeatureVersion = b.getAttribute("version");
+                        if (dependencyFeatureVersion != null && dependencyFeatureVersion.length()
> 0) {
+                        	f.addDependency(new FeatureImpl(b.getTextContent(), dependencyFeatureVersion));
+                        } else {
+                        	f.addDependency(new FeatureImpl(b.getTextContent()));
+                        }
                     }
                     NodeList configNodes = e.getElementsByTagName("config");
                     for (int j = 0; j < configNodes.getLength(); j++) {

Added: servicemix/smx4/kernel/trunk/gshell/gshell-features/src/test/java/org/apache/servicemix/kernel/gshell/features/FeatureTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-features/src/test/java/org/apache/servicemix/kernel/gshell/features/FeatureTest.java?rev=733675&view=auto
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-features/src/test/java/org/apache/servicemix/kernel/gshell/features/FeatureTest.java
(added)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-features/src/test/java/org/apache/servicemix/kernel/gshell/features/FeatureTest.java
Mon Jan 12 02:30:19 2009
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.kernel.gshell.features;
+
+import org.apache.servicemix.kernel.gshell.features.internal.FeatureImpl;
+
+import junit.framework.TestCase;
+
+public class FeatureTest extends TestCase {
+	
+	public void testValueOf() {
+		Feature feature = FeatureImpl.valueOf("name" + FeatureImpl.SPLIT_FOR_NAME_AND_VERSION +
"version");
+		assertEquals(feature.getName(), "name");
+		assertEquals(feature.getVersion(), "version");
+		feature = FeatureImpl.valueOf("name");
+		assertEquals(feature.getName(), "name");
+		assertEquals(feature.getVersion(), FeatureImpl.DEFAULT_VERSION);
+	}
+	
+}

Propchange: servicemix/smx4/kernel/trunk/gshell/gshell-features/src/test/java/org/apache/servicemix/kernel/gshell/features/FeatureTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: servicemix/smx4/kernel/trunk/gshell/gshell-features/src/test/java/org/apache/servicemix/kernel/gshell/features/FeatureTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

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=733675&r1=733674&r2=733675&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
Mon Jan 12 02:30:19 2009
@@ -20,6 +20,8 @@
 import java.io.InputStream;
 
 import static org.easymock.EasyMock.*;
+
+import org.apache.servicemix.kernel.gshell.features.internal.FeatureImpl;
 import org.apache.servicemix.kernel.gshell.features.internal.FeaturesServiceImpl;
 import org.easymock.EasyMock;
 import org.osgi.service.prefs.PreferencesService;
@@ -89,7 +91,7 @@
         repositoriesNode.put("item.0", uri.toString());
         expect(prefs.node("features")).andReturn(featuresNode);
         featuresNode.clear();
-        featuresNode.put("f1", "12345");
+        featuresNode.put("f1" + FeatureImpl.SPLIT_FOR_NAME_AND_VERSION + FeatureImpl.DEFAULT_VERSION,
"12345");
         prefs.putBoolean("bootFeaturesInstalled", false);
         prefs.flush();
 

Modified: servicemix/smx4/kernel/trunk/gshell/gshell-features/src/test/java/org/apache/servicemix/kernel/gshell/features/RepositoryTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-features/src/test/java/org/apache/servicemix/kernel/gshell/features/RepositoryTest.java?rev=733675&r1=733674&r2=733675&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-features/src/test/java/org/apache/servicemix/kernel/gshell/features/RepositoryTest.java
(original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-features/src/test/java/org/apache/servicemix/kernel/gshell/features/RepositoryTest.java
Mon Jan 12 02:30:19 2009
@@ -18,6 +18,7 @@
 
 import java.net.URI;
 
+import org.apache.servicemix.kernel.gshell.features.internal.FeatureImpl;
 import org.apache.servicemix.kernel.gshell.features.internal.RepositoryImpl;
 import junit.framework.TestCase;
 
@@ -54,7 +55,7 @@
         assertEquals(0, features[1].getConfigurations().size());
         assertNotNull(features[1].getDependencies());
         assertEquals(1, features[1].getDependencies().size());
-        assertEquals("f1", features[1].getDependencies().get(0));
+        assertEquals("f1" + FeatureImpl.SPLIT_FOR_NAME_AND_VERSION + FeatureImpl.DEFAULT_VERSION,
features[1].getDependencies().get(0).toString());
         assertNotNull(features[1].getBundles());
         assertEquals(1, features[1].getBundles().size());
         assertEquals("b3", features[1].getBundles().get(0));



Mime
View raw message