db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r379576 - in /db/jdo/trunk/api20: ./ test/java/javax/jdo/schema/ test/java/javax/jdo/util/ test/schema/
Date Tue, 21 Feb 2006 20:31:36 GMT
Author: mbo
Date: Tue Feb 21 12:31:33 2006
New Revision: 379576

URL: http://svn.apache.org/viewcvs?rev=379576&view=rev
Log:
JDO-202: add schema validation test case XMLTest that is running .jdo, .orm and 
.jdoquery files against the XSD and DTD.

Added:
    db/jdo/trunk/api20/project.properties
    db/jdo/trunk/api20/test/java/javax/jdo/schema/
    db/jdo/trunk/api20/test/java/javax/jdo/schema/XMLTest.java
    db/jdo/trunk/api20/test/schema/
    db/jdo/trunk/api20/test/schema/Negative0-dtd.jdo
    db/jdo/trunk/api20/test/schema/Negative0-xsd.jdo
    db/jdo/trunk/api20/test/schema/Positive0-dtd.jdo
    db/jdo/trunk/api20/test/schema/Positive0-xsd.jdo
    db/jdo/trunk/api20/test/schema/Positive1-dtd.jdo
    db/jdo/trunk/api20/test/schema/Positive1-xsd.jdo
    db/jdo/trunk/api20/test/schema/Positive99-dtd.jdo
    db/jdo/trunk/api20/test/schema/Positive99-xsd.jdo
Modified:
    db/jdo/trunk/api20/project.xml
    db/jdo/trunk/api20/test/java/javax/jdo/util/AbstractTest.java

Added: db/jdo/trunk/api20/project.properties
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/api20/project.properties?rev=379576&view=auto
==============================================================================
--- db/jdo/trunk/api20/project.properties (added)
+++ db/jdo/trunk/api20/project.properties Tue Feb 21 12:31:33 2006
@@ -0,0 +1,17 @@
+#
+# Copyright 2006 The Apache Software Foundation.
+# 
+# Licensed 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.
+
+maven.junit.sysproperties = javax.xml.parsers.DocumentBuilderFactory basedir
+javax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl

Modified: db/jdo/trunk/api20/project.xml
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/api20/project.xml?rev=379576&r1=379575&r2=379576&view=diff
==============================================================================
--- db/jdo/trunk/api20/project.xml (original)
+++ db/jdo/trunk/api20/project.xml Tue Feb 21 12:31:33 2006
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-    Copyright 2005 The Apache Software Foundation
+    Copyright 2006 The Apache Software Foundation
 
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
@@ -40,6 +40,16 @@
             <artifactId>geronimo-spec-jta</artifactId>
             <version>1.0.1B-rc2</version>
         </dependency>
+        <dependency>
+            <groupId>xerces</groupId>
+            <artifactId>xercesImpl</artifactId>
+            <version>2.7.1</version>
+        </dependency>
+        <dependency>
+            <groupId>xerces</groupId>
+            <artifactId>xmlParserAPIs</artifactId>
+            <version>2.6.2</version>
+        </dependency>
     </dependencies>
     <!-- =================== -->
     <!-- Build Specification -->
@@ -56,6 +66,16 @@
                 <exclude>javax/jdo/util/AbstractTest.java</exclude>
                 <exclude>javax/jdo/pc/*.java</exclude>
             </excludes>
+            <resources>
+                <resource>
+                <directory>${basedir}/test/schema</directory>
+                <includes>
+                    <include>**/*.jdo</include>
+                    <include>**/*.jdoquery</include>
+                    <include>**/*.orm</include>
+                </includes>
+                </resource>
+            </resources>
         </unitTest>
         <!-- J A R  R E S O U R C E S -->
         <!-- Resources that are packaged up inside the JAR file -->

