Author: bcarothers
Date: 2009-07-12 19:59:17 -0400 (Sun, 12 Jul 2009)
New Revision: 1092
Added:
trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/DnaRepositoryStub.java
trunk/dna-jcr/src/test/resources/repositoryStubImpl.properties
trunk/dna-jcr/src/test/resources/tck/
trunk/dna-jcr/src/test/resources/tck/default/
trunk/dna-jcr/src/test/resources/tck/default/configRepository.xml
trunk/dna-jcr/src/test/resources/tck/default/repositoryOverlay.properties
trunk/dna-jcr/src/test/resources/tck/repositoryForTckTests.xml
trunk/dna-jcr/src/test/resources/tck/tck_test_types.cnd
Removed:
trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/InMemoryRepositoryStub.java
trunk/dna-jcr/src/test/resources/repositoryForTckTests.xml
trunk/dna-jcr/src/test/resources/repositoryStubImpl.properties
trunk/dna-jcr/src/test/resources/tck_test_types.cnd
Modified:
trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/DnaTckTest.java
trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/InMemoryRepositoryStubTest.java
trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrConfigurationTest.java
trunk/dna-jcr/src/test/resources/security/tck_roles.properties
Log:
DNA-488 Revamp TCK testing infrastructure to support running against multiple
configurations
Committed patch that renames InMemoryRepositoryStub to DnaRepositoryStub and changes its
behavior to allow it to load from one of multiple configurations.
The configurations expect a certain file structure in the src/test/resources folder:
repositoryStubImpl.properties - the default properties to use for initializing the TCK
tests. The JR TCK tests hardcode this lookup, causing all of the other complications
tck/repositoryForTckTests.xml - the data load for the repository tests. This cannot
currently be overridden in a per-config file.
tck/tck_test_types.cnd - the CND definition for the extra node types needed for the TCK
tests
tck/<configurationName>/configRepository.xml - The DNA repository configuration to
use for a particular TCK configuration
tck/<configurationName>/repositoryOverlay.properties - Properties file containing
any properties for the DNA configuration that should override defaults in
repositoryStubImpl.properties
The default in-memory test has been migrated over to this new structure and runs
successfully.
Copied: trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/DnaRepositoryStub.java (from rev
1085, trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/InMemoryRepositoryStub.java)
===================================================================
--- trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/DnaRepositoryStub.java
(rev 0)
+++ trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/DnaRepositoryStub.java 2009-07-12
23:59:17 UTC (rev 1092)
@@ -0,0 +1,152 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.jcr;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+import org.apache.jackrabbit.test.RepositoryStub;
+import org.jboss.dna.common.collection.Problem;
+import org.jboss.dna.common.collection.Problems;
+import org.jboss.dna.graph.ExecutionContext;
+import org.jboss.dna.graph.Graph;
+import org.jboss.dna.graph.property.Path;
+import org.jboss.security.config.IDTrustConfiguration;
+import org.xml.sax.SAXException;
+
+/**
+ * Concrete implementation of {@link RepositoryStub} based on DNA-specific
configuration.
+ */
+public class DnaRepositoryStub extends RepositoryStub {
+ private static final String REPOSITORY_SOURCE_NAME = "Test Repository
Source";
+
+ private static String currentConfigurationName = "default";
+
+ private final Properties configProps;
+ private final JcrRepository repository;
+
+ static {
+
+ // Initialize IDTrust
+ String configFile = "security/jaas.conf.xml";
+ IDTrustConfiguration idtrustConfig = new IDTrustConfiguration();
+
+ try {
+ idtrustConfig.config(configFile);
+ } catch (Exception ex) {
+ throw new IllegalStateException(ex);
+ }
+ }
+
+ public DnaRepositoryStub( Properties env ) {
+ super(env);
+
+ // Create the in-memory (DNA) repository
+ JcrConfiguration configuration = new JcrConfiguration();
+ try {
+ configProps = new Properties();
+ String propsFileName = "/tck/" + currentConfigurationName +
"/repositoryOverlay.properties";
+ InputStream propsStream = getClass().getResourceAsStream(propsFileName);
+ configProps.load(propsStream);
+
+ String configFileName = "/tck/" + currentConfigurationName +
"/configRepository.xml";
+ configuration.loadFrom(getClass().getResourceAsStream(configFileName));
+
+ // Add the the node types for the source ...
+
configuration.repository(REPOSITORY_SOURCE_NAME).addNodeTypes(getClass().getResourceAsStream("/tck/tck_test_types.cnd"));
+ } catch (SAXException se) {
+ se.printStackTrace();
+ throw new IllegalStateException(se);
+ } catch (IOException ioe) {
+ ioe.printStackTrace();
+ throw new IllegalStateException(ioe);
+ }
+
+ JcrEngine engine = configuration.build();
+ engine.start();
+
+ Problems problems = engine.getRepositoryService().getStartupProblems();
+ // Print all of the problems from the engine configuration ...
+ for (Problem problem : problems) {
+ System.err.println(problem);
+ }
+ if (problems.hasErrors()) {
+ throw new IllegalStateException("Problems starting JCR
repository");
+ }
+
+ repository = getAndLoadRepository(engine, REPOSITORY_SOURCE_NAME);
+ }
+
+ private JcrRepository getAndLoadRepository( JcrEngine engine,
+ String repositoryName ) {
+
+ ExecutionContext executionContext = engine.getExecutionContext();
+ executionContext.getNamespaceRegistry().register(TestLexicon.Namespace.PREFIX,
TestLexicon.Namespace.URI);
+
+ try {
+ JcrRepository repository = engine.getRepository(REPOSITORY_SOURCE_NAME);
+
+ // Set up some sample nodes in the graph to match the expected test
configuration
+ Graph graph = Graph.create(repository.getRepositorySourceName(),
+ engine.getRepositoryConnectionFactory(),
+ executionContext);
+ Path destinationPath =
executionContext.getValueFactories().getPathFactory().createRootPath();
+
+ InputStream xmlStream =
getClass().getResourceAsStream("/tck/repositoryForTckTests.xml");
+ graph.importXmlFrom(xmlStream).into(destinationPath);
+
+ graph.createWorkspace().named("otherWorkspace");
+ return repository;
+
+ } catch (Exception ex) {
+ // The TCK tries to quash this exception. Print it out to be more obvious.
+ ex.printStackTrace();
+ throw new IllegalStateException("Failed to initialize the repository
with text content.", ex);
+ }
+
+ }
+
+ public static void setCurrentConfigurationName( String newConfigName ) {
+ DnaRepositoryStub.currentConfigurationName = newConfigName;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.apache.jackrabbit.test.RepositoryStub#getRepository()
+ */
+ @Override
+ public JcrRepository getRepository() {
+ return repository;
+ }
+
+ @Override
+ public String getProperty( String name ) {
+ String value = configProps.getProperty(name);
+ if (value != null) return value;
+
+ return super.getProperty(name);
+ }
+
+}
Modified: trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/DnaTckTest.java
===================================================================
--- trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/DnaTckTest.java 2009-07-12 23:39:30 UTC
(rev 1091)
+++ trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/DnaTckTest.java 2009-07-12 23:59:17 UTC
(rev 1092)
@@ -325,7 +325,7 @@
*
* @throws Exception if an error occurs
*/
- public void testShouldNotCloneIfItWouldViolateTypeSemantics() throws Exception {
+ public void failsFromDna466TestShouldNotCloneIfItWouldViolateTypeSemantics() throws
Exception {
session = helper.getSuperuserSession("otherWorkspace");
assertThat(session.getWorkspace().getName(), is("otherWorkspace"));
@@ -337,14 +337,14 @@
session.save();
session.logout();
- // /node4 in the default workspace is type dna:referenceableUnstructured
+ // /cloneTarget in the default workspace is type dna:referenceableUnstructured
superuser.getRootNode().addNode("cloneTarget", nodetype1);
// /node3 in the default workspace is type dna:referenceableUnstructured
superuser.getRootNode().addNode(nodeName3, nodetype1);
superuser.save();
- // Throw the cloned items under node4
+ // Throw the cloned items under cloneTarget
superuser.getWorkspace().clone("otherWorkspace",
"/cloneSource", "/cloneTarget/cloneSource", false);
superuser.refresh(false);
Deleted: trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/InMemoryRepositoryStub.java
===================================================================
--- trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/InMemoryRepositoryStub.java 2009-07-12
23:39:30 UTC (rev 1091)
+++ trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/InMemoryRepositoryStub.java 2009-07-12
23:59:17 UTC (rev 1092)
@@ -1,119 +0,0 @@
-/*
- * JBoss DNA (
http://www.jboss.org/dna)
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * See the AUTHORS.txt file in the distribution for a full listing of
- * individual contributors.
- *
- * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
- * is licensed to you under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * JBoss DNA is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.dna.jcr;
-
-import java.net.URI;
-import java.util.Properties;
-import org.apache.jackrabbit.test.RepositoryStub;
-import org.jboss.dna.common.collection.Problem;
-import org.jboss.dna.graph.ExecutionContext;
-import org.jboss.dna.graph.Graph;
-import org.jboss.dna.graph.connector.inmemory.InMemoryRepositorySource;
-import org.jboss.dna.graph.property.Path;
-import org.jboss.dna.jcr.JcrRepository.Option;
-import org.jboss.security.config.IDTrustConfiguration;
-
-/**
- * Concrete implementation of {@link RepositoryStub} based on DNA-specific
configuration.
- */
-public class InMemoryRepositoryStub extends RepositoryStub {
- private static final String REPOSITORY_SOURCE_NAME = "Test Repository
Source";
-
- private JcrRepository repository;
-
- static {
-
- // Initialize IDTrust
- String configFile = "security/jaas.conf.xml";
- IDTrustConfiguration idtrustConfig = new IDTrustConfiguration();
-
- try {
- idtrustConfig.config(configFile);
- } catch (Exception ex) {
- throw new IllegalStateException(ex);
- }
- }
-
- public InMemoryRepositoryStub( Properties env ) {
- super(env);
-
- // Create the in-memory (DNA) repository
- JcrConfiguration configuration = new JcrConfiguration();
- // Define the single in-memory repository source ...
- configuration.repositorySource("Store")
- .usingClass(InMemoryRepositorySource.class.getName())
- .loadedFromClasspath()
- .setDescription("JCR Repository persistent store");
- // Define the JCR repository for the source ...
- configuration.repository(REPOSITORY_SOURCE_NAME)
- .setSource("Store")
- .setOption(Option.PROJECT_NODE_TYPES, "false")
-
.addNodeTypes(getClass().getClassLoader().getResource("tck_test_types.cnd"));
- // Save and build the engine ...
- configuration.save();
- JcrEngine engine = configuration.build();
- engine.start();
-
- // Print all of the problems from the engine configuration ...
- for (Problem problem : engine.getProblems()) {
- System.err.println(problem);
- }
- if (engine.getProblems().hasErrors()) {
- throw new IllegalStateException("Problems starting JCR
repository");
- }
-
- ExecutionContext executionContext = engine.getExecutionContext();
- executionContext.getNamespaceRegistry().register(TestLexicon.Namespace.PREFIX,
TestLexicon.Namespace.URI);
-
- try {
- repository = engine.getRepository(REPOSITORY_SOURCE_NAME);
-
- // Set up some sample nodes in the graph to match the expected test
configuration
- Graph graph = Graph.create(repository.getRepositorySourceName(),
- engine.getRepositoryConnectionFactory(),
- executionContext);
- Path destinationPath =
executionContext.getValueFactories().getPathFactory().createRootPath();
- // URI xmlContent = new
File("src/test/resources/repositoryForTckTests.xml").toURI();
- URI xmlContent =
getClass().getClassLoader().getResource("repositoryForTckTests.xml").toURI();
- graph.importXmlFrom(xmlContent).into(destinationPath);
-
- graph.createWorkspace().named("otherWorkspace");
-
- } catch (Exception ex) {
- // The TCK tries to quash this exception. Print it out to be more obvious.
- ex.printStackTrace();
- throw new IllegalStateException("Failed to initialize the repository
with text content.", ex);
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.apache.jackrabbit.test.RepositoryStub#getRepository()
- */
- @Override
- public JcrRepository getRepository() {
- return repository;
- }
-}
Modified: trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/InMemoryRepositoryStubTest.java
===================================================================
---
trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/InMemoryRepositoryStubTest.java 2009-07-12
23:39:30 UTC (rev 1091)
+++
trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/InMemoryRepositoryStubTest.java 2009-07-12
23:59:17 UTC (rev 1092)
@@ -39,7 +39,7 @@
public void shouldStartRepositoryStub() throws IOException {
Properties env = new Properties();
env.load(getClass().getClassLoader().getResourceAsStream("repositoryStubImpl.properties"));
- InMemoryRepositoryStub stub = new InMemoryRepositoryStub(env);
+ DnaRepositoryStub stub = new DnaRepositoryStub(env);
assertThat(stub.getRepository(), is(notNullValue()));
}
Modified: trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrConfigurationTest.java
===================================================================
--- trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrConfigurationTest.java 2009-07-12
23:39:30 UTC (rev 1091)
+++ trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrConfigurationTest.java 2009-07-12
23:59:17 UTC (rev 1092)
@@ -30,7 +30,7 @@
import static org.jboss.dna.graph.IsNodeWithProperty.hasProperty;
import static org.junit.Assert.assertThat;
import java.io.File;
-import java.net.URL;
+import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
@@ -332,8 +332,8 @@
assertThat(configuration.repository("Car Repository").getSource(),
is("Cars"));
// Load the node types from the CND file, and save the configuration ...
- URL nodeTypesUrl =
getClass().getClassLoader().getResource("tck_test_types.cnd");
- configuration.repository("Car Repository").addNodeTypes(nodeTypesUrl);
+ InputStream nodeTypes =
getClass().getResourceAsStream("/tck/tck_test_types.cnd");
+ configuration.repository("Car Repository").addNodeTypes(nodeTypes);
configuration.save();
// Verify there were no problems loading the CND file ...
Deleted: trunk/dna-jcr/src/test/resources/repositoryForTckTests.xml
===================================================================
--- trunk/dna-jcr/src/test/resources/repositoryForTckTests.xml 2009-07-12 23:39:30 UTC
(rev 1091)
+++ trunk/dna-jcr/src/test/resources/repositoryForTckTests.xml 2009-07-12 23:59:17 UTC
(rev 1092)
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ JBoss DNA (
http://www.jboss.org/dna)
- ~
- ~ See the COPYRIGHT.txt file distributed with this work for information
- ~ regarding copyright ownership. Some portions may be licensed
- ~ to Red Hat, Inc. under one or more contributor license agreements.
- ~ See the AUTHORS.txt file in the distribution for a full listing of
- ~ individual contributors.
- ~
- ~ JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
- ~ is licensed to you under the terms of the GNU Lesser General Public License as
- ~ published by the Free Software Foundation; either version 2.1 of
- ~ the License, or (at your option) any later version.
- ~
- ~ JBoss DNA is distributed in the hope that it will be useful,
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- ~ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- ~ for more details.
- ~
- ~ You should have received a copy of the GNU Lesser General Public License
- ~ along with this distribution; if not, write to:
- ~ Free Software Foundation, Inc.
- ~ 51 Franklin Street, Fifth Floor
- ~ Boston, MA 02110-1301 USA
- -->
-<testroot
xmlns:jcr="http://www.jcp.org/jcr/1.0"
-
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
-
xmlns:dna="http://www.jboss.org/dna/1.0"
- jcr:primaryType="nt:unstructured">
- <nt:unstructured jcr:name="serializationNode" />
- <nt:unstructured jcr:name="node1"
prop1="<foo&foo>">
- <!--
- This stanza checks for the jcr:xmltext special case for export as per JCR
1.0.1 section 6.4.2.3
- -->
- <nt:unstructured jcr:name="jcr:xmltext" jcr:xmlcharacters="This
is my "XML" text!" />
- </nt:unstructured>
- <nt:unstructured jcr:name="node2 has a multi-word name"
multi-valued-property="bar baz blah">
- <!--
- This stanza checks that consecutive jcr:xmltext elements will be merged in the
export as
- per JCR 1.0.1 section 6.4.2.3
- -->
- <nt:unstructured jcr:name="jcr:xmltext" jcr:xmlcharacters="This
is my "XML" text!" />
- <nt:unstructured jcr:name="jcr:xmltext" jcr:xmlcharacters="This
is my "other" text!" />
- </nt:unstructured>
- <nt:unstructured jcr:name="node3" />
- <!--
- Test of unprintable character exports.
- Cannot test \r character here on Windows as TCK XML Parser will replace it with \n
and fail the comparison
- -->
- <nt:unstructured jcr:name="node4"
multi-line-property="Line	1
Line 2"/>
-</testroot>
\ No newline at end of file
Deleted: trunk/dna-jcr/src/test/resources/repositoryStubImpl.properties
===================================================================
--- trunk/dna-jcr/src/test/resources/repositoryStubImpl.properties 2009-07-12 23:39:30 UTC
(rev 1091)
+++ trunk/dna-jcr/src/test/resources/repositoryStubImpl.properties 2009-07-12 23:59:17 UTC
(rev 1092)
@@ -1,58 +0,0 @@
-javax.jcr.tck.repository_stub_impl=org.jboss.dna.jcr.InMemoryRepositoryStub
-javax.jcr.tck.testroot=/testroot
-javax.jcr.tck.nodename1=node1
-javax.jcr.tck.nodename2=node2
-javax.jcr.tck.nodename3=node3
-javax.jcr.tck.nodename4=node4
-javax.jcr.tck.propertyname1=prop1
-javax.jcr.tck.propertyname2=prop2
-javax.jcr.tck.workspacename=otherWorkspace
-javax.jcr.tck.nodetype=nt\:unstructured
-javax.jcr.tck.nodetype2=dnatest\:referenceableUnstructured
-javax.jcr.tck.nodetypenochildren=dna:namespace
-javax.jcr.tck.sourceFolderName=source
-javax.jcr.tck.targetFolderName=target
-javax.jcr.tck.rootNodeName=rootNode
-javax.jcr.tck.propertySkipped=propertySkipped
-javax.jcr.tck.propertyValueMayChange=propertyValueMayChange
-javax.jcr.tck.nodeTypesTestNode=nodeTypesTestNode
-javax.jcr.tck.mixinTypeTestNode=mixinTypeTestNode
-javax.jcr.tck.propertyTypesTestNode=propertyTypesTestNode
-javax.jcr.tck.sameNameChildrenTestNode=sameNameChildrenTestNode
-javax.jcr.tck.multiValuePropertiesTestNode=multiValuePropertiesTestNode
-javax.jcr.tck.referenceableNodeTestNode=referenceableNodeTestNode
-javax.jcr.tck.orderChildrenTestNode=orderChildrenTestNode
-javax.jcr.tck.namespaceTestNode=namespaceTestNode
-javax.jcr.tck.sameNameSibsTrueNodeType=nt\:unstructured
-javax.jcr.tck.sameNameSibsFalseNodeType=dnatest\:noSameNameSibs
-javax.jcr.tck.sameNameSibsFalseChildNodeDefinition=dnatest\:noSameNameSibs
-javax.jcr.tck.stringTestProperty=stringTestProperty
-javax.jcr.tck.binaryTestProperty=binaryTestProperty
-javax.jcr.tck.dateTestProperty=dateTestProperty
-javax.jcr.tck.longTestProperty=longTestProperty
-javax.jcr.tck.doubleTestProperty=doubleTestProperty
-javax.jcr.tck.booleanTestProperty=booleanTestProperty
-javax.jcr.tck.nameTestProperty=nameTestProperty
-javax.jcr.tck.pathTestProperty=pathTestProperty
-javax.jcr.tck.referenceTestProperty=referenceTestProperty
-javax.jcr.tck.multiValueTestProperty=multiValueTestProperty
-javax.jcr.tck.SetPropertyNodeTest.nodetype=dnatest\:referenceableUnstructured
-javax.jcr.tck.NodeTest.testAddNodeItemExistsException.nodetype=dnatest\:noSameNameSibs
-javax.jcr.tck.NodeOrderableChildNodesTest.nodetype2=dnatest\:referenceableUnstructured
-javax.jcr.tck.SessionTest.testSaveContstraintViolationException.nodetype2=dnatest\:nodeWithMandatoryProperty
-javax.jcr.tck.NodeTest.testRemoveMandatoryNode.nodetype2=dnatest\:nodeWithMandatoryChild
-javax.jcr.tck.NodeTest.testRemoveMandatoryNode.nodename3=dnatest\:mandatoryChild
-javax.jcr.tck.NodeTest.testSaveContstraintViolationException.nodetype2=dnatest\:nodeWithMandatoryProperty
-javax.jcr.tck.NodeOrderableChildNodesTest.testOrderBeforeUnsupportedRepositoryOperationException.nodetype2=dnatest\:unorderableUnstructured
-javax.jcr.tck.NodeOrderableChildNodesTest.testOrderBeforeUnsupportedRepositoryOperationException.nodetype3=dnatest\:unorderableUnstructured
-# For some reason, this test assumes testNodeType doesn't allow children - most other
tests assume that it does
-javax.jcr.tck.SaveTest.nodetype=nt\:query
-javax.jcr.tck.SetPropertyAssumeTypeTest.nodetype=dnatest\:setPropertyAssumeTypeTest
-
-# Test users
-javax.jcr.tck.superuser.name=superuser
-javax.jcr.tck.superuser.pwd=superuser
-javax.jcr.tck.readwrite.name=readwrite
-javax.jcr.tck.readwrite.pwd=readwrite
-javax.jcr.tck.readonly.name=readonly
-javax.jcr.tck.readonly.pwd=readonly
\ No newline at end of file
Added: trunk/dna-jcr/src/test/resources/repositoryStubImpl.properties
===================================================================
--- trunk/dna-jcr/src/test/resources/repositoryStubImpl.properties
(rev 0)
+++ trunk/dna-jcr/src/test/resources/repositoryStubImpl.properties 2009-07-12 23:59:17 UTC
(rev 1092)
@@ -0,0 +1,58 @@
+javax.jcr.tck.repository_stub_impl=org.jboss.dna.jcr.DnaRepositoryStub
+javax.jcr.tck.testroot=/testroot
+javax.jcr.tck.nodename1=node1
+javax.jcr.tck.nodename2=node2
+javax.jcr.tck.nodename3=node3
+javax.jcr.tck.nodename4=node4
+javax.jcr.tck.propertyname1=prop1
+javax.jcr.tck.propertyname2=prop2
+javax.jcr.tck.workspacename=otherWorkspace
+javax.jcr.tck.nodetype=nt\:unstructured
+javax.jcr.tck.nodetype2=dnatest\:referenceableUnstructured
+javax.jcr.tck.nodetypenochildren=dna:namespace
+javax.jcr.tck.sourceFolderName=source
+javax.jcr.tck.targetFolderName=target
+javax.jcr.tck.rootNodeName=rootNode
+javax.jcr.tck.propertySkipped=propertySkipped
+javax.jcr.tck.propertyValueMayChange=propertyValueMayChange
+javax.jcr.tck.nodeTypesTestNode=nodeTypesTestNode
+javax.jcr.tck.mixinTypeTestNode=mixinTypeTestNode
+javax.jcr.tck.propertyTypesTestNode=propertyTypesTestNode
+javax.jcr.tck.sameNameChildrenTestNode=sameNameChildrenTestNode
+javax.jcr.tck.multiValuePropertiesTestNode=multiValuePropertiesTestNode
+javax.jcr.tck.referenceableNodeTestNode=referenceableNodeTestNode
+javax.jcr.tck.orderChildrenTestNode=orderChildrenTestNode
+javax.jcr.tck.namespaceTestNode=namespaceTestNode
+javax.jcr.tck.sameNameSibsTrueNodeType=nt\:unstructured
+javax.jcr.tck.sameNameSibsFalseNodeType=dnatest\:noSameNameSibs
+javax.jcr.tck.sameNameSibsFalseChildNodeDefinition=dnatest\:noSameNameSibs
+javax.jcr.tck.stringTestProperty=stringTestProperty
+javax.jcr.tck.binaryTestProperty=binaryTestProperty
+javax.jcr.tck.dateTestProperty=dateTestProperty
+javax.jcr.tck.longTestProperty=longTestProperty
+javax.jcr.tck.doubleTestProperty=doubleTestProperty
+javax.jcr.tck.booleanTestProperty=booleanTestProperty
+javax.jcr.tck.nameTestProperty=nameTestProperty
+javax.jcr.tck.pathTestProperty=pathTestProperty
+javax.jcr.tck.referenceTestProperty=referenceTestProperty
+javax.jcr.tck.multiValueTestProperty=multiValueTestProperty
+javax.jcr.tck.SetPropertyNodeTest.nodetype=dnatest\:referenceableUnstructured
+javax.jcr.tck.NodeTest.testAddNodeItemExistsException.nodetype=dnatest\:noSameNameSibs
+javax.jcr.tck.NodeOrderableChildNodesTest.nodetype2=dnatest\:referenceableUnstructured
+javax.jcr.tck.SessionTest.testSaveContstraintViolationException.nodetype2=dnatest\:nodeWithMandatoryProperty
+javax.jcr.tck.NodeTest.testRemoveMandatoryNode.nodetype2=dnatest\:nodeWithMandatoryChild
+javax.jcr.tck.NodeTest.testRemoveMandatoryNode.nodename3=dnatest\:mandatoryChild
+javax.jcr.tck.NodeTest.testSaveContstraintViolationException.nodetype2=dnatest\:nodeWithMandatoryProperty
+javax.jcr.tck.NodeOrderableChildNodesTest.testOrderBeforeUnsupportedRepositoryOperationException.nodetype2=dnatest\:unorderableUnstructured
+javax.jcr.tck.NodeOrderableChildNodesTest.testOrderBeforeUnsupportedRepositoryOperationException.nodetype3=dnatest\:unorderableUnstructured
+# For some reason, this test assumes testNodeType doesn't allow children - most other
tests assume that it does
+javax.jcr.tck.SaveTest.nodetype=nt\:query
+javax.jcr.tck.SetPropertyAssumeTypeTest.nodetype=dnatest\:setPropertyAssumeTypeTest
+
+# Test users
+javax.jcr.tck.superuser.name=superuser
+javax.jcr.tck.superuser.pwd=superuser
+javax.jcr.tck.readwrite.name=readwrite
+javax.jcr.tck.readwrite.pwd=readwrite
+javax.jcr.tck.readonly.name=readonly
+javax.jcr.tck.readonly.pwd=readonly
\ No newline at end of file
Modified: trunk/dna-jcr/src/test/resources/security/tck_roles.properties
===================================================================
--- trunk/dna-jcr/src/test/resources/security/tck_roles.properties 2009-07-12 23:39:30 UTC
(rev 1091)
+++ trunk/dna-jcr/src/test/resources/security/tck_roles.properties 2009-07-12 23:59:17 UTC
(rev 1092)
@@ -3,5 +3,5 @@
readwrite=readwrite
readonly=readonly
# default workspace name is the empty string
-defaultonly=readwrite.Store.,readonly.Store.otherWorkspace
+defaultonly=readwrite.Store.default,readonly.Store.otherWorkspace
noaccess=readonly.Store.otherWorkspace
Added: trunk/dna-jcr/src/test/resources/tck/default/configRepository.xml
===================================================================
--- trunk/dna-jcr/src/test/resources/tck/default/configRepository.xml
(rev 0)
+++ trunk/dna-jcr/src/test/resources/tck/default/configRepository.xml 2009-07-12 23:59:17
UTC (rev 1092)
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ JBoss DNA (
http://www.jboss.org/dna)
+ ~
+ ~ See the COPYRIGHT.txt file distributed with this work for information
+ ~ regarding copyright ownership. Some portions may be licensed
+ ~ to Red Hat, Inc. under one or more contributor license agreements.
+ ~ See the AUTHORS.txt file in the distribution for a full listing of
+ ~ individual contributors.
+ ~
+ ~ JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ ~ is licensed to you under the terms of the GNU Lesser General Public License as
+ ~ published by the Free Software Foundation; either version 2.1 of
+ ~ the License, or (at your option) any later version.
+ ~
+ ~ JBoss DNA is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ ~ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ ~ for more details.
+ ~
+ ~ You should have received a copy of the GNU Lesser General Public License
+ ~ along with this distribution; if not, write to:
+ ~ Free Software Foundation, Inc.
+ ~ 51 Franklin Street, Fifth Floor
+ ~ Boston, MA 02110-1301 USA
+ -->
+<configuration
xmlns:dna="http://www.jboss.org/dna/1.0"
xmlns:jcr="http://www.jcp.org/jcr/1.0">
+ <!--
+ Define the sources for the content. These sources are directly accessible using the
DNA-specific Graph API.
+ In fact, this is how the DNA JCR implementation works. You can think of these as
being similar to
+ JDBC DataSource objects, except that they expose graph content via the Graph API
instead of records via SQL or JDBC.
+ -->
+ <dna:sources jcr:primaryType="nt:unstructured">
+ <!--
+ The 'JCR' repository is an in-memory source with a single default
workspace (though others could be created, too).
+ -->
+ <dna:source jcr:name="Store"
dna:classname="org.jboss.dna.graph.connector.inmemory.InMemoryRepositorySource"
dna:retryLimit="3" dna:defaultWorkspaceName="default"/>
+ </dna:sources>
+ <!--
+ Define the mime type detectors. This is an optional section. By default, each engine
will use the
+ MIME type detector that uses filename extensions. So we wouldn't need to define
the same detector again,
+ but this is how you'd define another extension.
+ -->
+ <dna:mimeTypeDetectors>
+ <dna:mimeTypeDetector jcr:name="Detector">
+ <dna:description>Standard extension-based MIME type
detector</dna:description>
+ <!--
+ Specify the implementation class (required), as a child element or attribute
on parent element.
+ -->
+
<dna:classname>org.jboss.dna.graph.mimetype.ExtensionBasedMimeTypeDetector</dna:classname>
+ <!--
+ Specify the classpath (optional) as an ordered list of 'names', where
each name is significant to
+ the classpath factory. For example, a name could be an OSGI identifier or a
Maven coordinate,
+ depending upon the classpath factory being used. If there is only one
'name' in the classpath,
+ it may be specified as an attribute on the 'mimeTypeDetector'
element. If there is more than one
+ 'name', then they must be specified as child 'classpath'
elements. Blank or empty values are ignored.
+ -->
+ <dna:classpath></dna:classpath>
+ </dna:mimeTypeDetector>
+ </dna:mimeTypeDetectors>
+ <!--
+ Define the JCR repositories
+ -->
+ <dna:repositories>
+ <!--
+ Define a JCR repository that accesses the 'JCR' source directly.
+ This of course is optional, since we could access the same content through
'JCR'.
+ -->
+ <dna:repository jcr:name="Test Repository Source">
+ <!-- Specify the source that should be used for the repository -->
+ <dna:source>Store</dna:source>
+ <!-- Define the options for the JCR repository, using camelcase version of
JcrRepository.Option names
+-->
+ <dna:options jcr:primaryType="dna:options">
+ <jaasLoginConfigName jcr:primaryType="dna:option"
dna:value="dna-jcr"/>
+ <projectNodeTypes jcr:primaryType="dna:option"
dna:value="false"/>
+ </dna:options>
+ <!-- Define any namespaces for this repository, other than those already
defined by JCR or DNA
+-->
+ <namespaces jcr:primaryType="dna:namespaces">
+ <dnatest jcr:primaryType="dna:namespace"
dna:uri="http://jboss.org/dna/test/1.0"/>
+ </namespaces>
+ </dna:repository>
+ </dna:repositories>
+</configuration>
Property changes on: trunk/dna-jcr/src/test/resources/tck/default/configRepository.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Added: trunk/dna-jcr/src/test/resources/tck/default/repositoryOverlay.properties
===================================================================
--- trunk/dna-jcr/src/test/resources/tck/default/repositoryOverlay.properties
(rev 0)
+++ trunk/dna-jcr/src/test/resources/tck/default/repositoryOverlay.properties 2009-07-12
23:59:17 UTC (rev 1092)
@@ -0,0 +1 @@
+# Placeholder for any overlaid properties for this repo configuration
Copied: trunk/dna-jcr/src/test/resources/tck/repositoryForTckTests.xml (from rev 1085,
trunk/dna-jcr/src/test/resources/repositoryForTckTests.xml)
===================================================================
--- trunk/dna-jcr/src/test/resources/tck/repositoryForTckTests.xml
(rev 0)
+++ trunk/dna-jcr/src/test/resources/tck/repositoryForTckTests.xml 2009-07-12 23:59:17 UTC
(rev 1092)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ JBoss DNA (
http://www.jboss.org/dna)
+ ~
+ ~ See the COPYRIGHT.txt file distributed with this work for information
+ ~ regarding copyright ownership. Some portions may be licensed
+ ~ to Red Hat, Inc. under one or more contributor license agreements.
+ ~ See the AUTHORS.txt file in the distribution for a full listing of
+ ~ individual contributors.
+ ~
+ ~ JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ ~ is licensed to you under the terms of the GNU Lesser General Public License as
+ ~ published by the Free Software Foundation; either version 2.1 of
+ ~ the License, or (at your option) any later version.
+ ~
+ ~ JBoss DNA is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ ~ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ ~ for more details.
+ ~
+ ~ You should have received a copy of the GNU Lesser General Public License
+ ~ along with this distribution; if not, write to:
+ ~ Free Software Foundation, Inc.
+ ~ 51 Franklin Street, Fifth Floor
+ ~ Boston, MA 02110-1301 USA
+ -->
+<testroot
xmlns:jcr="http://www.jcp.org/jcr/1.0"
+
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
+
xmlns:dna="http://www.jboss.org/dna/1.0"
+ jcr:primaryType="nt:unstructured">
+ <nt:unstructured jcr:name="serializationNode" />
+ <nt:unstructured jcr:name="node1"
prop1="<foo&foo>">
+ <!--
+ This stanza checks for the jcr:xmltext special case for export as per JCR
1.0.1 section 6.4.2.3
+ -->
+ <nt:unstructured jcr:name="jcr:xmltext" jcr:xmlcharacters="This
is my "XML" text!" />
+ </nt:unstructured>
+ <nt:unstructured jcr:name="node2 has a multi-word name"
multi-valued-property="bar baz blah">
+ <!--
+ This stanza checks that consecutive jcr:xmltext elements will be merged in the
export as
+ per JCR 1.0.1 section 6.4.2.3
+ -->
+ <nt:unstructured jcr:name="jcr:xmltext" jcr:xmlcharacters="This
is my "XML" text!" />
+ <nt:unstructured jcr:name="jcr:xmltext" jcr:xmlcharacters="This
is my "other" text!" />
+ </nt:unstructured>
+ <nt:unstructured jcr:name="node3" />
+ <!--
+ Test of unprintable character exports.
+ Cannot test \r character here on Windows as TCK XML Parser will replace it with \n
and fail the comparison
+ -->
+ <nt:unstructured jcr:name="node4"
multi-line-property="Line	1
Line 2"/>
+</testroot>
\ No newline at end of file
Copied: trunk/dna-jcr/src/test/resources/tck/tck_test_types.cnd (from rev 1085,
trunk/dna-jcr/src/test/resources/tck_test_types.cnd)
===================================================================
--- trunk/dna-jcr/src/test/resources/tck/tck_test_types.cnd (rev
0)
+++ trunk/dna-jcr/src/test/resources/tck/tck_test_types.cnd 2009-07-12 23:59:17 UTC (rev
1092)
@@ -0,0 +1,28 @@
+/*
+ * Extra Node Types for JR TCK Test
+ */
+
+<nt = "http://www.jcp.org/jcr/nt/1.0">
+<mix = "http://www.jcp.org/jcr/mix/1.0">
+<dnatest = "http://www.jboss.org/dna/test/1.0">
+
+[dnatest:noSameNameSibs]
++ * (nt:base) = nt:unstructured
+
+[dnatest:referenceableUnstructured] > nt:unstructured, mix:referenceable orderable
+
+[dnatest:nodeWithMandatoryProperty] > nt:unstructured, mix:referenceable
+- dnatest:mandatoryString (*) mandatory copy
+
+[dnatest:nodeWithMandatoryChild] > nt:unstructured, mix:referenceable
++ dnatest:mandatoryChild (nt:base) = nt:unstructured mandatory version
+
+[dnatest:unorderableUnstructured]
+- * (*) copy
+- * (*) multiple copy
++ * (nt:base) = dnatest:unorderableUnstructured multiple version
+
+[dnatest:setPropertyAssumeTypeTest]
+- prop1 (PATH) copy
+- * (*) copy
+- * (*) multiple copy
Deleted: trunk/dna-jcr/src/test/resources/tck_test_types.cnd
===================================================================
--- trunk/dna-jcr/src/test/resources/tck_test_types.cnd 2009-07-12 23:39:30 UTC (rev
1091)
+++ trunk/dna-jcr/src/test/resources/tck_test_types.cnd 2009-07-12 23:59:17 UTC (rev
1092)
@@ -1,28 +0,0 @@
-/*
- * Extra Node Types for JR TCK Test
- */
-
-<nt = "http://www.jcp.org/jcr/nt/1.0">
-<mix = "http://www.jcp.org/jcr/mix/1.0">
-<dnatest = "http://www.jboss.org/dna/test/1.0">
-
-[dnatest:noSameNameSibs]
-+ * (nt:base) = nt:unstructured
-
-[dnatest:referenceableUnstructured] > nt:unstructured, mix:referenceable orderable
-
-[dnatest:nodeWithMandatoryProperty] > nt:unstructured, mix:referenceable
-- dnatest:mandatoryString (*) mandatory copy
-
-[dnatest:nodeWithMandatoryChild] > nt:unstructured, mix:referenceable
-+ dnatest:mandatoryChild (nt:base) = nt:unstructured mandatory version
-
-[dnatest:unorderableUnstructured]
-- * (*) copy
-- * (*) multiple copy
-+ * (nt:base) = dnatest:unorderableUnstructured multiple version
-
-[dnatest:setPropertyAssumeTypeTest]
-- prop1 (PATH) copy
-- * (*) copy
-- * (*) multiple copy