jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r791475 - in /jackrabbit/trunk: jackrabbit-core/ jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/ jackrabbit-spi2jcr/
Date Mon, 06 Jul 2009 13:12:46 GMT
Author: reschke
Date: Mon Jul  6 13:12:46 2009
New Revision: 791475

URL: http://svn.apache.org/viewvc?rev=791475&view=rev
Log:
JCR-2085: start work on Activities test (and record known.issue wrt to node path of activity
resource)

Added:
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/ActivitiesTest.java
Modified:
    jackrabbit/trunk/jackrabbit-core/pom.xml
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/TestAll.java
    jackrabbit/trunk/jackrabbit-spi2jcr/pom.xml

Modified: jackrabbit/trunk/jackrabbit-core/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/pom.xml?rev=791475&r1=791474&r2=791475&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/pom.xml (original)
+++ jackrabbit/trunk/jackrabbit-core/pom.xml Mon Jul  6 13:12:46 2009
@@ -92,6 +92,7 @@
               <value>
                 org.apache.jackrabbit.core.xml.DocumentViewTest#testMultiValue
                 org.apache.jackrabbit.test.api.NodeReadMethodsTest#testGetPropertiesNamePatternArray
+                org.apache.jackrabbit.test.api.version.ActivitiesTest#testCreateRemoveActivity
               </value>
             </property>
           </systemProperties>

Added: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/ActivitiesTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/ActivitiesTest.java?rev=791475&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/ActivitiesTest.java
(added)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/ActivitiesTest.java
Mon Jul  6 13:12:46 2009
@@ -0,0 +1,66 @@
+/*
+ * 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.test.api.version;
+
+import javax.jcr.Node;
+import javax.jcr.Repository;
+import javax.jcr.nodetype.NodeType;
+import javax.jcr.version.VersionManager;
+
+
+/**
+ * <code>ActivitiesTest</code> covers methods related to the Activities
+ * feature in Versioning.
+ * @test
+ * @sources ActivitiesTest.java
+ * @executeClass org.apache.jackrabbit.test.api.version.ActivitiesTest
+ * @keywords versioning
+ * @since JCR 2.0
+ */
+public class ActivitiesTest extends AbstractVersionTest {
+
+    protected void setUp() throws Exception {
+        super.setUp();
+        checkSupportedOption(Repository.OPTION_ACTIVITIES_SUPPORTED);
+    }
+
+    protected void tearDown() throws Exception {
+        super.tearDown();
+    }
+
+    public void testCreateRemoveActivity() throws Exception {
+        
+        VersionManager vm = superuser.getWorkspace().getVersionManager();
+        Node an = null;
+        
+        try {
+            an = vm.createActivity("foobar");
+            assertNotNull(an);
+            
+            NodeType annt = an.getPrimaryNodeType();
+            assertTrue("create node must be subtype of nt:activity", annt.isNodeType("nt:activity"));
+
+            String pathprefix = "/jcr:system/jcr:activities/";
+            assertTrue("path for activity must be below " + pathprefix + ", but was " + an.getPath(),
an.getPath().startsWith(pathprefix));
+        }
+        finally {
+            if (an != null) {
+                vm.removeActivity(an);
+            }
+        }
+    }
+}

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/TestAll.java?rev=791475&r1=791474&r2=791475&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/TestAll.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/TestAll.java
Mon Jul  6 13:12:46 2009
@@ -66,6 +66,10 @@
         suite.addTestSuite(MergeNodeTest.class);
         suite.addTestSuite(MergeNonVersionableSubNodeTest.class);
         suite.addTestSuite(MergeSubNodeTest.class);
+        
+        // JCR 2.0
+
+        suite.addTestSuite(ActivitiesTest.class);
 
         return suite;
     }

Modified: jackrabbit/trunk/jackrabbit-spi2jcr/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2jcr/pom.xml?rev=791475&r1=791474&r2=791475&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2jcr/pom.xml (original)
+++ jackrabbit/trunk/jackrabbit-spi2jcr/pom.xml Mon Jul  6 13:12:46 2009
@@ -72,6 +72,7 @@
                 org.apache.jackrabbit.test.api.ShareableNodeTest
                 org.apache.jackrabbit.test.api.version.simple
                 org.apache.jackrabbit.test.api.NodeReadMethodsTest#testGetPropertiesNamePatternArray
+                org.apache.jackrabbit.test.api.version.ActivitiesTest#testCreateRemoveActivity
               </value>
             </property>
           </systemProperties>



Mime
View raw message