Added: db/jdo/trunk/api20/test/java/javax/jdo/schema/XMLTest.java
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/api20/test/java/javax/jdo/schema/XMLTest.java?rev=379576&view=auto
==============================================================================
--- db/jdo/trunk/api20/test/java/javax/jdo/schema/XMLTest.java (added)
+++ db/jdo/trunk/api20/test/java/javax/jdo/schema/XMLTest.java Tue Feb 21 12:31:33 2006
@@ -0,0 +1,361 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+
+package javax.jdo.schema;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.IOException;
+import java.io.FilenameFilter;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.ArrayList;
+
+import javax.jdo.JDOFatalException;
+import javax.jdo.util.AbstractTest;
+import javax.jdo.util.BatchTestRunner;
+
+import javax.xml.parsers.*;
+import org.w3c.dom.Document;
+import org.xml.sax.*;
+import org.xml.sax.helpers.*;
+
+/**
+ * Tests schema files.
+ * <p>
+ */
+public class XMLTest extends AbstractTest {
+
+    /** */
+    protected static String BASEDIR = System.getProperty("basedir", ".");
+
+    /** "http://www.w3.org/2001/XMLSchema" */
+    protected static final String XSD_TYPE = 
+        "http://www.w3.org/2001/XMLSchema";
+
+    /** */
+    protected static final String SCHEMA_LANGUAGE_PROP = 
+        "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+
+    /** */
+    protected static final String SCHEMA_LOCATION_PROP =
+        "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation";
+    
+    /** */
+    protected static final File JDO_XSD_FILE = 
+        new File(BASEDIR + "/target/classes/javax/jdo/jdo.xsd");
+
+    /** */
+    protected static final File ORM_XSD_FILE = 
+        new File(BASEDIR + "/target/classes/javax/jdo/orm.xsd");
+
+    /** */
+    protected static final File JDOQL_XSD_FILE = 
+        new File(BASEDIR + "/target/classes/javax/jdo/jdoquery.xsd");
+
+    /** File prefix */
+    protected static final String FILE_PREFIX = BASEDIR + "/test/schema/";
+
+    /** Entity resolver */
+    protected static final EntityResolver resolver = new JDOEntityResolver();
+
+    /** Error handler */
+    protected static final Handler handler = new Handler();
+
+    /** .xsd files */
+    protected static final File[] XSD_FILES = {
+        JDO_XSD_FILE, ORM_XSD_FILE, JDOQL_XSD_FILE
+    };
+    
+    /** XSD metadata files. */
+    protected static File[] positiveXSDJDO = getFiles("Positive", "-xsd.jdo");
+    protected static File[] negativeXSDJDO = getFiles("Negative", "-xsd.jdo");
+    protected static File[] positiveXSDORM = getFiles("Positive", "-xsd.orm");
+    protected static File[] negativeXSDORM = getFiles("Negative", "-xsd.orm");
+    protected static File[] positiveXSDJDOQL = getFiles("Positive", "-xsd.jdoquery");
+    protected static File[] negativeXSDJDOQL = getFiles("Negative", "-xsd.jdoquery");
+
+    /** DTD metadata files. */
+    protected static File[] positiveDTDJDO = getFiles("Positive", "-dtd.jdo");
+    protected static File[] negativeDTDJDO = getFiles("Negative", "-dtd.jdo");
+    protected static File[] positiveDTDORM = getFiles("Positive", "-dtd.orm");
+    protected static File[] negativeDTDORM = getFiles("Negative", "-dtd.orm");
+    protected static File[] positiveDTDJDOQL = getFiles("Positive", "-dtd.jdoquery");
+    protected static File[] negativeDTDJDOQL = getFiles("Negative", "-dtd.jdoquery");
+
+    /** Returns array of files of matching file names. */
+    protected static File[] getFiles(final String prefix, final String suffix) {
+        FilenameFilter filter = new FilenameFilter () {
+            public boolean accept(File file, String name) {
+                return (name.startsWith(prefix) && name.endsWith(suffix));
+            }
+        };
+        File dir = new File(FILE_PREFIX);
+        return dir.listFiles(filter);
+    }
+
+    /** */
+    public static void main(String args[]) {
+        BatchTestRunner.run(XMLTest.class);
+    }
+
+    /** Test XSD files jdo.xsd, orm.xsd, and jdoquery.xsd. */
+    public void testXSD() throws SAXException, IOException {
+        DocumentBuilder builder = null;
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        factory.setNamespaceAware(true);
+        builder = getParser(factory);
+        checkXML(builder, XSD_FILES, true);
+        String messages = retrieveMessages();
+        if (messages != null) {
+            fail(messages);
+        }        
+    }
+
+    /** Test XSD based .jdo, .orm and .jdoquery files. */
+    public void testXSDBased() {
+        // create XSD parser
+        DocumentBuilder builder = null;
+        builder = createBuilder(JDO_XSD_FILE.toURI().toString());
+        checkXML(builder, positiveXSDJDO, true);
+        checkXML(builder, negativeXSDJDO, false);
+        builder = createBuilder(ORM_XSD_FILE.toURI().toString());
+        checkXML(builder, positiveXSDORM, true);
+        checkXML(builder, negativeXSDORM, false);
+        builder = createBuilder(JDOQL_XSD_FILE.toURI().toString());
+        checkXML(builder, positiveXSDJDOQL, true);
+        checkXML(builder, negativeXSDJDOQL, false);
+        String messages = retrieveMessages();
+        if (messages != null) {
+            fail(messages);
+        }        
+    }
+
+    /** Test DTD based .jdo, .orm and .jdoquery files. */
+    public void testDTDBased() {
+        // create DTD parser 
+        DocumentBuilder builder = createBuilder();
+        checkXML(builder, positiveDTDJDO, true);
+        checkXML(builder, negativeDTDJDO, false);
+        checkXML(builder, positiveDTDORM, true);
+        checkXML(builder, negativeDTDORM, false);
+        checkXML(builder, positiveDTDJDOQL, true);
+        checkXML(builder, negativeDTDJDOQL, false);
+        String messages = retrieveMessages();
+        if (messages != null) {
+            fail(messages);
+        }        
+    }
+
+    /** Create XSD builder.
+     */
+    private DocumentBuilder createBuilder(String location) {
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        factory.setValidating(true);
+        factory.setNamespaceAware(true);
+        factory.setAttribute(SCHEMA_LANGUAGE_PROP, XSD_TYPE);
+        factory.setAttribute(SCHEMA_LOCATION_PROP, location);
+        return getParser(factory);
+    }
+
+    /** Create DTD builder.
+     */
+    private DocumentBuilder createBuilder() {
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        factory.setValidating(true);
+        factory.setNamespaceAware(true);
+        return getParser(factory);
+    }
+
+    /** Returns a parser obtained from specified factroy. */
+    private DocumentBuilder getParser(DocumentBuilderFactory factory) {
+        try {
+            DocumentBuilder builder = factory.newDocumentBuilder();
+            builder.setEntityResolver(resolver);
+            builder.setErrorHandler(handler);
+            return builder;
+        } catch (ParserConfigurationException ex) {
+            throw new JDOFatalException("Cannot create XML parser", ex);
+        }
+    }
+
+    /** Parse the specified files using the specified builder. The valid
+     * parameter determines whether the specified files are valid JDO metadata
+     * files. The method does not throw an exception on an error, instead it
+     * appends any error message to the global message handler.
+     */
+    private void checkXML(DocumentBuilder builder, File[] files, boolean valid) {
+        for (int i = 0; i < files.length; i++) {
+            File file = files[i];
+            handler.init(file);
+            try {
+                builder.parse(file);
+            } catch (SAXParseException ex) {
+                handler.error(ex);
+            } catch (Exception ex) {
+                throw new JDOFatalException("Fatal error", ex);
+            }
+            String messages = handler.getMessages();
+            if (valid && (messages != null)) {
+                appendMessage(messages);
+            } else if (!valid && (messages == null)) {
+                appendMessage(file.getName() + " is not valid, " +
+                              "but the parser did not catch the error.");
+            }
+        }
+    }
+
+    /** ErrorHandler implementation. */
+    private static class Handler implements ErrorHandler {
+
+        private File fileUnderTest;
+        private String[] lines;
+        private StringBuffer messages;
+
+        public void error(SAXParseException ex) {
+            append("Handler.error: ", ex);
+        }
+            
+        public void fatalError(SAXParseException ex) {
+            append("Handler.fatalError: ", ex);
+        }
+        
+        public void warning(SAXParseException ex) {
+            append("Handler.warning: ", ex);
+        }
+        
+        public void init(File file) {
+            this.fileUnderTest = file;
+            this.messages = new StringBuffer();
+            this.lines = null;
+        }
+
+        public String getMessages() {
+            return (messages.length() == 0) ? null : messages.toString();
+        }
+
+        private void append(String prefix, SAXParseException ex) {
+            int lineNumber = ex.getLineNumber();
+            int columnNumber = ex.getColumnNumber();
+            messages.append("------------------------").append(NL);
+            messages.append(prefix).append(fileUnderTest.getName());
+            messages.append(" [line=").append(lineNumber);
+            messages.append(", col=").append(columnNumber).append("]: ");
+            messages.append(ex.getMessage()).append(NL);
+            messages.append(getErrorLocation(lineNumber, columnNumber));
+        }
+
+        private String[] getLines() {
+            if (lines == null) {
+                try {
+                    BufferedReader bufferedReader =
+                        new BufferedReader(new FileReader(fileUnderTest));
+                    ArrayList tmp = new ArrayList();
+                    while (bufferedReader.ready()) {
+                        tmp.add(bufferedReader.readLine());
+                    }
+                    lines = (String[])tmp.toArray(new String[tmp.size()]);
+                } catch (IOException ex) {
+                    throw new JDOFatalException("getLines: caught IOException", ex);
+                }
+            }
+            return lines;
+        }
+        
+        /** Return the error location for the file under test.
+         */
+        private String getErrorLocation(int lineNumber, int columnNumber) {
+            String[] lines = getLines();
+            int length = lines.length;
+            if (lineNumber > length) {
+                return "Line number " + lineNumber +
+                    " exceeds the number of lines in the file (" +
+                    lines.length + ")";
+            } else if (lineNumber < 1) {
+                return "Line number " + lineNumber +
+                    " does not allow retriving the error location.";
+            }
+            StringBuffer buf = new StringBuffer();
+            if (lineNumber > 2) {
+                buf.append(lines[lineNumber-3]);
+                buf.append(NL);
+                buf.append(lines[lineNumber-2]);
+                buf.append(NL);
+            }
+            buf.append(lines[lineNumber-1]);
+            buf.append(NL);
+            for (int i = 1; i < columnNumber; ++i) {
+                buf.append(' ');
+            }
+            buf.append("^\n");
+            if (lineNumber + 1 < length) {
+                buf.append(lines[lineNumber]);
+                buf.append(NL);
+                buf.append(lines[lineNumber+1]);
+                buf.append(NL);
+            }
+            return buf.toString();
+        }
+    }
+
+    /** Implementation of EntityResolver interface to check the jdo.dtd location
+     **/
+    private static class JDOEntityResolver 
+        implements EntityResolver {
+
+        private static final String RECOGNIZED_PUBLIC_ID = 
+            "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.0//EN";
+        private static final String RECOGNIZED_SYSTEM_ID = 
+            "file:/javax/jdo/jdo.dtd";
+
+        public InputSource resolveEntity(String publicId, final String systemId)
+            throws SAXException, IOException 
+        {
+            // check for recognized ids
+            if (((publicId != null) && RECOGNIZED_PUBLIC_ID.equals(publicId)) ||
+                ((publicId == null) && (systemId != null) && 
+                 RECOGNIZED_SYSTEM_ID.equals(systemId))) {
+                // Substitute the dtd with the one from javax.jdo.jdo.dtd,
+                // but only if the publicId is equal to RECOGNIZED_PUBLIC_ID
+                // or there is no publicID and the systemID is equal to
+                // RECOGNIZED_SYSTEM_ID. 
+                    InputStream stream = (InputStream) AccessController.doPrivileged (
+                        new PrivilegedAction () {
+                            public Object run () {
+                            return getClass().getClassLoader().
+                                getResourceAsStream("javax/jdo/jdo.dtd");
+                            }
+                         }
+                     );
+                    if (stream == null) {
+                        // TDB: error handling + I18N
+                        throw new JDOFatalException("Cannot load javax/jdo/jdo.dtd, " +
+                            "because the file does not exist in the jdo.jar file, " +
+                            "or the JDOParser class is not granted permission to read this file.  " +
+                            "The metadata .xml file contained PUBLIC=" + publicId +
+                            " SYSTEM=" + systemId + ".");
+                    }
+                return new InputSource(new InputStreamReader(stream));
+            }
+            return null;
+        }
+    }
+}
+

