incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jus...@apache.org
Subject svn commit: r1377828 - /sling/trunk/performance/jcr-resource-2.2.0/src/test/java/org/apache/sling/performance/PerformanceTest.java
Date Mon, 27 Aug 2012 20:25:30 GMT
Author: justin
Date: Mon Aug 27 20:25:30 2012
New Revision: 1377828

URL: http://svn.apache.org/viewvc?rev=1377828&view=rev
Log:
SLING-2311 - updating performance test for changes in ResourceResolverFactory implementation

Modified:
    sling/trunk/performance/jcr-resource-2.2.0/src/test/java/org/apache/sling/performance/PerformanceTest.java

Modified: sling/trunk/performance/jcr-resource-2.2.0/src/test/java/org/apache/sling/performance/PerformanceTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/performance/jcr-resource-2.2.0/src/test/java/org/apache/sling/performance/PerformanceTest.java?rev=1377828&r1=1377827&r2=1377828&view=diff
==============================================================================
--- sling/trunk/performance/jcr-resource-2.2.0/src/test/java/org/apache/sling/performance/PerformanceTest.java
(original)
+++ sling/trunk/performance/jcr-resource-2.2.0/src/test/java/org/apache/sling/performance/PerformanceTest.java
Mon Aug 27 20:25:30 2012
@@ -45,6 +45,7 @@ import org.apache.sling.performance.test
 import org.apache.sling.performance.tests.ResolveWith30000VanityPathTest;
 import org.apache.sling.performance.tests.ResolveWith5000AliasTest;
 import org.apache.sling.performance.tests.ResolveWith5000VanityPathTest;
+import org.apache.sling.resourceresolver.impl.ResourceResolverFactoryActivator;
 import org.apache.sling.resourceresolver.impl.ResourceResolverFactoryImpl;
 import org.apache.sling.resourceresolver.impl.mapping.MapEntries;
 import org.apache.sling.resourceresolver.impl.mapping.Mapping;
@@ -70,7 +71,7 @@ public class PerformanceTest extends Abs
         }
 
         public void init(String rootPath, Session session, SlingRepository repository) throws
Exception {
-            ResourceResolverFactoryImpl resFac = new ResourceResolverFactoryImpl();
+            ResourceResolverFactoryActivator activator = new ResourceResolverFactoryActivator();
 
             JcrResourceProviderFactory providerFactory = new JcrResourceProviderFactory();
             PrivateAccessor.setField(providerFactory, "repository", repository);
@@ -82,20 +83,20 @@ public class PerformanceTest extends Abs
             props.put(QueriableResourceProvider.LANGUAGES, new String[] { "xpath", "sql"
});
 
             try {
-                PrivateAccessor.invoke(resFac, "bindResourceProviderFactory", new Class[]
{ ResourceProviderFactory.class,
+                PrivateAccessor.invoke(activator, "bindResourceProviderFactory", new Class[]
{ ResourceProviderFactory.class,
                         Map.class }, new Object[] { providerFactory, props });
             } catch (Throwable e) {
                 throw new Exception(e);
             }
 
             // setup mappings
-            PrivateAccessor.setField(resFac, "mappings", new Mapping[] { new Mapping("/-/"),
new Mapping(rootPath + "/-/") });
+            PrivateAccessor.setField(activator, "mappings", new Mapping[] { new Mapping("/-/"),
new Mapping(rootPath + "/-/") });
 
             // ensure namespace mangling
-            PrivateAccessor.setField(resFac, "mangleNamespacePrefixes", true);
+            PrivateAccessor.setField(activator, "mangleNamespacePrefixes", true);
 
             // setup mapping root
-            PrivateAccessor.setField(resFac, "mapRoot", "/etc/map");
+            PrivateAccessor.setField(activator, "mapRoot", "/etc/map");
             
             final EventAdmin mockVoidEA = new EventAdmin() {
 
@@ -107,6 +108,7 @@ public class PerformanceTest extends Abs
                     // nothing to do
                 }
             };
+            ResourceResolverFactoryImpl resFac = new ResourceResolverFactoryImpl(activator);
 
             mapEntries = new MapEntries(resFac, mock(BundleContext.class), mockVoidEA);
             PrivateAccessor.setField(resFac, "mapEntries", mapEntries);



Mime
View raw message