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:17 UTC
[felix-dev] 01/02: Fix pom and unit tests
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()
{