Modified: db/jdo/trunk/api20/test/java/javax/jdo/util/AbstractTest.java
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/api20/test/java/javax/jdo/util/AbstractTest.java?rev=379576&r1=379575&r2=379576&view=diff
==============================================================================
--- db/jdo/trunk/api20/test/java/javax/jdo/util/AbstractTest.java (original)
+++ db/jdo/trunk/api20/test/java/javax/jdo/util/AbstractTest.java Tue Feb 21 12:31:33 2006
@@ -43,5 +43,37 @@
         if (verbose) 
             out.println(s);
     }
+    
+    /** New line.
+     */
+    public static final String NL = System.getProperty("line.separator");
+    
+    /** A buffer of of error messages.
+     */
+    protected static StringBuffer messages;
+    
+    /** Appends to error messages.
+     */
+    protected static synchronized void appendMessage(String message) {
+        if (messages == null) {
+            messages = new StringBuffer();
+        }
+        messages.append(message);
+        messages.append(NL);
+    }
+    
+    /**
+     * Returns collected error messages, or <code>null</code> if there
+     * are none, and clears the buffer.
+     */
+    protected static synchronized String retrieveMessages() {
+        if (messages == null) {
+            return null;
+        }
+        final String msg = messages.toString();
+        messages = null;
+        return msg;
+    }
+    
 }
 

Added: db/jdo/trunk/api20/test/schema/Negative0-dtd.jdo
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/api20/test/schema/Negative0-dtd.jdo?rev=379576&view=auto
==============================================================================
--- db/jdo/trunk/api20/test/schema/Negative0-dtd.jdo (added)
+++ db/jdo/trunk/api20/test/schema/Negative0-dtd.jdo Tue Feb 21 12:31:33 2006
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!-- Negative test: empty jdo element --> 
+<!DOCTYPE jdo PUBLIC 
+    "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.0//EN"
+        "http://java.sun.com/dtd/jdo_2_0.dtd">
+<jdo>
+</jdo>

