This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag 
org.apache.sling.testing.osgi-mock-1.3.0
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git

commit c389c24e244fc46c2ff290d90230f291d547642b
Author: Stefan Seifert <[email protected]>
AuthorDate: Thu Mar 5 14:05:16 2015 +0000

    SLING-4472 MockBundleContent.getProperty should return null
    
    git-svn-id: 
https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/osgi-mock@1664351 
13f79535-47bb-0310-9956-ffa450edef68
---
 .../java/org/apache/sling/testing/mock/osgi/MockBundleContext.java   | 5 +++--
 .../org/apache/sling/testing/mock/osgi/MockBundleContextTest.java    | 5 +++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git 
a/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java 
b/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
index a7337ed..eea03d1 100644
--- a/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
+++ b/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
@@ -255,12 +255,13 @@ class MockBundleContext implements BundleContext {
         return new Bundle[0];
     }
 
-    // --- unsupported operations ---
     @Override
     public String getProperty(final String s) {
-        throw new UnsupportedOperationException();
+        // no mock implementation, simulate that no property is found and 
return null
+        return null;
     }
 
+    // --- unsupported operations ---
     @Override
     public Bundle installBundle(final String s) {
         throw new UnsupportedOperationException();
diff --git 
a/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextTest.java 
b/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextTest.java
index a6a6258..4284b97 100644
--- 
a/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextTest.java
+++ 
b/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextTest.java
@@ -173,4 +173,9 @@ public class MockBundleContextTest {
         bundleContext.removeFrameworkListener(null);
     }
 
+    @Test
+    public void testGetProperty() {
+        assertNull(bundleContext.getProperty("anyProperty"));
+    }
+
 }

-- 
To stop receiving notification emails like this one, please contact
"[email protected]" <[email protected]>.

Reply via email to