jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r771322 - in /jackrabbit/trunk: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/ jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/retention/
Date Mon, 04 May 2009 14:50:34 GMT
Author: reschke
Date: Mon May  4 14:50:33 2009
New Revision: 771322

URL: http://svn.apache.org/viewvc?rev=771322&view=rev
Log:
JCR-2085: activate retention tests, obtain RetentionPolicy instance from repository stub

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/JackrabbitRepositoryStub.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/JCRTestSuite.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/JNDIRepositoryStub.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/RepositoryHelper.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/RepositoryStub.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/retention/AbstractRetentionTest.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=771322&r1=771321&r2=771322&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
Mon May  4 14:50:33 2009
@@ -22,7 +22,6 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.lang.annotation.RetentionPolicy;
 import java.util.Arrays;
 import java.util.Calendar;
 import java.util.HashSet;
@@ -37,6 +36,7 @@
 import javax.jcr.Session;
 import javax.jcr.Value;
 import javax.jcr.ValueFactory;
+import javax.jcr.retention.RetentionPolicy;
 
 import org.apache.commons.io.IOUtils;
 import org.apache.jackrabbit.api.JackrabbitNodeTypeManager;
@@ -44,6 +44,7 @@
 import org.apache.jackrabbit.core.config.RepositoryConfig;
 import org.apache.jackrabbit.core.retention.RetentionPolicyImpl;
 import org.apache.jackrabbit.core.retention.RetentionRegistryImpl;
+import org.apache.jackrabbit.test.NotExecutableException;
 import org.apache.jackrabbit.test.RepositoryStub;
 import org.apache.jackrabbit.test.RepositoryStubException;
 
@@ -175,6 +176,10 @@
         return repository;
     }
 
+    public RetentionPolicy getRetentionPolicy(Session session) throws NotExecutableException,
RepositoryException {
+        return RetentionPolicyImpl.createRetentionPolicy(RepositoryStub.RETENTION_POLICY_NAME,
session);
+    }
+
     private void prepareTestContent(Session session)
             throws RepositoryException, IOException {
         JackrabbitWorkspace workspace =

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/JCRTestSuite.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/JCRTestSuite.java?rev=771322&r1=771321&r2=771322&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/JCRTestSuite.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/JCRTestSuite.java
Mon May  4 14:50:33 2009
@@ -32,6 +32,7 @@
         addTest(org.apache.jackrabbit.test.api.lock.TestAll.suite());
         addTest(org.apache.jackrabbit.test.api.version.TestAll.suite());
         addTest(org.apache.jackrabbit.test.api.observation.TestAll.suite());
+        addTest(org.apache.jackrabbit.test.api.retention.TestAll.suite());
     }
 
 }

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/JNDIRepositoryStub.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/JNDIRepositoryStub.java?rev=771322&r1=771321&r2=771322&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/JNDIRepositoryStub.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/JNDIRepositoryStub.java
Mon May  4 14:50:33 2009
@@ -17,6 +17,9 @@
 package org.apache.jackrabbit.test;
 
 import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.retention.RetentionPolicy;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import javax.rmi.PortableRemoteObject;
@@ -63,4 +66,9 @@
         return repository;
     }
 
+    public RetentionPolicy getRetentionPolicy(Session session) throws NotExecutableException,
RepositoryException {
+        // TODO
+        throw new NotExecutableException("");
+    }
+
 }

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/RepositoryHelper.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/RepositoryHelper.java?rev=771322&r1=771321&r2=771322&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/RepositoryHelper.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/RepositoryHelper.java
Mon May  4 14:50:33 2009
@@ -20,6 +20,8 @@
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.Credentials;
+import javax.jcr.retention.RetentionPolicy;
+
 import java.util.Map;
 import java.util.HashMap;
 
@@ -186,4 +188,9 @@
     public Credentials getSuperuserCredentials() {
         return repoStub.getSuperuserCredentials();
     }
+    
+    public RetentionPolicy getRetentionPolicy(Session session) throws NotExecutableException,
RepositoryException {
+        return repoStub.getRetentionPolicy(session);
+    }
+    
 }

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=771322&r1=771321&r2=771322&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
Mon May  4 14:50:33 2009
@@ -18,7 +18,11 @@
 
 import javax.jcr.Credentials;
 import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
 import javax.jcr.SimpleCredentials;
+import javax.jcr.retention.RetentionPolicy;
+
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
@@ -297,4 +301,10 @@
     public String getProperty(String name) {
         return environment.getProperty(name);
     }
+    
+    /**
+     * Return a retention policy for testing.
+     * @return retention policy
+     */
+    public abstract RetentionPolicy getRetentionPolicy(Session session) throws NotExecutableException,
RepositoryException;
 }

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/retention/AbstractRetentionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/retention/AbstractRetentionTest.java?rev=771322&r1=771321&r2=771322&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/retention/AbstractRetentionTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/retention/AbstractRetentionTest.java
Mon May  4 14:50:33 2009
@@ -53,11 +53,7 @@
     }
 
     protected RetentionPolicy getApplicableRetentionPolicy() throws NotExecutableException,
RepositoryException {
-        return getApplicableRetentionPolicy(RepositoryStub.RETENTION_POLICY_NAME);
-    }
-
-    protected RetentionPolicy getApplicableRetentionPolicy(String jcrName) throws NotExecutableException,
RepositoryException {
-        return retentionMgr.getRetentionPolicy(jcrName);
+        return helper.getRetentionPolicy(superuser);
     }
 
     protected static RetentionManager getRetentionManager(Session s) throws RepositoryException,
NotExecutableException {



Mime
View raw message