Added: db/jdo/trunk/api20/test/schema/Negative0-xsd.jdo
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/api20/test/schema/Negative0-xsd.jdo?rev=379576&view=auto
==============================================================================
--- db/jdo/trunk/api20/test/schema/Negative0-xsd.jdo (added)
+++ db/jdo/trunk/api20/test/schema/Negative0-xsd.jdo Tue Feb 21 12:31:33 2006
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!-- Negative test: empty jdo element --> 
+<jdo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+     xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo">
+</jdo>

Added: db/jdo/trunk/api20/test/schema/Positive0-dtd.jdo
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/api20/test/schema/Positive0-dtd.jdo?rev=379576&view=auto
==============================================================================
--- db/jdo/trunk/api20/test/schema/Positive0-dtd.jdo (added)
+++ db/jdo/trunk/api20/test/schema/Positive0-dtd.jdo Tue Feb 21 12:31:33 2006
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE jdo PUBLIC 
+    "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.0//EN"
+        "http://java.sun.com/dtd/jdo_2_0.dtd">
+<jdo>
+    <package name="simple">
+        <class name="TestClass"/>
+    </package>
+</jdo>

Added: db/jdo/trunk/api20/test/schema/Positive0-xsd.jdo
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/api20/test/schema/Positive0-xsd.jdo?rev=379576&view=auto
==============================================================================
--- db/jdo/trunk/api20/test/schema/Positive0-xsd.jdo (added)
+++ db/jdo/trunk/api20/test/schema/Positive0-xsd.jdo Tue Feb 21 12:31:33 2006
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<jdo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+     xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo">
+    <package name="simple">
+        <class name="TestClass"/>
+    </package>
+</jdo>

Added: db/jdo/trunk/api20/test/schema/Positive1-dtd.jdo
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/api20/test/schema/Positive1-dtd.jdo?rev=379576&view=auto
==============================================================================
--- db/jdo/trunk/api20/test/schema/Positive1-dtd.jdo (added)
+++ db/jdo/trunk/api20/test/schema/Positive1-dtd.jdo Tue Feb 21 12:31:33 2006
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE jdo PUBLIC "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.0//EN" "http://java.sun.com/dtd/jdo_2_0.dtd">
+<!--
+This file contains the schema information when an implementation
+has application identity.
+-->
+<jdo>
+    <package name="org.apache.jdo.tck.pc.company">
+
+        <class name="Address" embedded-only="true" requires-extent="false"/>
+
+        <class name="Company"
+            identity-type="application"
+            objectid-class="org.apache.jdo.tck.pc.company.Company$Oid">
+            <field name="companyid" primary-key="true"/>
+            <field name="address"
+                   persistence-modifier="persistent"/>
+            <field name="departments" persistence-modifier="persistent">
+                <collection element-type="org.apache.jdo.tck.pc.company.Department"/>
+            </field>
+        </class>
+
+        <class name="DentalInsurance"
+            identity-type="application"
+            persistence-capable-superclass="org.apache.jdo.tck.pc.company.Insurance"/>
+
+        <class name="Department"
+            identity-type="application"
+            objectid-class="org.apache.jdo.tck.pc.company.Department$Oid">
+            <field name="deptid" primary-key="true"/>
+            <field name="employees" persistence-modifier="persistent">
+                <collection element-type="org.apache.jdo.tck.pc.company.Employee"/>
+            </field>
+            <field name="fundedEmps" persistence-modifier="persistent">
+                <collection element-type="org.apache.jdo.tck.pc.company.Employee"/>
+            </field>
+        </class>
+
+        <class name="Employee"
+            identity-type="application"
+            persistence-capable-superclass="org.apache.jdo.tck.pc.company.Person">
+            <field name="reviewedProjects" persistence-modifier="persistent">
+                <collection element-type="org.apache.jdo.tck.pc.company.Project"/>
+            </field>
+            <field name="projects" persistence-modifier="persistent">
+                <collection element-type="org.apache.jdo.tck.pc.company.Project"/>
+            </field>
+            <field name="team" persistence-modifier="persistent">
+                <collection element-type="org.apache.jdo.tck.pc.company.Employee"/>
+            </field>
+            <field name="hradvisees" persistence-modifier="persistent">
+                <collection element-type="org.apache.jdo.tck.pc.company.Employee"/>
+            </field>
+        </class>
+
+        <class name="FullTimeEmployee"
+            identity-type="application"
+            persistence-capable-superclass="org.apache.jdo.tck.pc.company.Employee"/>
+
+        <class name="Insurance"
+            identity-type="application"
+            objectid-class="org.apache.jdo.tck.pc.company.Insurance$Oid">
+            <field name="insid" primary-key="true"/>
+        </class>
+
+        <class name="MedicalInsurance"
+            identity-type="application"
+            persistence-capable-superclass="org.apache.jdo.tck.pc.company.Insurance"
+        />
+
+        <class name="PartTimeEmployee"
+            identity-type="application"
+            persistence-capable-superclass="org.apache.jdo.tck.pc.company.Employee"/>
+
+        <class name="Person"
+            identity-type="application"
+            objectid-class="org.apache.jdo.tck.pc.company.Person$Oid">
+            <field name="personid" primary-key="true"/>
+            <field name="middlename" default-fetch-group="false"/>
+            <field name="address"
+                   persistence-modifier="persistent"/>
+            <field name="phoneNumbers" persistence-modifier="persistent">
+                <map key-type="String" value-type="String"/>
+            </field>
+            <query name="validNotUnique">
+                SELECT firstname, lastname 
+                INTO org.apache.jdo.tck.query.result.classes.FullName 
+                FROM org.apache.jdo.tck.pc.company.Person
+            </query>
+            <query name="validUnique">
+                SELECT UNIQUE firstname, lastname 
+                INTO org.apache.jdo.tck.query.result.classes.FullName 
+                FROM org.apache.jdo.tck.pc.company.Person 
+                WHERE firstname == 'emp1First'
+            </query>
+            <query name="invalidUnique">
+                SELECT UNIQUE firstname, lastname 
+                INTO org.apache.jdo.tck.query.result.classes.FullName
+                FROM org.apache.jdo.tck.pc.company.Person
+            </query>
+            <query name="unmodifiable" unmodifiable="true">
+                SELECT firstname, lastname 
+                FROM org.apache.jdo.tck.pc.company.Person
+            </query>
+            <query name="packageJDO">
+                SELECT FROM org.apache.jdo.tck.pc.company.Person
+                WHERE personid > 1
+            </query>
+            <query name="changeQuery">
+                SELECT FROM org.apache.jdo.tck.pc.company.Person
+            </query>
+            <query name="invalidQuery">
+                SeLeCt FrOm org.apache.jdo.tck.pc.company.Person
+            </query>
+        </class>
+
+        <class name="Project"
+            identity-type="application"
+            objectid-class="org.apache.jdo.tck.pc.company.Project$Oid">
+            <field name="projid" primary-key="true"/>
+            <field name="reviewers" persistence-modifier="persistent">
+                <collection element-type="org.apache.jdo.tck.pc.company.Employee"/>
+            </field>
+            <field name="members" persistence-modifier="persistent">
+                <collection element-type="org.apache.jdo.tck.pc.company.Employee"/>
+            </field>
+        </class>
+    </package>
+</jdo>

