jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1378180 - /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/AbstractQueryTest.java
Date Tue, 28 Aug 2012 15:37:19 GMT
Author: alexparvulescu
Date: Tue Aug 28 15:37:18 2012
New Revision: 1378180

URL: http://svn.apache.org/viewvc?rev=1378180&view=rev
Log:
OAK-269 Query: IndexManager to manage existing indexes
 - reverted previous change

Modified:
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/AbstractQueryTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/AbstractQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/AbstractQueryTest.java?rev=1378180&r1=1378179&r2=1378180&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/AbstractQueryTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/AbstractQueryTest.java
Tue Aug 28 15:37:18 2012
@@ -16,44 +16,37 @@
  */
 package org.apache.jackrabbit.oak.query;
 
-import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.core.MicroKernelImpl;
-import org.apache.jackrabbit.oak.AbstractOakTest;
-import org.apache.jackrabbit.oak.api.ContentRepository;
+import org.apache.jackrabbit.mk.index.IndexWrapper;
 import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.api.CoreValueFactory;
 import org.apache.jackrabbit.oak.api.SessionQueryEngine;
 import org.apache.jackrabbit.oak.core.ContentRepositoryImpl;
-import org.apache.jackrabbit.oak.plugins.index.PropertyIndexFactory;
-import org.apache.jackrabbit.oak.spi.query.IndexManager;
-import org.apache.jackrabbit.oak.spi.query.IndexManagerImpl;
-import org.apache.jackrabbit.oak.spi.query.IndexUtils;
-import org.junit.Before;
+import org.apache.jackrabbit.oak.spi.commit.ValidatorProvider;
+
+import javax.jcr.GuestCredentials;
 
 /**
  * AbstractQueryTest...
  */
-public abstract class AbstractQueryTest extends AbstractOakTest {
-
-    protected MicroKernel mk;
-    protected ContentSession session;
-    protected CoreValueFactory vf;
-    protected SessionQueryEngine qe;
-
-    @Override
-    protected ContentRepository createRepository() {
-        mk = new MicroKernelImpl();
-        IndexManager im = new IndexManagerImpl(IndexUtils.DEFAULT_INDEX_HOME,
-                mk, new PropertyIndexFactory());
-        return new ContentRepositoryImpl(mk, null, im);
-    }
+public abstract class AbstractQueryTest {
 
-    @Before
-    public void before() throws Exception {
-        super.before();
-        session = createGuestSession();
-        vf = session.getCoreValueFactory();
-        qe = session.getQueryEngine();
+    protected final IndexWrapper mk;
+    protected final ContentRepositoryImpl rep;
+    protected final CoreValueFactory vf;
+    protected final SessionQueryEngine qe;
+    protected final ContentSession session;
+
+    {
+        mk = new IndexWrapper(new MicroKernelImpl());
+        rep = new ContentRepositoryImpl(mk, null, (ValidatorProvider) null);
+        try {
+            session = rep.login(new GuestCredentials(), "default");
+            vf = session.getCoreValueFactory();
+            qe = session.getQueryEngine();
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
     }
 
 }
\ No newline at end of file



Mime
View raw message