jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1160657 - in /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test: java/org/apache/jackrabbit/spi2microkernel/tck/ resources/org/ resources/org/apache/ resources/org/apache/jackrabbit/ resources/org/apache/jackrabbit/spi2m...
Date Tue, 23 Aug 2011 12:29:42 GMT
Author: mduerig
Date: Tue Aug 23 12:29:41 2011
New Revision: 1160657

URL: http://svn.apache.org/viewvc?rev=1160657&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP)
- tests: add test node types

Added:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/tck/TestContent.java
      - copied, changed from r1160607, jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/tck/TestContentLoader.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/resources/org/
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/resources/org/apache/
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/resources/org/apache/jackrabbit/
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/resources/org/apache/jackrabbit/spi2microkernel/
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/resources/org/apache/jackrabbit/spi2microkernel/tck/
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/resources/org/apache/jackrabbit/spi2microkernel/tck/test-nodetypes.cnd
Removed:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/tck/TestContentLoader.java
Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/tck/RepositoryStubImpl.java

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/tck/RepositoryStubImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/tck/RepositoryStubImpl.java?rev=1160657&r1=1160656&r2=1160657&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/tck/RepositoryStubImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/tck/RepositoryStubImpl.java
Tue Aug 23 12:29:41 2011
@@ -106,7 +106,7 @@ public class RepositoryStubImpl extends 
     private static void loadTestContent(Repository rep) throws Exception {
         Session session = rep.login();
         try {
-            TestContentLoader.loadTestContent(session);
+            TestContent.load(session);
         }
         finally {
             session.logout();

Copied: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/tck/TestContent.java
(from r1160607, jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/tck/TestContentLoader.java)
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/tck/TestContent.java?p2=jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/tck/TestContent.java&p1=jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/tck/TestContentLoader.java&r1=1160607&r2=1160657&rev=1160657&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/tck/TestContentLoader.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/tck/TestContent.java
Tue Aug 23 12:29:41 2011
@@ -17,6 +17,8 @@
 package org.apache.jackrabbit.spi2microkernel.tck;
 
 import org.apache.jackrabbit.commons.JcrUtils;
+import org.apache.jackrabbit.commons.cnd.CndImporter;
+import org.apache.jackrabbit.commons.cnd.ParseException;
 
 import javax.jcr.Node;
 import javax.jcr.PathNotFoundException;
@@ -29,6 +31,8 @@ import javax.jcr.Workspace;
 import javax.jcr.nodetype.NodeType;
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
 import java.util.Arrays;
 import java.util.Calendar;
 import java.util.Collection;
@@ -36,15 +40,15 @@ import java.util.Collection;
 /**
  * Test Content Loader.
  */
-public class TestContentLoader {
-    private TestContentLoader() {}
+public class TestContent {
+    private TestContent() {}
 
     /**
      * The encoding of the test resources.
      */
     private static final String ENCODING = "UTF-8";
 
-    public static void loadTestContent(Session session) throws RepositoryException, IOException
{
+    public static void load(Session session) throws RepositoryException, IOException, ParseException
{
         Workspace workspace = session.getWorkspace();
         Collection<String> workspaces = Arrays.asList(workspace.getAccessibleWorkspaceNames());
 
@@ -52,18 +56,13 @@ public class TestContentLoader {
             workspace.createWorkspace("test");
         }
 
-//        JackrabbitNodeTypeManager manager =
-//            (JackrabbitNodeTypeManager) workspace.getNodeTypeManager();
-//        if (!manager.hasNodeType("test:versionable")) {
-//            InputStream xml =
-//                TestContentLoader.class.getResourceAsStream("test-nodetypes.xml");
-//            try {
-//                manager.registerNodeTypes(xml, JackrabbitNodeTypeManager.TEXT_XML);
-//            }
-//            finally {
-//                xml.close();
-//            }
-//        }
+        Reader reader = new InputStreamReader(TestContent.class.getResourceAsStream("test-nodetypes.cnd"));
+        try {
+            CndImporter.registerNodeTypes(reader, session);
+        }
+        finally {
+            reader.close();
+        }
 
         Node data = getOrAddNode(session.getRootNode(), "testdata");
         addPropertyTestData(getOrAddNode(data, "property"));

Added: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/resources/org/apache/jackrabbit/spi2microkernel/tck/test-nodetypes.cnd
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/resources/org/apache/jackrabbit/spi2microkernel/tck/test-nodetypes.cnd?rev=1160657&view=auto
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/resources/org/apache/jackrabbit/spi2microkernel/tck/test-nodetypes.cnd
(added)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/resources/org/apache/jackrabbit/spi2microkernel/tck/test-nodetypes.cnd
Tue Aug 23 12:29:41 2011
@@ -0,0 +1,92 @@
+/*
+ * 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.
+ */
+<'test'='http://www.apache.org/jackrabbit/test'>
+<'nt'='http://www.jcp.org/jcr/nt/1.0'>
+<'mix'='http://www.jcp.org/jcr/mix/1.0'>
+
+[test:sameNameSibsFalseChildNodeDefinition] > nt:base
+  - * (undefined) nofulltext noqueryorder
+  + * (nt:base) = test:sameNameSibsFalseChildNodeDefinition compute
+
+[test:setProperty] > mix:referenceable, nt:base
+  - test:multiProperty (undefined) multiple nofulltext noqueryorder
+  - * (undefined) nofulltext noqueryorder
+  + * (nt:base) = test:setProperty
+
+[test:canSetProperty] > nt:base
+  - BinaryMultipleConstraints (binary) multiple nofulltext noqueryorder < '(,100)'
+  - Boolean (boolean) nofulltext noqueryorder
+  - DateConstraints (date) nofulltext noqueryorder < '(1974-02-15T00:00:00.000Z,)'
+  - NameConstraints (name) nofulltext noqueryorder < 'abc'
+  - LongMultipleConstraints (long) multiple nofulltext noqueryorder < '(,100)'
+  - ReferenceMultipleConstraints (reference) multiple nofulltext noqueryorder < 'test:canSetProperty'
+  - StringMultiple (string) multiple nofulltext noqueryorder
+  - DoubleMultiple (double) multiple nofulltext noqueryorder
+  - DoubleConstraints (double) nofulltext noqueryorder < '(100,)'
+  - BinaryConstraints (binary) nofulltext noqueryorder < '(,100)'
+  - PathMultiple (path) multiple nofulltext noqueryorder
+  - Path (path) nofulltext noqueryorder
+  - StringMultipleConstraints (string) multiple nofulltext noqueryorder < 'abc', 'def',
'ghi'
+  - PathMultipleConstraints (path) multiple nofulltext noqueryorder < '/abc'
+  - DateMultiple (date) multiple nofulltext noqueryorder
+  - Binary (binary) nofulltext noqueryorder
+  - LongMultiple (long) multiple nofulltext noqueryorder
+  - LongConstraints (long) nofulltext noqueryorder < '(100,)'
+  - BooleanConstraints (boolean) nofulltext noqueryorder < 'true'
+  - BinaryMultiple (binary) multiple nofulltext noqueryorder
+  - Long (long) nofulltext noqueryorder
+  - StringConstraints (string) nofulltext noqueryorder < 'abc', 'def', 'ghi'
+  - Date (date) nofulltext noqueryorder
+  - ReferenceConstraints (reference) nofulltext noqueryorder < 'test:canSetProperty'
+  - Double (double) nofulltext noqueryorder
+  - NameMultipleConstraints (name) multiple nofulltext noqueryorder < 'abc'
+  - BooleanMultiple (boolean) multiple nofulltext noqueryorder
+  - Name (name) nofulltext noqueryorder
+  - PathConstraints (path) nofulltext noqueryorder < '/abc'
+  - String (string) nofulltext noqueryorder
+  - NameMultiple (name) multiple nofulltext noqueryorder
+  - BooleanMultipleConstraints (boolean) multiple nofulltext noqueryorder < 'true'
+  - DateMultipleConstraints (date) multiple nofulltext noqueryorder < '(,1974-02-15T00:00:00.000Z)'
+  - DoubleMultipleConstraints (double) multiple nofulltext noqueryorder < '(,100)'
+
+[test:canAddChildNode] > nt:base
+  + testChildWithDefaultType (nt:base) = nt:base
+  + testChildWithoutDefaultType (nt:base)
+
+[test:refTargetNode] > mix:versionable, nt:base
+  - * (undefined) nofulltext noqueryorder
+
+[test:versionable] > mix:versionable, nt:base
+  - test:initializeOnParentVersionProp (string) initialize nofulltext noqueryorder
+  - test:copyOnParentVersionProp (string) nofulltext noqueryorder
+  - test:abortOnParentVersionProp (string) abort nofulltext noqueryorder
+  - test:ignoreOnParentVersionProp (string) ignore nofulltext noqueryorder
+  - test:computeOnParentVersionProp (string) compute nofulltext noqueryorder
+  - test:versionOnParentVersionProp (string) version nofulltext noqueryorder
+  - * (undefined) nofulltext noqueryorder
+  + test:computeOnParentVersion (nt:base) = nt:unstructured compute
+  + test:initializeOnParentVersion (nt:base) = nt:unstructured initialize
+  + test:versionOnParentVersion (nt:base) = nt:unstructured version
+  + * (nt:base) = test:versionable
+  + test:ignoreOnParentVersion (nt:base) = nt:unstructured ignore
+  + test:abortOnParentVersion (nt:base) = nt:unstructured abort
+  + test:copyOnParentVersion (nt:base) = nt:unstructured
+
+[test:setPropertyAssumingType] > nt:base
+  - test:multiProperty (undefined) multiple nofulltext noqueryorder
+  - test:singleProperty (undefined) nofulltext noqueryorder
+  + * (nt:base) = test:setPropertyAssumingType



Mime
View raw message