You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by pp...@apache.org on 2005/12/20 17:20:35 UTC
svn commit: r358028 [2/2] - in
/incubator/jackrabbit/trunk/contrib/nt-ns-util: ./ applications/
applications/test/ src/ src/main/ src/main/java/ src/main/java/org/
src/main/java/org/apache/ src/main/java/org/apache/jackrabbit/
src/main/java/org/apache/...
Added: incubator/jackrabbit/trunk/contrib/nt-ns-util/src/main/java/org/apache/jackrabbit/util/nodetype/SchemaConversionException.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/nt-ns-util/src/main/java/org/apache/jackrabbit/util/nodetype/SchemaConversionException.java?rev=358028&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/nt-ns-util/src/main/java/org/apache/jackrabbit/util/nodetype/SchemaConversionException.java (added)
+++ incubator/jackrabbit/trunk/contrib/nt-ns-util/src/main/java/org/apache/jackrabbit/util/nodetype/SchemaConversionException.java Tue Dec 20 08:20:16 2005
@@ -0,0 +1,70 @@
+/*
+ * $Id:$
+ *
+ * Copyright 2002-2004 Day Management AG, Switzerland.
+ *
+ * Licensed under the Day RI License, Version 2.0 (the "License"),
+ * as a reference implementation of the following specification:
+ *
+ * Content Repository API for Java Technology, revision 0.13
+ * <http://www.jcp.org/en/jsr/detail?id=170>
+ *
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License files at
+ *
+ * http://www.day.com/content/en/licenses/day-ri-license-2.0
+ * 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.util.nodetype;
+
+/**
+ * SchemaConversionException
+ */
+public class SchemaConversionException extends Exception {
+
+ /**
+ * Constructs a new instance of this class with <code>null</code> as its
+ * detail message.
+ */
+ public SchemaConversionException() {
+ super();
+ }
+
+ /**
+ * Constructs a new instance of this class with the specified detail
+ * message.
+ *
+ * @param message the detail message. The detail message is saved for
+ * later retrieval by the {@link #getMessage()} method.
+ */
+ public SchemaConversionException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a new instance of this class with the specified detail
+ * message and root cause.
+ *
+ * @param message the detail message. The detail message is saved for
+ * later retrieval by the {@link #getMessage()} method.
+ * @param rootCause root failure cause
+ */
+ public SchemaConversionException(String message, Throwable rootCause) {
+ super(message, rootCause);
+ }
+
+ /**
+ * Constructs a new instance of this class with the specified root cause.
+ *
+ * @param rootCause root failure cause
+ */
+ public SchemaConversionException(Throwable rootCause) {
+ super(rootCause);
+ }
+}
Propchange: incubator/jackrabbit/trunk/contrib/nt-ns-util/src/main/java/org/apache/jackrabbit/util/nodetype/SchemaConversionException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/jackrabbit/trunk/contrib/nt-ns-util/src/main/java/org/apache/jackrabbit/util/nodetype/SchemaConversionException.java
------------------------------------------------------------------------------
svn:keywords = author date id revision url
Added: incubator/jackrabbit/trunk/contrib/nt-ns-util/src/main/java/org/apache/jackrabbit/util/nodetype/SchemaConverter.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/nt-ns-util/src/main/java/org/apache/jackrabbit/util/nodetype/SchemaConverter.java?rev=358028&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/nt-ns-util/src/main/java/org/apache/jackrabbit/util/nodetype/SchemaConverter.java (added)
+++ incubator/jackrabbit/trunk/contrib/nt-ns-util/src/main/java/org/apache/jackrabbit/util/nodetype/SchemaConverter.java Tue Dec 20 08:20:16 2005
@@ -0,0 +1,593 @@
+package org.apache.jackrabbit.util.nodetype;
+
+import org.apache.jackrabbit.core.nodetype.NodeDef;
+import org.apache.jackrabbit.core.nodetype.NodeDefImpl;
+import org.apache.jackrabbit.core.nodetype.NodeTypeDef;
+import org.apache.jackrabbit.core.nodetype.PropDef;
+import org.apache.jackrabbit.core.nodetype.PropDefImpl;
+import org.apache.jackrabbit.core.nodetype.ValueConstraint;
+import org.apache.jackrabbit.core.value.InternalValue;
+import org.apache.jackrabbit.name.QName;
+import org.apache.xerces.impl.xs.XMLSchemaLoader;
+import org.apache.xerces.xs.XSAttributeDeclaration;
+import org.apache.xerces.xs.XSAttributeUse;
+import org.apache.xerces.xs.XSComplexTypeDefinition;
+import org.apache.xerces.xs.XSConstants;
+import org.apache.xerces.xs.XSElementDeclaration;
+import org.apache.xerces.xs.XSModel;
+import org.apache.xerces.xs.XSModelGroup;
+import org.apache.xerces.xs.XSNamedMap;
+import org.apache.xerces.xs.XSObjectList;
+import org.apache.xerces.xs.XSParticle;
+import org.apache.xerces.xs.XSSimpleTypeDefinition;
+import org.apache.xerces.xs.XSTerm;
+import org.apache.xerces.xs.XSTypeDefinition;
+import org.apache.xerces.xs.XSWildcard;
+import javax.jcr.PropertyType;
+import javax.jcr.version.OnParentVersionAction;
+import java.io.File;
+import java.util.*;
+
+/**
+ * SchemaConverter
+ * Converts an XML Schema into a set of node type defintions (NodeTypeDef objects)
+ * which can then be registered in a repository.
+ */
+public class SchemaConverter {
+ private static final QName XML_TEXT_NODETYPE_NAME = new QName(QName.NS_JCR_URI, "Xmltext");
+ private static final QName XML_CONTENT_PROPERTY_NAME = new QName(QName.NS_JCR_URI, "xmlContent");
+
+ private final HashMap nodeTypeDefs = new HashMap();
+ private final HashMap nodeTypeBaseNames = new HashMap();
+
+ /**
+ * Constructor
+ */
+ public SchemaConverter(String fileName) throws SchemaConversionException {
+ File file = new File(fileName);
+ convertSchema(file);
+ }
+
+ /**
+ * Constructor
+ */
+ public SchemaConverter(File file) throws SchemaConversionException {
+ convertSchema(file);
+ }
+
+ /**
+ * getNodeTypeDefs
+ */
+ public List getNodeTypeDefs() {
+ return new ArrayList(nodeTypeDefs.values());
+ }
+
+ /**
+ * convertSchema
+ */
+ private void convertSchema(File file) throws SchemaConversionException {
+ XMLSchemaLoader loader = new XMLSchemaLoader();
+ String uri = file.toURI().toString();
+ XSModel xsModel = loader.loadURI(uri);
+
+ // Convert top level complex type definitions to node types
+ XSNamedMap map = xsModel.getComponents(XSConstants.TYPE_DEFINITION);
+ for (int i = 0; i < map.getLength(); i++) {
+ XSTypeDefinition tDef = (XSTypeDefinition) map.item(i);
+ checkAndConvert(tDef, null, null);
+ }
+ // Convert local (anonymous) complex type defs found in top level element declarations
+ map = xsModel.getComponents(XSConstants.ELEMENT_DECLARATION);
+ for (int i = 0; i < map.getLength(); i++) {
+ XSElementDeclaration eDec = (XSElementDeclaration) map.item(i);
+ XSTypeDefinition tDef = eDec.getTypeDefinition();
+ checkAndConvert(tDef, eDec.getNamespace(), eDec.getName());
+ }
+ }
+
+ /**
+ * checkAndConvert
+ */
+ private void checkAndConvert(XSTypeDefinition tDef, String namespace, String nameHint) throws SchemaConversionException {
+ if (tDef.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) {
+ XSComplexTypeDefinition ctDef = (XSComplexTypeDefinition) tDef;
+ if (ctDef.getContentType() != XSComplexTypeDefinition.CONTENTTYPE_SIMPLE
+ || ctDef.getAttributeUses().getLength() > 0
+ || ctDef.getAttributeWildcard() != null) {
+ convertComplexTypeDef(ctDef, namespace, nameHint);
+ }
+ }
+ }
+
+ /**
+ * convertComplexTypeDef
+ */
+ private QName convertComplexTypeDef(XSComplexTypeDefinition ctDef, String namespace, String nameHint) throws SchemaConversionException {
+ NodeTypeDef ntd;
+
+ // Check if this ComplexTypeDef has already been converted
+ // if so, return the name of the corresponding NodeTypeDef
+ if (nodeTypeDefs.containsKey(ctDef)) {
+ ntd = (NodeTypeDef) nodeTypeDefs.get(ctDef);
+ return ntd.getName();
+ }
+
+ // Otherwise create a new NodeTypeDef and add it to the map
+ // keyed by the CTDef from which it was converted
+ NodeTypeDef ntDef = new NodeTypeDef();
+ nodeTypeDefs.put(ctDef, ntDef);
+
+ // Make name for the node type, inventing names for anonymous CTDefs
+ // and avoiding repetitions.
+ QName ntName;
+ if (ctDef.getAnonymous()) {
+ if (nameHint == null) {
+ throw new SchemaConversionException("Anonymous complex type definition encountered without name hint");
+ }
+ namespace = noNull(namespace);
+ QName baseName = new QName(namespace, nameHint + "Type");
+ Integer count = (Integer) nodeTypeBaseNames.get(baseName);
+ if (count == null) {
+ nodeTypeBaseNames.put(baseName, new Integer(0));
+ ntName = baseName;
+ } else {
+ int newCount = count.intValue() + 1;
+ ntName = new QName(namespace, nameHint + "Type_" + Integer.toString(newCount));
+ nodeTypeBaseNames.put(baseName, new Integer(newCount));
+ }
+ } else {
+ ntName = new QName(noNull(ctDef.getNamespace()), ctDef.getName());
+ }
+
+ // set the name of the node type
+ ntDef.setName(ntName);
+
+ // Fill in the rest of the node type def
+ buildNodeTypeDef(ntDef, ctDef);
+ return ntName;
+ }
+
+ /**
+ * buildNodeTypeDef
+ */
+ private void buildNodeTypeDef(NodeTypeDef nodeTypeDef, XSComplexTypeDefinition ctdef) throws SchemaConversionException {
+ List propDefList = new ArrayList();
+ List nodeDefList = new ArrayList();
+
+ // Set supertype of node type. Currently all node types created direct subtypes of nt:base
+ nodeTypeDef.setSupertypes(new QName[]{QName.NT_BASE});
+
+ // Set mixin status. Currently all node types are set to mixin=false
+ nodeTypeDef.setMixin(false);
+
+ // The orderable status is false unless it is reset during deeper traversal of
+ // this complex type definition. See method particleToDefs below
+ boolean orderable = false;
+
+ // Set Primary Item. Currently we set this to null: no primary item
+ nodeTypeDef.setPrimaryItemName(null);
+
+ // Convert attribute uses (<xs:attribute>) to property definitions
+ XSObjectList list = ctdef.getAttributeUses();
+ for (int i = 0; i < list.getLength(); i++) {
+ XSAttributeUse attribUse = (XSAttributeUse) list.item(i);
+ PropDef propDef = attributeUseToPropDef(attribUse);
+ propDefList.add(propDef);
+ }
+
+ // Convert attribute wildcard (<xs:anyattribute>)to residual property
+ XSWildcard wildcard = ctdef.getAttributeWildcard();
+ if (wildcard != null) {
+ PropDef propDef = wildcardPropDef();
+ propDefList.add(propDef);
+ }
+
+ // If the content model of this complex type is simple, then we create a
+ // PropDef corresponding to the XML text node defined by this content model.
+ if (ctdef.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_SIMPLE) {
+ XSSimpleTypeDefinition stdef = ctdef.getSimpleType();
+ //set to non-mandatory, single-value property called "jcr:xmlcharacters"
+ PropDef propDef = simpleTypeToPropDef(stdef, XML_CONTENT_PROPERTY_NAME, false, false);
+ propDefList.add(propDef);
+
+ // If the content model of this complex type is element or mixed then we must convert the
+ // contained XSParticle into a set of node and/or property defs
+ } else if (ctdef.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_ELEMENT ||
+ ctdef.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_MIXED) {
+ XSParticle p = ctdef.getParticle();
+
+ // particleToDefs takes the two lists and adds to them as necessary. It also returns
+ // an orderable indicator based on the top level compositor used within the complex typedef
+ // (if there is one).
+ orderable = particleToDefs(p, propDefList, nodeDefList);
+ } else if (ctdef.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_EMPTY) {
+ // Xerces ignores type definitions with empty content
+ // so a type with empty content should never be encountered.
+ } else {
+ throw new SchemaConversionException("Unrecognized content type");
+ }
+
+ // If the content model of this complex type is mixed, then we need to also add
+ // an SNS node def with name jcr:xmltext to hold the multiple text nodes
+ // that may be interspersed. We also ensure that the node type has an orderable setting
+ // of true in this case. A node type for jcr:xmltext, called jcr:Xmltext,
+ // is also added to the node type set.
+ if (ctdef.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_MIXED) {
+ orderable = true;
+ nodeDefList.add(createXMLTextNodeDef());
+ addXMLTextNodeType();
+ }
+
+ // Set the orderable status of the node type def
+ // this may have been modified by deeper traversal
+ // through particleDefs.
+ nodeTypeDef.setOrderableChildNodes(orderable);
+
+ // Set the declaring node type in each of the accumulated property and node defs
+ QName nodeTypeName = nodeTypeDef.getName();
+ for (Iterator i = propDefList.listIterator(); i.hasNext();) {
+ PropDefImpl propDef = (PropDefImpl) i.next();
+ propDef.setDeclaringNodeType(nodeTypeName);
+ }
+ for (Iterator i = nodeDefList.listIterator(); i.hasNext();) {
+ NodeDefImpl nodeDef = (NodeDefImpl) i.next();
+ nodeDef.setDeclaringNodeType(nodeTypeName);
+ }
+
+ //Add the collected propDefs to the node type def
+ nodeTypeDef.setPropertyDefs((PropDef[]) propDefList.toArray(new PropDef[propDefList.size()]));
+
+ //Add the collected nodeDefs to the node type def
+ nodeTypeDef.setChildNodeDefs((NodeDef[]) nodeDefList.toArray(new NodeDef[nodeDefList.size()]));
+ }
+
+ /**
+ * particleToDefs
+ */
+ private boolean particleToDefs(XSParticle particle, List propDefList, List nodeDefList) throws SchemaConversionException {
+ boolean orderable = false;
+
+ XSTerm term = particle.getTerm();
+
+ // If the maxoccurs setting of this particle is zero then this
+ // particle does not contribute any node or property definition and
+ // we do nothing and return.
+ if (particle.getMaxOccurs() == 0) {
+ return orderable;
+ }
+
+ // Determine the mandatory setting of the node or property
+ // corresponding to this particle (if this particle does not
+ // correspond to node or property this information is ignored).
+ boolean mandatory = false;
+ if (particle.getMinOccurs() > 0) {
+ mandatory = true;
+ }
+
+ // Determine the same-name siblings setting of the node, or
+ // the multiple setting of the property, corresponding to this
+ // particle (if this particle does not correspond to
+ // node or property this information is ignored).
+ boolean multiple = false;
+ if (particle.getMaxOccurs() > 1 || particle.getMaxOccursUnbounded()) {
+ multiple = true;
+ }
+
+ // If this particle is an element declaration (an <xs:element>)
+ // then it is converted into either a node or property def.
+ if (term.getType() == XSConstants.ELEMENT_DECLARATION) {
+ XSElementDeclaration eDec = (XSElementDeclaration) term;
+
+ // Name for property or node def taken from the name of the element
+ QName name = new QName(noNull(eDec.getNamespace()), eDec.getName());
+
+ // Get the type definition for this element declaration
+ XSTypeDefinition tDef = eDec.getTypeDefinition();
+
+ // If this element declaration is of simple type
+ // then it is converted into a property def
+ if (tDef.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
+ XSSimpleTypeDefinition stDef = (XSSimpleTypeDefinition) tDef;
+ PropDef propDef = simpleTypeToPropDef(stDef, name, mandatory, multiple);
+ propDefList.add(propDef);
+
+ // If this element declaration is of complex type then
+ // it is converted into either node or property def
+ } else if (tDef.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) {
+ XSComplexTypeDefinition ctDef = (XSComplexTypeDefinition) tDef;
+
+ // If the complex type definition contains a simple content model
+ // and does not contain any attribute uses or attribute wildcards
+ // then the enclosing element is converted to a property def
+ if (ctDef.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_SIMPLE &&
+ ctDef.getAttributeUses().getLength() == 0 && ctDef.getAttributeWildcard() == null) {
+ XSSimpleTypeDefinition std = ctDef.getSimpleType();
+ PropDef pd = simpleTypeToPropDef(std, name, mandatory, multiple);
+ propDefList.add(pd);
+
+ // If the complex type definition contains a complex content model
+ // or a simple content model with attribute uses or an attribute wildcard
+ // then the enclosing element is converted into a node def
+ } else {
+ NodeDef nd = complexTypeToNodeDef(ctDef, name, mandatory, multiple);
+ nodeDefList.add(nd);
+ }
+ }
+
+ // If this particle is a wildcard (an <xs:any> )then it
+ // is converted into a node def.
+ } else if (term.getType() == XSConstants.WILDCARD) {
+ nodeDefList.add(wildcardNodeDef());
+
+ // If this particle is a model group (one of
+ // <xs:sequence>, <xs:choice> or <xs:all>) then
+ // it subparticles must be processed.
+ } else if (term.getType() == XSConstants.MODEL_GROUP) {
+ XSModelGroup mg = (XSModelGroup) term;
+
+ // If the top level compositor is <xs:sequence> we convert this to
+ // mean that the node type corresponding to the complex type def will have
+ // an orderable setting of true.
+ if (mg.getCompositor() == XSModelGroup.COMPOSITOR_SEQUENCE) {
+ orderable = true;
+ }
+
+ // We ignore any further nested compositors
+ // by ignoring the return value of nested particleToDefs calls.
+ XSObjectList list = mg.getParticles();
+ for (int i = 0; i < list.getLength(); i++) {
+ XSParticle pp = (XSParticle) list.item(i);
+ particleToDefs(pp, propDefList, nodeDefList);
+ }
+ }
+ return orderable;
+ }
+
+ /**
+ * attributeUseToPropDef
+ */
+ private PropDef attributeUseToPropDef(XSAttributeUse au) {
+
+ // The required setting of this attribute use becomes the
+ // the mandatory setting of the property definition:
+ // <xs:attribute ref="..." use="required | optional | prohibited">
+ // note that if use is prohibited the attribute use itself is absent from the XSModel so
+ // we would never get here anyway
+ boolean mandatory = au.getRequired();
+
+ // Get the contained attribute declaration
+ XSAttributeDeclaration ad = au.getAttrDeclaration();
+
+ // The name of the Attribute Declaration becomes the name of the PropDef
+ QName name = new QName(noNull(ad.getNamespace()), ad.getName());
+
+ // Since this is an attribute declaration we assume it converts to
+ // a single value property (we ignore the XML Schema List Type)
+ boolean multiple = false;
+
+ // Get the simple type def for this attribute
+ XSSimpleTypeDefinition std = ad.getTypeDefinition();
+
+ // convert it to a propdef
+ return simpleTypeToPropDef(std, name, mandatory, multiple);
+ }
+
+ /**
+ * simpleTypeToPropDef
+ */
+ private PropDef simpleTypeToPropDef(XSSimpleTypeDefinition std, QName propertyName, boolean mandatory, boolean multiple) {
+
+ // Create PropDef and set attributes passed in
+ PropDefImpl propDef = new PropDefImpl();
+ propDef.setName(propertyName);
+ propDef.setMandatory(mandatory);
+ propDef.setMultiple(multiple);
+
+ // Set the property type from the built-in kind
+ short kind = std.getBuiltInKind();
+ int propertyType = convertBuiltInKindToPropertyType(kind);
+ propDef.setRequiredType(propertyType);
+
+ //todo:determine value constraints from schema
+ propDef.setValueConstraints(new ValueConstraint[]{});
+
+ //todo:determine default value from schema
+ propDef.setDefaultValues(new InternalValue[]{});
+
+ // Set the attributes not translated from schema
+ propDef.setAutoCreated(false);
+ propDef.setOnParentVersion(OnParentVersionAction.COPY);
+ propDef.setProtected(false);
+
+ return propDef;
+ }
+
+ /**
+ * complexTypeToNodeDef
+ */
+ private NodeDef complexTypeToNodeDef(XSComplexTypeDefinition ctDef, QName nodeName, boolean mandatory, boolean multiple) throws SchemaConversionException {
+
+ // Create NodeDef and set attributes passed in
+ NodeDefImpl nodeDef = new NodeDefImpl();
+ nodeDef.setName(nodeName);
+ nodeDef.setMandatory(mandatory);
+ nodeDef.setAllowsSameNameSiblings(multiple);
+
+ // Create nodeType for this node def (will only be created if needed)
+ QName nodeTypeName = convertComplexTypeDef(ctDef, nodeName.getNamespaceURI(), nodeName.getLocalName());
+ nodeDef.setDefaultPrimaryType(nodeTypeName);
+ nodeDef.setRequiredPrimaryTypes(new QName[]{nodeTypeName});
+
+ // Set attributes not determined by schema
+ nodeDef.setAutoCreated(false);
+ nodeDef.setOnParentVersion(OnParentVersionAction.COPY);
+ nodeDef.setProtected(false);
+ return nodeDef;
+ }
+
+ /**
+ * attributeWildcardToPropDef
+ */
+ private PropDef wildcardPropDef() {
+ PropDefImpl propDef = new PropDefImpl();
+ propDef.setName(PropDef.ANY_NAME);
+ propDef.setMandatory(false);
+ propDef.setMultiple(false);
+ propDef.setRequiredType(PropertyType.UNDEFINED);
+ propDef.setValueConstraints(new ValueConstraint[]{});
+ propDef.setDefaultValues(new InternalValue[]{});
+ propDef.setAutoCreated(false);
+ propDef.setOnParentVersion(OnParentVersionAction.COPY);
+ propDef.setProtected(false);
+ return propDef;
+ }
+
+ /**
+ * wildcardToNodeDef
+ */
+ private NodeDef wildcardNodeDef() {
+ NodeDefImpl nodeDef = new NodeDefImpl();
+ nodeDef.setName(NodeDef.ANY_NAME);
+ nodeDef.setMandatory(false);
+ nodeDef.setAllowsSameNameSiblings(false);
+ nodeDef.setDefaultPrimaryType(NodeDef.ANY_NAME);
+ nodeDef.setRequiredPrimaryTypes(new QName[]{});
+ nodeDef.setAutoCreated(false);
+ nodeDef.setOnParentVersion(OnParentVersionAction.COPY);
+ nodeDef.setProtected(false);
+ return nodeDef;
+ }
+
+ /**
+ * createXMLtextNodeDef
+ */
+ private NodeDef createXMLTextNodeDef() {
+ NodeDefImpl nodeDef = new NodeDefImpl();
+ nodeDef.setName(QName.JCR_XMLTEXT);
+ nodeDef.setMandatory(false);
+ nodeDef.setAllowsSameNameSiblings(true);
+ nodeDef.setDefaultPrimaryType(XML_TEXT_NODETYPE_NAME);
+ nodeDef.setRequiredPrimaryTypes(new QName[]{XML_TEXT_NODETYPE_NAME});
+ nodeDef.setAutoCreated(false);
+ nodeDef.setOnParentVersion(OnParentVersionAction.COPY);
+ nodeDef.setProtected(false);
+ return nodeDef;
+ }
+
+ /**
+ * addXMLTextNodeType
+ */
+ private void addXMLTextNodeType() {
+ // If the XML text node type already exists, do nothing
+ if (nodeTypeDefs.containsKey(XML_TEXT_NODETYPE_NAME)) return;
+
+ // Otherwise create a new node type def and set its attributes
+ NodeTypeDef ntd = new NodeTypeDef();
+ ntd.setName(XML_TEXT_NODETYPE_NAME);
+ ntd.setSupertypes(new QName[]{QName.NT_BASE});
+ ntd.setPrimaryItemName(null);
+ ntd.setMixin(false);
+ ntd.setOrderableChildNodes(false);
+ ntd.setChildNodeDefs(new NodeDef[]{});
+
+ // The XML text node type defines a single property called jcr:xmlcharacters
+ // Create the property def for this property
+ PropDefImpl pd = new PropDefImpl();
+ pd.setName(QName.JCR_XMLCHARACTERS);
+ pd.setDeclaringNodeType(XML_TEXT_NODETYPE_NAME);
+ pd.setAutoCreated(false);
+ pd.setDefaultValues(new InternalValue[]{});
+ pd.setMandatory(false);
+ pd.setMultiple(false);
+ pd.setOnParentVersion(OnParentVersionAction.COPY);
+ pd.setProtected(false);
+ pd.setRequiredType(PropertyType.STRING);
+ pd.setValueConstraints(new ValueConstraint[]{});
+
+ // Add the jcr:xmlcharacters properyt def to the node type def
+ ntd.setPropertyDefs(new PropDef[]{pd});
+
+ // Add the node type def to the set of node type defs
+ nodeTypeDefs.put(ntd.getName(), ntd);
+ }
+
+ /**
+ * convertBuiltInKindToPropertyType
+ */
+ private int convertBuiltInKindToPropertyType(short kind) {
+ int propertyType;
+ switch (kind) {
+ case XSConstants.ANYSIMPLETYPE_DT:
+ case XSConstants.STRING_DT:
+ case XSConstants.ID_DT:
+ case XSConstants.ENTITY_DT:
+ case XSConstants.NOTATION_DT:
+ case XSConstants.NORMALIZEDSTRING_DT:
+ case XSConstants.TOKEN_DT:
+ case XSConstants.LANGUAGE_DT:
+ case XSConstants.NMTOKEN_DT:
+ propertyType = PropertyType.STRING;
+ break;
+ case XSConstants.BOOLEAN_DT:
+ propertyType = PropertyType.BOOLEAN;
+ break;
+ case XSConstants.DECIMAL_DT:
+ case XSConstants.FLOAT_DT:
+ case XSConstants.DOUBLE_DT:
+ propertyType = PropertyType.DOUBLE;
+ break;
+ case XSConstants.DURATION_DT:
+ case XSConstants.DATETIME_DT:
+ case XSConstants.TIME_DT:
+ case XSConstants.DATE_DT:
+ case XSConstants.GYEARMONTH_DT:
+ case XSConstants.GYEAR_DT:
+ case XSConstants.GMONTHDAY_DT:
+ case XSConstants.GDAY_DT:
+ case XSConstants.GMONTH_DT:
+ propertyType = PropertyType.DATE;
+ break;
+ case XSConstants.HEXBINARY_DT:
+ case XSConstants.BASE64BINARY_DT:
+ case XSConstants.ANYURI_DT:
+ propertyType = PropertyType.BINARY;
+ break;
+ case XSConstants.QNAME_DT:
+ case XSConstants.NAME_DT:
+ case XSConstants.NCNAME_DT:
+ propertyType = PropertyType.NAME;
+ break;
+ case XSConstants.IDREF_DT:
+ propertyType = PropertyType.REFERENCE;
+ break;
+ case XSConstants.INTEGER_DT:
+ case XSConstants.NONPOSITIVEINTEGER_DT:
+ case XSConstants.NEGATIVEINTEGER_DT:
+ case XSConstants.LONG_DT:
+ case XSConstants.INT_DT:
+ case XSConstants.SHORT_DT:
+ case XSConstants.BYTE_DT:
+ case XSConstants.NONNEGATIVEINTEGER_DT:
+ case XSConstants.UNSIGNEDLONG_DT:
+ case XSConstants.UNSIGNEDINT_DT:
+ case XSConstants.UNSIGNEDSHORT_DT:
+ case XSConstants.UNSIGNEDBYTE_DT:
+ case XSConstants.POSITIVEINTEGER_DT:
+ propertyType = PropertyType.LONG;
+ break;
+ case XSConstants.LISTOFUNION_DT:
+ case XSConstants.LIST_DT:
+ case XSConstants.UNAVAILABLE_DT:
+ propertyType = PropertyType.STRING;
+ break;
+ default:
+ propertyType = PropertyType.STRING;
+ break;
+ }
+ return propertyType;
+ }
+
+ private String noNull(String s) {
+ return s != null ? s : "";
+ }
+}
\ No newline at end of file
Propchange: incubator/jackrabbit/trunk/contrib/nt-ns-util/src/main/java/org/apache/jackrabbit/util/nodetype/SchemaConverter.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/jackrabbit/trunk/contrib/nt-ns-util/src/main/java/org/apache/jackrabbit/util/nodetype/SchemaConverter.java
------------------------------------------------------------------------------
svn:keywords = author date id revision url
Added: incubator/jackrabbit/trunk/contrib/nt-ns-util/src/test/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/nt-ns-util/src/test/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefTest.java?rev=358028&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/nt-ns-util/src/test/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefTest.java (added)
+++ incubator/jackrabbit/trunk/contrib/nt-ns-util/src/test/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefTest.java Tue Dec 20 08:20:16 2005
@@ -0,0 +1,138 @@
+/*
+ * $Id:$
+ *
+ * Copyright 2002-2004 Day Management AG, Switzerland.
+ *
+ * Licensed under the Day RI License, Version 2.0 (the "License"),
+ * as a reference implementation of the following specification:
+ *
+ * Content Repository API for Java Technology, revision 0.13
+ * <http://www.jcp.org/en/jsr/detail?id=170>
+ *
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License files at
+ *
+ * http://www.day.com/content/en/licenses/day-ri-license-2.0
+ * 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.core.nodetype.compact;
+
+import org.apache.jackrabbit.core.nodetype.NodeTypeDef;
+import org.apache.jackrabbit.core.nodetype.PropDefImpl;
+import org.apache.jackrabbit.core.nodetype.ValueConstraint;
+import org.apache.jackrabbit.core.nodetype.NodeDefImpl;
+import org.apache.jackrabbit.core.nodetype.PropDef;
+import org.apache.jackrabbit.core.nodetype.NodeDef;
+import org.apache.jackrabbit.core.nodetype.NodeTypeDefDiff;
+import org.apache.jackrabbit.core.value.InternalValue;
+import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.util.name.NamespaceMapping;
+import javax.jcr.PropertyType;
+import javax.jcr.version.OnParentVersionAction;
+import java.util.List;
+import java.io.FileReader;
+import java.io.StringWriter;
+import java.io.StringReader;
+import junit.framework.TestCase;
+
+public class CompactNodeTypeDefTest extends TestCase {
+ private static final String TEST_FILE = "applications/test/cnd-reader-test-input.cnd";
+ private static final String NS_PREFIX = "ex";
+ private static final String NS_URI = "http://apache.org/incubator/jackrabbit/example";
+
+ private static final QName NODE_TYPE_NAME = new QName(NS_URI, "NodeType");
+ private static final QName PARENT_NODE_TYPE_1 = new QName(NS_URI, "ParentNodeType1");
+ private static final QName PARENT_NODE_TYPE_2 = new QName(NS_URI, "ParentNodeType2");
+ private static final QName[] SUPERTYPES = new QName[]{PARENT_NODE_TYPE_1, PARENT_NODE_TYPE_2};
+
+ private static final QName PROPERTY_NAME = new QName(NS_URI, "property");
+ private static final long DEFAULT_VALUE_1 = 1;
+ private static final long DEFAULT_VALUE_2 = 2;
+ private static final String VALUE_CONSTRAINT = "[1,10]";
+
+ private static final QName CHILD_NODE_NAME = new QName(NS_URI, "node");
+ private static final QName REQUIRED_NODE_TYPE_1 = new QName(NS_URI, "RequiredNodeType1");
+ private static final QName REQUIRED_NODE_TYPE_2 = new QName(NS_URI, "RequiredNodeType2");
+ private static final QName[] REQUIRED_NODE_TYPES = new QName[]{REQUIRED_NODE_TYPE_1, REQUIRED_NODE_TYPE_2};
+
+ private NodeTypeDef modelNodeTypeDef;
+
+ protected void setUp() throws Exception {
+ NamespaceMapping namespaceMapping = new NamespaceMapping();
+ namespaceMapping.setMapping(NS_PREFIX, NS_URI);
+ InternalValue dv1 = InternalValue.create(DEFAULT_VALUE_1);
+ InternalValue dv2 = InternalValue.create(DEFAULT_VALUE_2);
+ ValueConstraint vc = ValueConstraint.create(PropertyType.LONG, VALUE_CONSTRAINT, namespaceMapping);
+ InternalValue[] defaultValues = new InternalValue[]{dv1, dv2};
+ ValueConstraint[] valueConstraints = new ValueConstraint[]{vc};
+
+ PropDefImpl pd = new PropDefImpl();
+ pd.setName(PROPERTY_NAME);
+ pd.setRequiredType(PropertyType.LONG);
+ pd.setMandatory(true);
+ pd.setAutoCreated(true);
+ pd.setProtected(true);
+ pd.setMultiple(true);
+ pd.setOnParentVersion(OnParentVersionAction.VERSION);
+ pd.setDefaultValues(defaultValues);
+ pd.setValueConstraints(valueConstraints);
+ pd.setDeclaringNodeType(NODE_TYPE_NAME);
+
+ NodeDefImpl nd = new NodeDefImpl();
+ nd.setName(CHILD_NODE_NAME);
+ nd.setRequiredPrimaryTypes(REQUIRED_NODE_TYPES);
+ nd.setDefaultPrimaryType(REQUIRED_NODE_TYPE_1);
+ nd.setMandatory(true);
+ nd.setAutoCreated(true);
+ nd.setProtected(true);
+ nd.setAllowsSameNameSiblings(true);
+ nd.setOnParentVersion(OnParentVersionAction.VERSION);
+ nd.setDeclaringNodeType(NODE_TYPE_NAME);
+
+ modelNodeTypeDef = new NodeTypeDef();
+ modelNodeTypeDef.setName(NODE_TYPE_NAME);
+ modelNodeTypeDef.setSupertypes(SUPERTYPES);
+ modelNodeTypeDef.setOrderableChildNodes(true);
+ modelNodeTypeDef.setMixin(true);
+ modelNodeTypeDef.setPrimaryItemName(PROPERTY_NAME);
+ modelNodeTypeDef.setPropertyDefs(new PropDef[]{pd});
+ modelNodeTypeDef.setChildNodeDefs(new NodeDef[]{nd});
+ }
+
+ public void testCompactNodeTypeDef() throws Exception {
+
+ // Read in node type def from test file
+ CompactNodeTypeDefReader cndReader = new CompactNodeTypeDefReader(new FileReader(TEST_FILE), TEST_FILE);
+ List ntdList = cndReader.getNodeTypeDefs();
+ NamespaceMapping nsm = cndReader.getNamespaceMapping();
+ NodeTypeDef ntd = (NodeTypeDef)ntdList.get(0);
+
+ // Test CND Reader by comparing imported NTD with model NTD.
+ NodeTypeDefDiff diff = NodeTypeDefDiff.create(modelNodeTypeDef, ntd);
+ if (diff.isModified()){
+ fail("Imported node type definition is not identical to model definition");
+ }
+
+ // Put imported node type def back into CND form with CND writer
+ StringWriter sw = new StringWriter();
+ CompactNodeTypeDefWriter cndWriter = new CompactNodeTypeDefWriter(ntdList, nsm, sw);
+ cndWriter.write();
+ cndWriter.close();
+
+ // Rerun the reader on the product of the writer
+ cndReader = new CompactNodeTypeDefReader(new StringReader(sw.toString()), TEST_FILE);
+ ntdList = cndReader.getNodeTypeDefs();
+ ntd = (NodeTypeDef)ntdList.get(0);
+
+ diff = NodeTypeDefDiff.create(modelNodeTypeDef, ntd);
+ if (diff.isModified()){
+ fail("Exported node type definition was not successfully read back in");
+ }
+ }
+}
Propchange: incubator/jackrabbit/trunk/contrib/nt-ns-util/src/test/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/jackrabbit/trunk/contrib/nt-ns-util/src/test/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefTest.java
------------------------------------------------------------------------------
svn:keywords = author date id revision url
Added: incubator/jackrabbit/trunk/contrib/nt-ns-util/src/test/java/org/apache/jackrabbit/core/nodetype/compact/TestAll.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/nt-ns-util/src/test/java/org/apache/jackrabbit/core/nodetype/compact/TestAll.java?rev=358028&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/nt-ns-util/src/test/java/org/apache/jackrabbit/core/nodetype/compact/TestAll.java (added)
+++ incubator/jackrabbit/trunk/contrib/nt-ns-util/src/test/java/org/apache/jackrabbit/core/nodetype/compact/TestAll.java Tue Dec 20 08:20:16 2005
@@ -0,0 +1,47 @@
+/*
+ * $Id:$
+ *
+ * Copyright 2002-2004 Day Management AG, Switzerland.
+ *
+ * Licensed under the Day RI License, Version 2.0 (the "License"),
+ * as a reference implementation of the following specification:
+ *
+ * Content Repository API for Java Technology, revision 0.13
+ * <http://www.jcp.org/en/jsr/detail?id=170>
+ *
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License files at
+ *
+ * http://www.day.com/content/en/licenses/day-ri-license-2.0
+ * 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.core.nodetype.compact;
+
+import junit.framework.TestCase;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Test suite that includes all test cases for compact node type tools.
+ */
+public class TestAll extends TestCase {
+
+ /**
+ * Returns a <code>Test</code> suite that executes all tests inside this
+ * package.
+ *
+ * @return a <code>Test</code> suite that executes all tests inside this
+ * package.
+ */
+ public static Test suite() {
+ TestSuite suite = new TestSuite("Compact Node Type Tools Tests");
+ suite.addTestSuite(org.apache.jackrabbit.core.nodetype.compact.CompactNodeTypeDefTest.class);
+ return suite;
+ }
+}
\ No newline at end of file
Propchange: incubator/jackrabbit/trunk/contrib/nt-ns-util/src/test/java/org/apache/jackrabbit/core/nodetype/compact/TestAll.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/jackrabbit/trunk/contrib/nt-ns-util/src/test/java/org/apache/jackrabbit/core/nodetype/compact/TestAll.java
------------------------------------------------------------------------------
svn:keywords = author date id revision url
Added: incubator/jackrabbit/trunk/contrib/nt-ns-util/src/test/java/org/apache/jackrabbit/util/nodetype/SchemaConverterTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/nt-ns-util/src/test/java/org/apache/jackrabbit/util/nodetype/SchemaConverterTest.java?rev=358028&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/nt-ns-util/src/test/java/org/apache/jackrabbit/util/nodetype/SchemaConverterTest.java (added)
+++ incubator/jackrabbit/trunk/contrib/nt-ns-util/src/test/java/org/apache/jackrabbit/util/nodetype/SchemaConverterTest.java Tue Dec 20 08:20:16 2005
@@ -0,0 +1,100 @@
+/*
+ * $Id:$
+ *
+ * Copyright 2002-2004 Day Management AG, Switzerland.
+ *
+ * Licensed under the Day RI License, Version 2.0 (the "License"),
+ * as a reference implementation of the following specification:
+ *
+ * Content Repository API for Java Technology, revision 0.13
+ * <http://www.jcp.org/en/jsr/detail?id=170>
+ *
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License files at
+ *
+ * http://www.day.com/content/en/licenses/day-ri-license-2.0
+ * 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.util.nodetype;
+
+
+import org.apache.jackrabbit.core.nodetype.compact.CompactNodeTypeDefReader;
+import org.apache.jackrabbit.util.name.NamespaceMapping;
+import org.apache.jackrabbit.util.name.NamespaceExtractor;
+import org.apache.jackrabbit.core.nodetype.NodeTypeDef;
+import org.apache.jackrabbit.name.NamespaceResolver;
+import org.apache.log4j.Logger;
+
+import java.util.*;
+import java.io.*;
+
+import junit.framework.TestCase;
+
+import javax.jcr.NamespaceException;
+
+/**
+ * Tests the SchemaConverter
+ *
+ * Usage:
+ * java SchemaConverterTest infile outfile defaultprefix
+ *
+ * infile - XML schema file to be converted
+ * outfile - file to which a pretty print of the resulting namespace mappings and node type definitions is put.
+ * defaultprefix - The prefix used in cases where the XML schema file specifies a default namespace
+ */
+public class SchemaConverterTest extends TestCase {
+
+ private static Logger log = Logger.getLogger(SchemaConverterTest.class);
+ private static final String TEST_INPUT_FILE = "applications/test/xsd-converter-test-input.xsd";
+ private static final String MODEL_RESULT_FILE = "applications/test/xsd-converter-model-output.cnd";
+ private static final String DEFAULT_PREFIX = "test";
+
+ public void testSchemaConverter() {
+ try {
+ NamespaceExtractor nse = new NamespaceExtractor(TEST_INPUT_FILE, DEFAULT_PREFIX);
+ NamespaceMapping nsm = nse.getNamespaceMapping();
+
+ SchemaConverter nts = new SchemaConverter(TEST_INPUT_FILE);
+ List testList = nts.getNodeTypeDefs();
+
+ CompactNodeTypeDefReader ntr = new CompactNodeTypeDefReader(new FileReader(MODEL_RESULT_FILE), MODEL_RESULT_FILE, nsm);
+ List modelList = ntr.getNodeTypeDefs();
+
+ TreeMap orderedTestList = new TreeMap();
+ TreeMap orderedModelList = new TreeMap();
+
+ fillTreeMap(orderedTestList, testList, nsm);
+ fillTreeMap(orderedModelList, modelList, nsm);
+
+ Iterator testIterator = orderedTestList.values().iterator();
+ Iterator modelIterator = orderedModelList.values().iterator();
+
+ while(testIterator.hasNext() && modelIterator.hasNext()){
+ NodeTypeDef testDef = (NodeTypeDef)testIterator.next();
+ NodeTypeDef modelDef = (NodeTypeDef)modelIterator.next();
+ if (!testDef.equals(modelDef)){
+ fail("test result differs from model result");
+ break;
+ }
+ }
+ } catch (Exception e) {
+ String msg = e.getMessage();
+ log.debug(msg);
+ }
+ }
+
+ private void fillTreeMap(TreeMap tm, List l, NamespaceResolver nsr) throws NamespaceException {
+ for(Iterator i = l.iterator(); i.hasNext();){
+ NodeTypeDef ntd = (NodeTypeDef)i.next();
+ String prefix = nsr.getPrefix(ntd.getName().getNamespaceURI());
+ String localName = ntd.getName().getLocalName();
+ tm.put(prefix + ":" + localName, ntd);
+ }
+ }
+}
\ No newline at end of file
Propchange: incubator/jackrabbit/trunk/contrib/nt-ns-util/src/test/java/org/apache/jackrabbit/util/nodetype/SchemaConverterTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/jackrabbit/trunk/contrib/nt-ns-util/src/test/java/org/apache/jackrabbit/util/nodetype/SchemaConverterTest.java
------------------------------------------------------------------------------
svn:keywords = author date id revision url
Added: incubator/jackrabbit/trunk/contrib/nt-ns-util/src/test/java/org/apache/jackrabbit/util/nodetype/TestAll.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/nt-ns-util/src/test/java/org/apache/jackrabbit/util/nodetype/TestAll.java?rev=358028&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/nt-ns-util/src/test/java/org/apache/jackrabbit/util/nodetype/TestAll.java (added)
+++ incubator/jackrabbit/trunk/contrib/nt-ns-util/src/test/java/org/apache/jackrabbit/util/nodetype/TestAll.java Tue Dec 20 08:20:16 2005
@@ -0,0 +1,47 @@
+/*
+ * $Id:$
+ *
+ * Copyright 2002-2004 Day Management AG, Switzerland.
+ *
+ * Licensed under the Day RI License, Version 2.0 (the "License"),
+ * as a reference implementation of the following specification:
+ *
+ * Content Repository API for Java Technology, revision 0.13
+ * <http://www.jcp.org/en/jsr/detail?id=170>
+ *
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License files at
+ *
+ * http://www.day.com/content/en/licenses/day-ri-license-2.0
+ * 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.util.nodetype;
+
+import junit.framework.TestCase;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Test suite that includes all test cases for node type utilities.
+ */
+public class TestAll extends TestCase {
+
+ /**
+ * Returns a <code>Test</code> suite that executes all tests inside this
+ * package.
+ *
+ * @return a <code>Test</code> suite that executes all tests inside this
+ * package.
+ */
+ public static Test suite() {
+ TestSuite suite = new TestSuite("Node Type Utilities Tests");
+ suite.addTestSuite(org.apache.jackrabbit.util.nodetype.SchemaConverterTest.class);
+ return suite;
+ }
+}
\ No newline at end of file
Propchange: incubator/jackrabbit/trunk/contrib/nt-ns-util/src/test/java/org/apache/jackrabbit/util/nodetype/TestAll.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/jackrabbit/trunk/contrib/nt-ns-util/src/test/java/org/apache/jackrabbit/util/nodetype/TestAll.java
------------------------------------------------------------------------------
svn:keywords = author date id revision url