felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1587169 - in /felix/trunk/fileinstall/src/test/java/org/apache/felix/fileinstall/internal: ConfigInstallerTest.java DirectoryWatcherTest.java
Date Mon, 14 Apr 2014 10:07:41 GMT
Author: gnodet
Date: Mon Apr 14 10:07:41 2014
New Revision: 1587169

URL: http://svn.apache.org/r1587169
Log:
Fix fileinstall unit tests

Modified:
    felix/trunk/fileinstall/src/test/java/org/apache/felix/fileinstall/internal/ConfigInstallerTest.java
    felix/trunk/fileinstall/src/test/java/org/apache/felix/fileinstall/internal/DirectoryWatcherTest.java

Modified: felix/trunk/fileinstall/src/test/java/org/apache/felix/fileinstall/internal/ConfigInstallerTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/fileinstall/src/test/java/org/apache/felix/fileinstall/internal/ConfigInstallerTest.java?rev=1587169&r1=1587168&r2=1587169&view=diff
==============================================================================
--- felix/trunk/fileinstall/src/test/java/org/apache/felix/fileinstall/internal/ConfigInstallerTest.java
(original)
+++ felix/trunk/fileinstall/src/test/java/org/apache/felix/fileinstall/internal/ConfigInstallerTest.java
Mon Apr 14 10:07:41 2014
@@ -122,6 +122,8 @@ public class ConfigInstallerTest extends
     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 class ConfigInstallerTest extends
 
     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()

Modified: felix/trunk/fileinstall/src/test/java/org/apache/felix/fileinstall/internal/DirectoryWatcherTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/fileinstall/src/test/java/org/apache/felix/fileinstall/internal/DirectoryWatcherTest.java?rev=1587169&r1=1587168&r2=1587169&view=diff
==============================================================================
--- felix/trunk/fileinstall/src/test/java/org/apache/felix/fileinstall/internal/DirectoryWatcherTest.java
(original)
+++ felix/trunk/fileinstall/src/test/java/org/apache/felix/fileinstall/internal/DirectoryWatcherTest.java
Mon Apr 14 10:07:41 2014
@@ -29,6 +29,7 @@ import java.util.Set;
 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 @@ public class DirectoryWatcherTest extend
     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()))



Mime
View raw message