You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2019/02/25 12:38:30 UTC

[sling-org-apache-sling-installer-provider-installhook] 11/24: SLING-7790 feedback from relase vote (removed deprecated api, OsgiInstallerListener non-public)

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

kwin pushed a commit to branch feature/SLING-8291_expose-error
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-installer-provider-installhook.git

commit 391d900ef520739a9dd00f0223e33b3333f9e444
Author: georg.henzler <ge...@netcentric.biz>
AuthorDate: Fri Oct 12 00:59:30 2018 +0200

    SLING-7790 feedback from relase vote (removed deprecated api,
    OsgiInstallerListener non-public)
---
 pom.xml                                                              | 3 +--
 .../sling/installer/provider/installhook/OsgiInstallerHook.java      | 2 +-
 .../sling/installer/provider/installhook/OsgiInstallerListener.java  | 2 +-
 .../sling/installer/provider/installhook/OsgiInstallerHookTest.java  | 5 +++++
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 1a9f03e..762c3b2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,8 +9,7 @@
     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. -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
diff --git a/src/main/java/org/apache/sling/installer/provider/installhook/OsgiInstallerHook.java b/src/main/java/org/apache/sling/installer/provider/installhook/OsgiInstallerHook.java
index fd27716..2683309 100644
--- a/src/main/java/org/apache/sling/installer/provider/installhook/OsgiInstallerHook.java
+++ b/src/main/java/org/apache/sling/installer/provider/installhook/OsgiInstallerHook.java
@@ -396,7 +396,7 @@ public class OsgiInstallerHook implements InstallHook {
             throws IOException, RepositoryException {
         LOG.trace("Converting {} at path {}", node, path);
         final String digest = String.valueOf(node.getProperty(JCR_CONTENT_LAST_MODIFIED).getDate().getTimeInMillis());
-        final InputStream is = node.getProperty(JCR_CONTENT_DATA).getStream();
+        final InputStream is = node.getProperty(JCR_CONTENT_DATA).getBinary().getStream();
         final Dictionary<String, Object> dict = new Hashtable<String, Object>();
         dict.put(InstallableResource.INSTALLATION_HINT, node.getParent().getName());
         int priority = getNumericPackageProperty(packageProperties, PACKAGE_PROPERTY_INSTALL_PRIORITY, DEFAULT_PRIORITY_INSTALL_HOOK);
diff --git a/src/main/java/org/apache/sling/installer/provider/installhook/OsgiInstallerListener.java b/src/main/java/org/apache/sling/installer/provider/installhook/OsgiInstallerListener.java
index 4dd6b5a..63c64c3 100644
--- a/src/main/java/org/apache/sling/installer/provider/installhook/OsgiInstallerListener.java
+++ b/src/main/java/org/apache/sling/installer/provider/installhook/OsgiInstallerListener.java
@@ -29,7 +29,7 @@ import org.apache.sling.installer.api.tasks.TaskResource;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class OsgiInstallerListener implements InstallationListener {
+class OsgiInstallerListener implements InstallationListener {
 
     private static final Logger LOG = LoggerFactory.getLogger(OsgiInstallerListener.class);
 
diff --git a/src/test/java/org/apache/sling/installer/provider/installhook/OsgiInstallerHookTest.java b/src/test/java/org/apache/sling/installer/provider/installhook/OsgiInstallerHookTest.java
index 156fbfe..5aeea2e 100644
--- a/src/test/java/org/apache/sling/installer/provider/installhook/OsgiInstallerHookTest.java
+++ b/src/test/java/org/apache/sling/installer/provider/installhook/OsgiInstallerHookTest.java
@@ -30,6 +30,7 @@ import java.util.Calendar;
 import java.util.HashSet;
 import java.util.List;
 
+import javax.jcr.Binary;
 import javax.jcr.Node;
 import javax.jcr.Property;
 import javax.jcr.RepositoryException;
@@ -54,6 +55,9 @@ public class OsgiInstallerHookTest {
     Node node;
 
     @Mock
+    Binary binary;
+
+    @Mock
     Node parentNode;
 
     @Mock
@@ -81,6 +85,7 @@ public class OsgiInstallerHookTest {
         when(node.getProperty(OsgiInstallerHook.JCR_CONTENT_LAST_MODIFIED)).thenReturn(lastModifiedProperty);
         when(lastModifiedProperty.getDate()).thenReturn(now);
         when(node.getProperty(OsgiInstallerHook.JCR_CONTENT_DATA)).thenReturn(contentDataProperty);
+        when(contentDataProperty.getBinary()).thenReturn(binary);
         when(node.getParent()).thenReturn(parentNode);
 
     }