jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r765532 - in /jackrabbit/trunk: jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/ jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/ jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/
Date Thu, 16 Apr 2009 09:17:53 GMT
Author: mreutegg
Date: Thu Apr 16 09:17:53 2009
New Revision: 765532

URL: http://svn.apache.org/viewvc?rev=765532&view=rev
Log:
JCR-1834: JSR 283: Create RepositoryFactory implementation
- test cases

Added:
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/RepositoryFactoryTest.java
  (with props)
Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/JackrabbitRepositoryStub.properties
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/TestAll.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/RepositoryStub.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/JackrabbitRepositoryStub.properties
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/JackrabbitRepositoryStub.properties?rev=765532&r1=765531&r2=765532&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/JackrabbitRepositoryStub.properties
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/JackrabbitRepositoryStub.properties
Thu Apr 16 09:17:53 2009
@@ -43,6 +43,9 @@
 # retention and hold
 javax.jcr.tck.holdname=hold
 
+# repository factory class name
+javax.jcr.tck.repository.factory=org.apache.jackrabbit.core.RepositoryFactoryImpl
+
 # sample for per test case config overriding
 # Test class: AddNodeText
 # Test method: testName

Added: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/RepositoryFactoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/RepositoryFactoryTest.java?rev=765532&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/RepositoryFactoryTest.java
(added)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/RepositoryFactoryTest.java
Thu Apr 16 09:17:53 2009
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.api.jsr283;
+
+import java.util.Collections;
+
+import javax.jcr.RepositoryException;
+
+import org.apache.jackrabbit.test.AbstractJCRTest;
+import org.apache.jackrabbit.test.RepositoryStub;
+
+/**
+ * <code>RepositoryFactoryTest</code> checks if there is a repository factory
+ * implementation and that is works according to the spec.
+ */
+public class RepositoryFactoryTest extends AbstractJCRTest {
+
+    public void testDefaultRepository() throws Exception {
+        // must not throw
+        getRepositoryFactory().getRepository(null);
+    }
+
+    public void testEmptyParameters() throws Exception {
+        // must not throw
+        getRepositoryFactory().getRepository(Collections.EMPTY_MAP);
+    }
+
+    protected RepositoryFactory getRepositoryFactory()
+            throws RepositoryException {
+        String className = getProperty(RepositoryStub.REPOSITORY_FACTORY);
+        if (className == null) {
+            fail("Property '" + RepositoryStub.REPOSITORY_FACTORY + "' is not defined.");
+        } else {
+            try {
+                return (RepositoryFactory) Class.forName(className).newInstance();
+            } catch (Exception e) {
+                fail(e.toString());
+            }
+        }
+        return null;
+    }
+}

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/RepositoryFactoryTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/TestAll.java?rev=765532&r1=765531&r2=765532&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/TestAll.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/TestAll.java
Thu Apr 16 09:17:53 2009
@@ -25,13 +25,12 @@
 /** <code>TestAll</code>... */
 public class TestAll extends TestCase {
 
-    private static Logger log = LoggerFactory.getLogger(TestAll.class);
-
     public static Test suite() {
         TestSuite suite = new TestSuite("org.apache.jackrabbit.api.jsr283 tests");
 
-        suite.addTestSuite(WorkspaceTest.class);
+        suite.addTestSuite(RepositoryFactoryTest.class);
         suite.addTestSuite(SessionRemoveItemTest.class);
+        suite.addTestSuite(WorkspaceTest.class);
 
         return suite;
     }

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/RepositoryStub.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/RepositoryStub.java?rev=765532&r1=765531&r2=765532&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/RepositoryStub.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/RepositoryStub.java
Thu Apr 16 09:17:53 2009
@@ -114,6 +114,10 @@
      */
     public static final String PROP_HOLD_NAME = "holdname";
 
+    /**
+     * @since JCR 2.0
+     */
+    public static final String REPOSITORY_FACTORY = "repository.factory";
 
     protected final Properties environment;
 



Mime
View raw message