sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asa...@apache.org
Subject svn commit: r1650482 - /sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/mapping/MapEntriesTest.java
Date Fri, 09 Jan 2015 10:15:30 GMT
Author: asanso
Date: Fri Jan  9 10:15:30 2015
New Revision: 1650482

URL: http://svn.apache.org/r1650482
Log:
SLING-4216 - Limit the number of vanityPath MapEntry 

Modified:
    sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/mapping/MapEntriesTest.java

Modified: sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/mapping/MapEntriesTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/mapping/MapEntriesTest.java?rev=1650482&r1=1650481&r2=1650482&view=diff
==============================================================================
--- sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/mapping/MapEntriesTest.java
(original)
+++ sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/mapping/MapEntriesTest.java
Fri Jan  9 10:15:30 2015
@@ -47,6 +47,7 @@ import org.apache.sling.api.resource.Res
 import org.apache.sling.api.resource.ValueMap;
 import org.apache.sling.api.wrappers.ValueMapDecorator;
 import org.apache.sling.resourceresolver.impl.mapping.MapConfigurationProvider.VanityPathConfig;
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mock;
@@ -59,6 +60,8 @@ import org.osgi.service.event.EventAdmin
 public class MapEntriesTest {
 
     private MapEntries mapEntries;
+    
+    File vanityBloomFilterFile;
 
     @Mock
     private MapConfigurationProvider resourceResolverFactory;
@@ -89,8 +92,8 @@ public class MapEntriesTest {
         configs.add(new VanityPathConfig("/vanityPathOnJcrContent", false));
 
         Collections.sort(configs);
-        
-        when(bundleContext.getDataFile("vanityBloomFilter.txt")).thenReturn(new File("vanityBloomFilter.txt"));
+        vanityBloomFilterFile = new File("src/main/resourcesvanityBloomFilter.txt");
+        when(bundleContext.getDataFile("vanityBloomFilter.txt")).thenReturn(vanityBloomFilterFile);
         when(resourceResolverFactory.getAdministrativeResourceResolver(null)).thenReturn(resourceResolver);
         when(resourceResolverFactory.isVanityPathEnabled()).thenReturn(true);
         when(resourceResolverFactory.getVanityPathConfig()).thenReturn(configs);
@@ -108,6 +111,11 @@ public class MapEntriesTest {
         field1.set(mapEntries, -1);
         
     }
+    
+    @After
+    public void tearDown() throws Exception {
+        vanityBloomFilterFile.delete();
+    }
 
     @Test
     public void test_simple_alias_support() {



Mime
View raw message