jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1183335 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/JackrabbitRepositoryStub.java
Date Fri, 14 Oct 2011 12:43:50 GMT
Author: jukka
Date: Fri Oct 14 12:43:50 2011
New Revision: 1183335

URL: http://svn.apache.org/viewvc?rev=1183335&view=rev
Log:
JCR-3114: expose PM for versioning manager so that the consistency check can be run from test
cases

JackrabbitRepositoryStub.getRepositoryContext(repository) will give you the repository context

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/JackrabbitRepositoryStub.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/JackrabbitRepositoryStub.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/JackrabbitRepositoryStub.java?rev=1183335&r1=1183334&r2=1183335&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/JackrabbitRepositoryStub.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/JackrabbitRepositoryStub.java
Fri Oct 14 12:43:50 2011
@@ -83,15 +83,16 @@ public class JackrabbitRepositoryStub ex
         }));
     }
 
-    public static RepositoryContext getCurrentRepositoryContext() {
+    public static RepositoryContext getRepositoryContext(
+            Repository repository) {
         synchronized (REPOSITORY_INSTANCES) {
-            for (Repository repo : REPOSITORY_INSTANCES.values()) {
-                if (repo instanceof RepositoryImpl) {
-                    return ((RepositoryImpl) repo).context;
+            for (Repository r : REPOSITORY_INSTANCES.values()) {
+                if (r == repository) {
+                    return ((RepositoryImpl) r).context;
                 }
             }
         }
-        return null;
+        throw new RuntimeException("Not a test repository: " + repository);
     }
 
     private static Properties getStaticProperties() {



Mime
View raw message