Added: db/jdo/trunk/api20/test/schema/Positive1-xsd.jdo
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/api20/test/schema/Positive1-xsd.jdo?rev=379576&view=auto
==============================================================================
--- db/jdo/trunk/api20/test/schema/Positive1-xsd.jdo (added)
+++ db/jdo/trunk/api20/test/schema/Positive1-xsd.jdo Tue Feb 21 12:31:33 2006
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+This file contains the schema information when an implementation
+has application identity.
+-->
+<jdo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+     xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo">
+    <package name="org.apache.jdo.tck.pc.company">
+
+        <class name="Address" embedded-only="true" requires-extent="false"/>
+
+        <class name="Company"
+            identity-type="application"
+            objectid-class="org.apache.jdo.tck.pc.company.Company$Oid">
+            <field name="companyid" primary-key="true"/>
+            <field name="address"
+                   persistence-modifier="persistent"/>
+            <field name="departments" persistence-modifier="persistent">
+                <collection element-type="org.apache.jdo.tck.pc.company.Department"/>
+            </field>
+        </class>
+
+        <class name="DentalInsurance"
+            identity-type="application"
+            persistence-capable-superclass="org.apache.jdo.tck.pc.company.Insurance"/>
+
+        <class name="Department"
+            identity-type="application"
+            objectid-class="org.apache.jdo.tck.pc.company.Department$Oid">
+            <field name="deptid" primary-key="true"/>
+            <field name="employees" persistence-modifier="persistent">
+                <collection element-type="org.apache.jdo.tck.pc.company.Employee"/>
+            </field>
+            <field name="fundedEmps" persistence-modifier="persistent">
+                <collection element-type="org.apache.jdo.tck.pc.company.Employee"/>
+            </field>
+        </class>
+
+        <class name="Employee"
+            identity-type="application"
+            persistence-capable-superclass="org.apache.jdo.tck.pc.company.Person">
+            <field name="reviewedProjects" persistence-modifier="persistent">
+                <collection element-type="org.apache.jdo.tck.pc.company.Project"/>
+            </field>
+            <field name="projects" persistence-modifier="persistent">
+                <collection element-type="org.apache.jdo.tck.pc.company.Project"/>
+            </field>
+            <field name="team" persistence-modifier="persistent">
+                <collection element-type="org.apache.jdo.tck.pc.company.Employee"/>
+            </field>
+            <field name="hradvisees" persistence-modifier="persistent">
+                <collection element-type="org.apache.jdo.tck.pc.company.Employee"/>
+            </field>
+        </class>
+
+        <class name="FullTimeEmployee"
+            identity-type="application"
+            persistence-capable-superclass="org.apache.jdo.tck.pc.company.Employee"/>
+
+        <class name="Insurance"
+            identity-type="application"
+            objectid-class="org.apache.jdo.tck.pc.company.Insurance$Oid">
+            <field name="insid" primary-key="true"/>
+        </class>
+
+        <class name="MedicalInsurance"
+            identity-type="application"
+            persistence-capable-superclass="org.apache.jdo.tck.pc.company.Insurance"
+        />
+
+        <class name="PartTimeEmployee"
+            identity-type="application"
+            persistence-capable-superclass="org.apache.jdo.tck.pc.company.Employee"/>
+
+        <class name="Person"
+            identity-type="application"
+            objectid-class="org.apache.jdo.tck.pc.company.Person$Oid">
+            <field name="personid" primary-key="true"/>
+            <field name="middlename" default-fetch-group="false"/>
+            <field name="address"
+                   persistence-modifier="persistent"/>
+            <field name="phoneNumbers" persistence-modifier="persistent">
+                <map key-type="String" value-type="String"/>
+            </field>
+            <query name="validNotUnique">
+                SELECT firstname, lastname 
+                INTO org.apache.jdo.tck.query.result.classes.FullName 
+                FROM org.apache.jdo.tck.pc.company.Person
+            </query>
+            <query name="validUnique">
+                SELECT UNIQUE firstname, lastname 
+                INTO org.apache.jdo.tck.query.result.classes.FullName 
+                FROM org.apache.jdo.tck.pc.company.Person 
+                WHERE firstname == 'emp1First'
+            </query>
+            <query name="invalidUnique">
+                SELECT UNIQUE firstname, lastname 
+                INTO org.apache.jdo.tck.query.result.classes.FullName
+                FROM org.apache.jdo.tck.pc.company.Person
+            </query>
+            <query name="unmodifiable" unmodifiable="true">
+                SELECT firstname, lastname 
+                FROM org.apache.jdo.tck.pc.company.Person
+            </query>
+            <query name="packageJDO">
+                SELECT FROM org.apache.jdo.tck.pc.company.Person
+                WHERE personid > 1
+            </query>
+            <query name="changeQuery">
+                SELECT FROM org.apache.jdo.tck.pc.company.Person
+            </query>
+            <query name="invalidQuery">
+                SeLeCt FrOm org.apache.jdo.tck.pc.company.Person
+            </query>
+        </class>
+
+        <class name="Project"
+            identity-type="application"
+            objectid-class="org.apache.jdo.tck.pc.company.Project$Oid">
+            <field name="projid" primary-key="true"/>
+            <field name="reviewers" persistence-modifier="persistent">
+                <collection element-type="org.apache.jdo.tck.pc.company.Employee"/>
+            </field>
+            <field name="members" persistence-modifier="persistent">
+                <collection element-type="org.apache.jdo.tck.pc.company.Employee"/>
+            </field>
+        </class>
+    </package>
+</jdo>

