You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by gn...@apache.org on 2020/04/01 12:00:16 UTC

[felix-dev] branch master updated (48f1b6b -> 7650a39)

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

gnodet pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/felix-dev.git.


    from 48f1b6b  Javadoc fixes
     new dd76dc3  Fix pom and unit tests
     new 7650a39  [FELIX-6109] Fix possible NPE in DirectoryWatcher.findListener

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 fileinstall/pom.xml                                      | 16 ++++++++++++++--
 .../apache/felix/fileinstall/internal/FileInstall.java   |  4 +++-
 .../felix/fileinstall/internal/ConfigInstallerTest.java  |  7 ++++++-
 3 files changed, 23 insertions(+), 4 deletions(-)


[felix-dev] 01/02: Fix pom and unit tests

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/felix-dev.git

commit dd76dc3f2f97a1482777334226da95a90a23f943
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Wed Apr 1 13:26:20 2020 +0200

    Fix pom and unit tests
---
 fileinstall/pom.xml                                      | 16 ++++++++++++++--
 .../felix/fileinstall/internal/ConfigInstallerTest.java  |  7 ++++++-
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/fileinstall/pom.xml b/fileinstall/pom.xml
index ad8e091..be4c151 100644
--- a/fileinstall/pom.xml
+++ b/fileinstall/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.felix</groupId>
     <artifactId>felix-parent</artifactId>
-    <version>3</version>
+    <version>6</version>
     <relativePath>../pom/pom.xml</relativePath>
   </parent>
 	
@@ -37,7 +37,7 @@
     <url>https://gitbox.apache.org/repos/asf?p=felix-dev.git</url>
   </scm>
   <properties>
-    <felix.java.version>7</felix.java.version>
+    <felix.java.version>8</felix.java.version>
   </properties>
   <dependencies>
     <dependency>
@@ -62,6 +62,18 @@
       <artifactId>org.apache.felix.utils</artifactId>
       <version>1.11.2</version>
     </dependency>
+    <dependency>
+      <groupId>org.easymock</groupId>
+      <artifactId>easymock</artifactId>
+      <version>3.6</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.13</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
   <build>
     <plugins>
diff --git a/fileinstall/src/test/java/org/apache/felix/fileinstall/internal/ConfigInstallerTest.java b/fileinstall/src/test/java/org/apache/felix/fileinstall/internal/ConfigInstallerTest.java
index d0ff5eb..3228ece 100644
--- a/fileinstall/src/test/java/org/apache/felix/fileinstall/internal/ConfigInstallerTest.java
+++ b/fileinstall/src/test/java/org/apache/felix/fileinstall/internal/ConfigInstallerTest.java
@@ -96,6 +96,8 @@ public class ConfigInstallerTest extends TestCase {
         EasyMock.expect(mockBundleContext.getProperty((String) EasyMock.anyObject()))
                 .andReturn(null)
                 .anyTimes();
+        EasyMock.expect(mockBundleContext.getBundle())
+                .andReturn(mockBundle);
         mockConfiguration.update(EasyMock.capture(props));
         EasyMock.expectLastCall();
         EasyMock.replay(mockConfiguration, mockConfigurationAdmin, mockBundleContext);
@@ -127,6 +129,8 @@ public class ConfigInstallerTest extends TestCase {
         EasyMock.expect(mockBundleContext.getProperty((String) EasyMock.anyObject()))
                 .andReturn(null)
                 .anyTimes();
+        EasyMock.expect(mockBundleContext.getBundle())
+                .andReturn(mockBundle);
         mockConfiguration.update(EasyMock.capture(props));
         EasyMock.expectLastCall();
         EasyMock.replay(mockConfiguration, mockConfigurationAdmin, mockBundleContext);
@@ -191,8 +195,8 @@ public class ConfigInstallerTest extends TestCase {
     public void testDeleteConfig() throws Exception
     {
         mockConfiguration.delete();
-        EasyMock.expect(mockBundleContext.getProperty(DirectoryWatcher.LOG_DEFAULT)).andReturn(null);
         EasyMock.expect(mockBundleContext.getProperty(DirectoryWatcher.LOG_LEVEL)).andReturn(null);
+        EasyMock.expect(mockBundleContext.getBundle()).andReturn(mockBundle).anyTimes();
         EasyMock.expect(mockConfigurationAdmin.listConfigurations((String) EasyMock.anyObject()))
                         .andReturn(null);
         EasyMock.expect(mockConfigurationAdmin.getConfiguration("pid", "?" ))
@@ -405,6 +409,7 @@ public class ConfigInstallerTest extends TestCase {
         EasyMock.expect(mockBundleContext.getProperty(DirectoryWatcher.CONFIG_ENCODING)).andReturn(null);
         EasyMock.expect(mockBundleContext.getProperty(DirectoryWatcher.LOG_DEFAULT)).andReturn(null);
         EasyMock.expect(mockBundleContext.getProperty(DirectoryWatcher.LOG_LEVEL)).andReturn(null);
+        EasyMock.expect(mockBundleContext.getBundle()).andReturn(mockBundle).anyTimes();
         EasyMock.expect(mockConfiguration.getProperties()).andReturn(new Hashtable<String, Object>());
         EasyMock.reportMatcher(new IArgumentMatcher()
         {


[felix-dev] 02/02: [FELIX-6109] Fix possible NPE in DirectoryWatcher.findListener

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/felix-dev.git

commit 7650a39c517bafc6fff19708828493d694fc5c85
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Wed Apr 1 13:59:55 2020 +0200

    [FELIX-6109] Fix possible NPE in DirectoryWatcher.findListener
---
 .../main/java/org/apache/felix/fileinstall/internal/FileInstall.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/FileInstall.java b/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/FileInstall.java
index 5ccaecd..eafcf21 100644
--- a/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/FileInstall.java
+++ b/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/FileInstall.java
@@ -149,7 +149,9 @@ public class FileInstall implements BundleActivator, ServiceTrackerCustomizer
     public Object addingService(ServiceReference serviceReference)
     {
         ArtifactListener listener = (ArtifactListener) context.getService(serviceReference);
-        addListener(serviceReference, listener);
+        if (listener != null) {
+            addListener(serviceReference, listener);
+        }
         return listener;
     }
     public void modifiedService(ServiceReference reference, Object service)