You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ju...@apache.org on 2012/09/26 21:10:21 UTC
svn commit: r1390679 - in
/sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi:
MockBundleContext.java MockComponentContext.java
Author: justin
Date: Wed Sep 26 19:10:20 2012
New Revision: 1390679
URL: http://svn.apache.org/viewvc?rev=1390679&view=rev
Log:
SLING-2606 - allow the MockBundleContext to be overridden
Modified:
sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockBundleContext.java
sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockComponentContext.java
Modified: sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockBundleContext.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockBundleContext.java?rev=1390679&r1=1390678&r2=1390679&view=diff
==============================================================================
--- sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockBundleContext.java (original)
+++ sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockBundleContext.java Wed Sep 26 19:10:20 2012
@@ -33,7 +33,7 @@ import org.osgi.framework.ServiceListene
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
-class MockBundleContext implements BundleContext {
+public class MockBundleContext implements BundleContext {
private MockBundle bundle;
public MockBundleContext(MockBundle bundle) {
Modified: sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockComponentContext.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockComponentContext.java?rev=1390679&r1=1390678&r2=1390679&view=diff
==============================================================================
--- sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockComponentContext.java (original)
+++ sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/osgi/MockComponentContext.java Wed Sep 26 19:10:20 2012
@@ -44,11 +44,20 @@ public class MockComponentContext implem
public MockComponentContext(MockBundle bundle) {
mockBundleContext = new MockBundleContext(bundle);
}
+
+ public MockComponentContext(MockBundleContext mockBundleContext) {
+ this.mockBundleContext = mockBundleContext;
+ }
public MockComponentContext(MockBundle bundle, Servlet servlet) {
mockBundleContext = new MockBundleContext(bundle);
this.servlet = servlet;
}
+
+ public MockComponentContext(MockBundleContext mockBundleContext, Servlet servlet) {
+ this.mockBundleContext = mockBundleContext;
+ this.servlet = servlet;
+ }
public void addService(ServiceReference reference, Object service) {
services.put(reference, service);