Added: db/jdo/trunk/api20/test/schema/Positive99-dtd.jdo
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/api20/test/schema/Positive99-dtd.jdo?rev=379576&view=auto
==============================================================================
--- db/jdo/trunk/api20/test/schema/Positive99-dtd.jdo (added)
+++ db/jdo/trunk/api20/test/schema/Positive99-dtd.jdo Tue Feb 21 12:31:33 2006
@@ -0,0 +1,429 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE jdo SYSTEM "file:/javax/jdo/jdo.dtd">
+<jdo>
+  <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+  <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+  <package 
+    name="org.apache.jdo"
+    catalog="CATALOG"
+    schema="SCHEMA">
+    <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+    <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+    <interface 
+      name="Datastore" 
+      table="TABLE" 
+      identity-type="datastore"
+      objectid-class="ObjectidClass"  
+      requires-extent="true"
+      detachable="true"
+      embedded-only="true"
+      catalog="CATALOG"
+      schema="SCHEMA">
+      <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      <datastore-identity
+        column="COLUMN"
+        strategy="anything"
+        sequence="SEQUENCE">
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <column/>
+        <column/>        
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      </datastore-identity>
+      <primary-key/>
+      <inheritance
+        strategy="anything">
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <join/>
+        <discriminator
+          column="COLUMN"
+          value="VALUE"
+          strategy="anything"
+          indexed="true">
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <column/>
+          <column/>
+          <index/>        
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        </discriminator>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      </inheritance>
+      <version
+        strategy="anything"
+        column="COLUMN"
+        indexed="true">
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <column/>
+        <column/>
+        <index/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      </version>
+      <join/>
+      <foreign-key/>
+      <index/>
+      <unique/>
+      <property
+        name="property1"
+        persistence-modifier="persistent"
+        default-fetch-group="true"
+        load-fetch-group="load"
+        null-value="default"
+        dependent="true"
+        embedded="true"
+        primary-key="true"
+        value-strategy="valuestrategy"
+        sequence="sequence"
+        serialized="true"
+        table="TABLE"
+        column="COLUMN"
+        delete-action="restrict"
+        indexed="true"
+        unique="true"
+        mapped-by="mappedby"
+        fetch-group="fetchgroup"
+        recursion-depth="fetchdepth"
+        field-name="fieldname">
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <array
+          element-type="ArrayElementType"
+          embedded-element="true"
+          dependent-element="true"
+          serialized-element="true">
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        </array>  
+        <join
+          table="JOINTABLE"
+          column="JOINCOLUMN"
+          outer="true"
+          delete-action="restrict"
+          indexed="true"
+          unique="true">
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <primary-key
+            name="JOINPRIMARYKEY"
+            column="JOINPRIMARYKEYCOLUMN">
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+            <column
+              name="PRIMARYKEYCOLUMN"
+              target="TARGET"
+              target-field="TARGETFIELD"
+              jdbc-type="JDBCTYPE"
+              sql-type="SQLTYPE"
+              length="17"
+              scale="12"
+              allows-null="true"
+              default-value="DEFAULTVALUE"
+              insert-value="INSERTVALUE">
+              <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+              <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+            </column>
+            <column/>
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          </primary-key>
+          <column
+              allows-null="false"/>
+          <column/>
+          <foreign-key
+            table="TABLE"
+            deferred="true"
+            delete-action="cascade"
+            update-action="cascade"
+            unique="true"
+            name="foreignkey">
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+            <column/>
+            <column/>
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          </foreign-key>
+          <index
+            name="INDEXNAME"
+            table="TABLE"
+            unique="true">
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+            <field name="name5"/>
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          </index>  
+          <unique
+            name="UNIQUENAME"
+            table="TABLE"
+            deferred="true">
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+            <property name="name11"/>
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          </unique>  
+        </join>  
+        <embedded
+          owner-field="owner"
+          null-indicator-column="COLUMN"
+          null-indicator-value="NULL">
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <field name="name13"/>
+          <field name="name14"/>
+          <property name="name15"/>
+          <property name="name16"/>          
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        </embedded>
+        <element
+          column="COLUMN"
+          table="TABLE"
+          delete-action="restrict"
+          update-action="restrict"
+          indexed="true"
+          unique="true">
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <embedded/>
+          <column/>
+          <column/>
+          <foreign-key/>
+          <index/>
+          <unique/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        </element>
+        <key
+          column="COLUMN"
+          table="TABLE"
+          delete-action="restrict"
+          indexed="true"
+          unique="true"
+          mapped-by="anything">
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <embedded/>
+          <column/>
+          <column/>
+          <foreign-key/>
+          <index/>
+          <unique/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        </key>  
+        <value
+          column="COLUMN"
+          table="TABLE"
+          delete-action="restrict"
+          indexed="true"
+          unique="true"
+          mapped-by="anything">
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <embedded/>
+          <column/>
+          <column/>
+          <foreign-key/>
+          <index/>
+          <unique/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        </value>
+        <order
+          column="COLUMN"
+          mapped-by="anything">
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <column/>
+          <column/>
+          <index/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        </order> 
+        <column/>
+        <column/>
+        <foreign-key/>
+        <index/>
+        <unique/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      </property>  
+      <property
+        name="property2"
+        persistence-modifier="transactional"
+        default-fetch-group="false"
+        null-value="exception"
+        dependent="false"
+        embedded="false"
+        primary-key="false"
+        serialized="false"
+        delete-action="cascade"
+        indexed="false"
+        unique="false">
+        <collection
+          element-type="CollectionElementType"
+          embedded-element="true"
+          dependent-element="true"
+          serialized-element="true">
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        </collection>  
+      </property>  
+      <property
+        name="property3"
+        persistence-modifier="none"
+        null-value="none"
+        delete-action="null"
+        indexed="unique">
+        <map
+          key-type="mapkeytype"
+          embedded-key="true"
+          dependent-key="true"
+          serialized-key="true"
+          value-type="mapvaluetype"
+          embedded-value="true"
+          dependent-value="true"
+          serialized-value="true">
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        </map>
+      </property>
+      <property
+        name="property4"
+        delete-action="default"/>
+      <property
+        name="property5"
+        delete-action="none"/>
+      <query
+        name="QUERY"
+        language="javax.jdo.JDOQL"
+        unmodifiable="true"
+        unique="true"
+        result-class="ResultClass">
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        SELECT name FROM Employee
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      </query>
+      <fetch-group
+        name="FetchGroup"
+        post-load="true">
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <property name="name17"/>
+        <field name="name18"/>
+        <field name="name19"/>
+        <property name="name20"/>
+        <field name="name21"/>
+        <property name="name22"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      </fetch-group>
+      <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+    </interface>
+    <interface
+      name="Interface2"
+      table="TABLE"
+      identity-type="application"
+      requires-extent="false"
+      detachable="false"
+      embedded-only="false"/>
+    <class
+      name="ApplicationCapable"
+      identity-type="application"
+      objectid-class="ObjectidClass"
+      table="TABLE"
+      requires-extent="true"
+      persistence-capable-superclass="true"
+      detachable="true"
+      embedded-only="true"
+      persistence-modifier="persistence-capable"
+      catalog="CATALOG"
+      schema="SCHEMA">
+      <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      <implements
+        name="Interface1">
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <property name="name23"/>
+        <property name="name24"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      </implements>
+      <implements
+        name="Interface2"/>
+      <datastore-identity/>
+      <primary-key/>
+      <inheritance/>
+      <version/>
+      <join/>
+      <join/>
+      <foreign-key/>
+      <foreign-key/>
+      <index/>
+      <index/>
+      <unique/>
+      <unique/>
+      <column/>
+      <column/>
+      <field
+          name="name"
+          primary-key="true">
+        <extension vendor-name="sunw" key="index" value="btree"/>
+      </field>
+      <field name="salary" default-fetch-group="true"/>
+      <field name="dept">
+        <extension vendor-name="sunw" key="inverse" value="emps"/>
+      </field>
+      <field name="boss"/>
+      <property name="name25"/>
+      <property name="name26"/>
+      <query/>
+      <query/>
+      <fetch-group name="FetchGroup2"/>
+      <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+    </class>
+    <class
+        name="DatastoreAware"
+        identity-type="datastore"
+        requires-extent="false"
+        persistence-capable-superclass="false"
+        detachable="false"
+        embedded-only="false"
+        persistence-modifier="persistence-aware"
+        catalog="CATALOG"
+        schema="SCHEMA"/>
+    <class
+        name="NondurableNonpersistent"
+        identity-type="nondurable"
+        persistence-modifier="non-persistent"/>
+    <sequence
+      name="sequence1"
+      datastore-sequence="SEQUENCE"
+      factory-class="FactoryClass"
+      strategy="nontransactional">
+      <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+    </sequence>
+    <sequence
+      name="sequence2"
+      strategy="contiguous"/>
+    <sequence
+      name="sequence3"
+      strategy="noncontiguous"/>
+  </package>
+  <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+</jdo>

