You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2010/12/31 19:42:20 UTC
svn commit: r1054159 -
/sling/trunk/installer/core/src/test/java/org/apache/sling/installer/core/impl/MockBundleResource.java
Author: cziegeler
Date: Fri Dec 31 18:42:19 2010
New Revision: 1054159
URL: http://svn.apache.org/viewvc?rev=1054159&view=rev
Log:
SLING-1910 : Endless recursion if bundle can't be started
SLING-1911 : If the same resource is at different locations they should be treated as the same resource
Modified:
sling/trunk/installer/core/src/test/java/org/apache/sling/installer/core/impl/MockBundleResource.java
Modified: sling/trunk/installer/core/src/test/java/org/apache/sling/installer/core/impl/MockBundleResource.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/test/java/org/apache/sling/installer/core/impl/MockBundleResource.java?rev=1054159&r1=1054158&r2=1054159&view=diff
==============================================================================
--- sling/trunk/installer/core/src/test/java/org/apache/sling/installer/core/impl/MockBundleResource.java (original)
+++ sling/trunk/installer/core/src/test/java/org/apache/sling/installer/core/impl/MockBundleResource.java Fri Dec 31 18:42:19 2010
@@ -25,8 +25,6 @@ import java.util.HashMap;
import java.util.Map;
import org.apache.sling.installer.api.InstallableResource;
-import org.apache.sling.installer.core.impl.RegisteredResource;
-import org.apache.sling.installer.core.impl.RegisteredResourceImpl;
import org.osgi.framework.Constants;
/** Mock RegisteredResource that simulates a bundle */
@@ -34,6 +32,7 @@ public class MockBundleResource implemen
private static final long serialVersionUID = 1L;
private final Map<String, Object> attributes = new HashMap<String, Object>();
+ private final Map<String, Object> tempAttributes = new HashMap<String, Object>();
private State state = State.INSTALL;
private final String digest;
private final int priority;
@@ -157,4 +156,21 @@ public class MockBundleResource implemen
this.state = s;
}
+ /**
+ * @see org.apache.sling.installer.core.impl.RegisteredResource#getTemporaryAttribute(java.lang.String)
+ */
+ public Object getTemporaryAttribute(String key) {
+ return this.tempAttributes.get(key);
+ }
+
+ /**
+ * @see org.apache.sling.installer.core.impl.RegisteredResource#setTemporaryAttributee(java.lang.String, java.lang.Object)
+ */
+ public void setTemporaryAttributee(String key, Object value) {
+ if ( value == null ) {
+ this.tempAttributes.remove(key);
+ } else {
+ this.tempAttributes.put(key, value);
+ }
+ }
}