Fix fileinstall unit tests
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1587169 13f79535-47bb-0310-9956-ffa450edef68
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 f9cd876..0f70fe5 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
@@ -122,6 +122,8 @@
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(mockConfigurationAdmin.listConfigurations((String) EasyMock.anyObject()))
.andReturn(null);
EasyMock.expect(mockConfigurationAdmin.getConfiguration("pid", null ))
@@ -138,6 +140,8 @@
public void testSetConfiguration() throws Exception
{
+ EasyMock.expect(mockBundleContext.getProperty(DirectoryWatcher.LOG_DEFAULT)).andReturn(null);
+ EasyMock.expect(mockBundleContext.getProperty(DirectoryWatcher.LOG_LEVEL)).andReturn(null);
EasyMock.expect(mockConfiguration.getBundleLocation()).andReturn(null);
EasyMock.expect(mockConfiguration.getProperties()).andReturn(new Hashtable<String, Object>());
EasyMock.reportMatcher(new IArgumentMatcher()
diff --git a/fileinstall/src/test/java/org/apache/felix/fileinstall/internal/DirectoryWatcherTest.java b/fileinstall/src/test/java/org/apache/felix/fileinstall/internal/DirectoryWatcherTest.java
index ca7d181..0a76432 100644
--- a/fileinstall/src/test/java/org/apache/felix/fileinstall/internal/DirectoryWatcherTest.java
+++ b/fileinstall/src/test/java/org/apache/felix/fileinstall/internal/DirectoryWatcherTest.java
@@ -29,6 +29,7 @@
import junit.framework.TestCase;
import org.apache.felix.fileinstall.ArtifactListener;
import org.easymock.EasyMock;
+import org.easymock.IMocksControl;
import org.junit.Assert;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -54,11 +55,15 @@
protected void setUp() throws Exception
{
super.setUp();
- mockBundleContext = EasyMock.createMock(BundleContext.class);
+ IMocksControl ctrl = EasyMock.createControl();
+ ctrl.makeThreadSafe(true);
+ mockBundleContext = ctrl.createMock(BundleContext.class);
mockBundle = EasyMock.createNiceMock(Bundle.class);
props.put( DirectoryWatcher.DIR, new File( "target/load" ).getAbsolutePath() );
// Might get called, but most of the time it doesn't matter whether they do or don't.
+ EasyMock.expect(mockBundleContext.getProperty(DirectoryWatcher.LOG_DEFAULT))
+ .andStubReturn(null);
EasyMock.expect(mockBundleContext.getProperty(DirectoryWatcher.LOG_LEVEL))
.andStubReturn(null);
EasyMock.expect(mockBundleContext.getServiceReference(LogService.class.getName()))