Added: db/jdo/trunk/api20/test/schema/Positive99-xsd.jdo
URL: http://svn.apache.org/viewcvs/db/jdo/trunk/api20/test/schema/Positive99-xsd.jdo?rev=379576&view=auto
==============================================================================
--- db/jdo/trunk/api20/test/schema/Positive99-xsd.jdo (added)
+++ db/jdo/trunk/api20/test/schema/Positive99-xsd.jdo Tue Feb 21 12:31:33 2006
@@ -0,0 +1,429 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<jdo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+     xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo">
+  <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+  <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+  <package 
+    name="org.apache.jdo"
+    catalog="CATALOG"
+    schema="SCHEMA">
+    <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+    <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+    <interface 
+      name="Datastore" 
+      table="TABLE" 
+      identity-type="datastore"
+      objectid-class="ObjectidClass"  
+      requires-extent="true"
+      detachable="true"
+      embedded-only="true"
+      catalog="CATALOG"
+      schema="SCHEMA">
+      <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      <datastore-identity
+        column="COLUMN"
+        strategy="anything"
+        sequence="SEQUENCE">
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <column/>
+        <column/>        
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      </datastore-identity>
+      <primary-key/>
+      <inheritance
+        strategy="anything">
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <join/>
+        <discriminator
+          column="COLUMN"
+          value="VALUE"
+          strategy="anything"
+          indexed="true">
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <column/>
+          <column/>
+          <index/>        
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        </discriminator>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      </inheritance>
+      <version
+        strategy="anything"
+        column="COLUMN"
+        indexed="true">
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <column/>
+        <column/>
+        <index/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      </version>
+      <join/>
+      <foreign-key/>
+      <index/>
+      <unique/>
+      <property
+        name="property1"
+        persistence-modifier="persistent"
+        default-fetch-group="true"
+        load-fetch-group="load"
+        null-value="default"
+        dependent="true"
+        embedded="true"
+        primary-key="true"
+        value-strategy="valuestrategy"
+        sequence="sequence"
+        serialized="true"
+        table="TABLE"
+        column="COLUMN"
+        delete-action="restrict"
+        indexed="true"
+        unique="true"
+        mapped-by="mappedby"
+        fetch-group="fetchgroup"
+        recursion-depth="fetchdepth"
+        field-name="fieldname">
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <array
+          element-type="ArrayElementType"
+          embedded-element="true"
+          dependent-element="true"
+          serialized-element="true">
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        </array>  
+        <join
+          table="JOINTABLE"
+          column="JOINCOLUMN"
+          outer="true"
+          delete-action="restrict"
+          indexed="true"
+          unique="true">
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <primary-key
+            name="JOINPRIMARYKEY"
+            column="JOINPRIMARYKEYCOLUMN">
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+            <column
+              name="PRIMARYKEYCOLUMN"
+              target="TARGET"
+              target-field="TARGETFIELD"
+              jdbc-type="JDBCTYPE"
+              sql-type="SQLTYPE"
+              length="17"
+              scale="12"
+              allows-null="true"
+              default-value="DEFAULTVALUE"
+              insert-value="INSERTVALUE">
+              <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+              <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+            </column>
+            <column/>
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          </primary-key>
+          <column
+              allows-null="false"/>
+          <column/>
+          <foreign-key
+            table="TABLE"
+            deferred="true"
+            delete-action="cascade"
+            update-action="cascade"
+            unique="true"
+            name="foreignkey">
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+            <column/>
+            <column/>
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          </foreign-key>
+          <index
+            name="INDEXNAME"
+            table="TABLE"
+            unique="true">
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+            <field name="name5"/>
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          </index>  
+          <unique
+            name="UNIQUENAME"
+            table="TABLE"
+            deferred="true">
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+            <property name="name11"/>
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+            <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          </unique>  
+        </join>  
+        <embedded
+          owner-field="owner"
+          null-indicator-column="COLUMN"
+          null-indicator-value="NULL">
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <field name="name13"/>
+          <field name="name14"/>
+          <property name="name15"/>
+          <property name="name16"/>          
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        </embedded>
+        <element
+          column="COLUMN"
+          table="TABLE"
+          delete-action="restrict"
+          update-action="restrict"
+          indexed="true"
+          unique="true">
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <embedded/>
+          <column/>
+          <column/>
+          <foreign-key/>
+          <index/>
+          <unique/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        </element>
+        <key
+          column="COLUMN"
+          table="TABLE"
+          delete-action="restrict"
+          indexed="true"
+          unique="true"
+          mapped-by="anything">
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <embedded/>
+          <column/>
+          <column/>
+          <foreign-key/>
+          <index/>
+          <unique/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        </key>  
+        <value
+          column="COLUMN"
+          table="TABLE"
+          delete-action="restrict"
+          indexed="true"
+          unique="true"
+          mapped-by="anything">
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <embedded/>
+          <column/>
+          <column/>
+          <foreign-key/>
+          <index/>
+          <unique/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        </value>
+        <order
+          column="COLUMN"
+          mapped-by="anything">
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <column/>
+          <column/>
+          <index/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        </order> 
+        <column/>
+        <column/>
+        <foreign-key/>
+        <index/>
+        <unique/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      </property>  
+      <property
+        name="property2"
+        persistence-modifier="transactional"
+        default-fetch-group="false"
+        null-value="exception"
+        dependent="false"
+        embedded="false"
+        primary-key="false"
+        serialized="false"
+        delete-action="cascade"
+        indexed="false"
+        unique="false">
+        <collection
+          element-type="CollectionElementType"
+          embedded-element="true"
+          dependent-element="true"
+          serialized-element="true">
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        </collection>  
+      </property>  
+      <property
+        name="property3"
+        persistence-modifier="none"
+        null-value="none"
+        delete-action="null"
+        indexed="unique">
+        <map
+          key-type="mapkeytype"
+          embedded-key="true"
+          dependent-key="true"
+          serialized-key="true"
+          value-type="mapvaluetype"
+          embedded-value="true"
+          dependent-value="true"
+          serialized-value="true">
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+          <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        </map>
+      </property>
+      <property
+        name="property4"
+        delete-action="default"/>
+      <property
+        name="property5"
+        delete-action="none"/>
+      <query
+        name="QUERY"
+        language="javax.jdo.JDOQL"
+        unmodifiable="true"
+        unique="true"
+        result-class="ResultClass">
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        SELECT name FROM Employee
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      </query>
+      <fetch-group
+        name="FetchGroup"
+        post-load="true">
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <property name="name17"/>
+        <field name="name18"/>
+        <field name="name19"/>
+        <property name="name20"/>
+        <field name="name21"/>
+        <property name="name22"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      </fetch-group>
+      <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+    </interface>
+    <interface
+      name="Interface2"
+      table="TABLE"
+      identity-type="application"
+      requires-extent="false"
+      detachable="false"
+      embedded-only="false"/>
+    <class
+      name="ApplicationCapable"
+      identity-type="application"
+      objectid-class="ObjectidClass"
+      table="TABLE"
+      requires-extent="true"
+      persistence-capable-superclass="true"
+      detachable="true"
+      embedded-only="true"
+      persistence-modifier="persistence-capable"
+      catalog="CATALOG"
+      schema="SCHEMA">
+      <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      <implements
+        name="Interface1">
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <property name="name23"/>
+        <property name="name24"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+        <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      </implements>
+      <implements
+        name="Interface2"/>
+      <datastore-identity/>
+      <primary-key/>
+      <inheritance/>
+      <version/>
+      <join/>
+      <join/>
+      <foreign-key/>
+      <foreign-key/>
+      <index/>
+      <index/>
+      <unique/>
+      <unique/>
+      <column/>
+      <column/>
+      <field
+          name="name"
+          primary-key="true">
+        <extension vendor-name="sunw" key="index" value="btree"/>
+      </field>
+      <field name="salary" default-fetch-group="true"/>
+      <field name="dept">
+        <extension vendor-name="sunw" key="inverse" value="emps"/>
+      </field>
+      <field name="boss"/>
+      <property name="name25"/>
+      <property name="name26"/>
+      <query/>
+      <query/>
+      <fetch-group name="FetchGroup2"/>
+      <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+    </class>
+    <class
+        name="DatastoreAware"
+        identity-type="datastore"
+        requires-extent="false"
+        persistence-capable-superclass="false"
+        detachable="false"
+        embedded-only="false"
+        persistence-modifier="persistence-aware"
+        catalog="CATALOG"
+        schema="SCHEMA"/>
+    <class
+        name="NondurableNonpersistent"
+        identity-type="nondurable"
+        persistence-modifier="non-persistent"/>
+    <sequence
+      name="sequence1"
+      datastore-sequence="SEQUENCE"
+      factory-class="FactoryClass"
+      strategy="nontransactional">
+      <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+      <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+    </sequence>
+    <sequence
+      name="sequence2"
+      strategy="contiguous"/>
+    <sequence
+      name="sequence3"
+      strategy="noncontiguous"/>
+  </package>
+  <extension vendor-name="SUNW" key="KEY" value="VALUE"/>
+</jdo>



Mime
View raw message