Index: test/java/javax/jdo/schema/SchemaTest.java =================================================================== --- test/java/javax/jdo/schema/SchemaTest.java (revision 0) +++ test/java/javax/jdo/schema/SchemaTest.java (revision 0) @@ -0,0 +1,93 @@ +/* + * Copyright 2005 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.File; +import java.io.InputStream; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import javax.jdo.pc.PCPoint; +import javax.jdo.util.AbstractTest; +import javax.jdo.util.BatchTestRunner; + +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; + +/** + * Tests schema files. + *

+ */ +public class SchemaTest extends AbstractTest { + + /** */ + public static void main(String args[]) { + BatchTestRunner.run(SchemaTest.class); + } + + static String packageName = "javax/jdo/schema"; + + static List positiveJdo = getFiles("positive", ".jdo"); + static List negativeJdo = getFiles("negative", ".jdo"); + static List positiveOrm = getFiles("positive", ".orm"); + static List negativeOrm = getFiles("negative", ".orm"); + static List positiveQuery = getFiles("positive", ".jdoquery"); + static List negativeQuery = getFiles("negative", ".jdoquery"); + + /** + * Get all files that are of the form . + * This example shows how to get all files of the form + * . Return a List of files found. + * The form of the List should make it easy to pass the file + * to the xml parser. + */ + static List getFiles(String prefix, String suffix) { + List list = new ArrayList(); + String fileName = "None found"; + for (int i = 0;; ++i) { + String middle = String.valueOf(i); + fileName = prefix + middle + suffix; + InputStream is = SchemaTest.class.getResourceAsStream(fileName); + if (is == null) break; + list.add(is); + } + return list; + } + + /** + * Try to create DOMs from the input files. + */ + public void testDTD(List files) { + for (Iterator it = files.iterator(); it.hasNext();) { + assertTrue("Failed to verify file.", + verifyFileUsingDTD(it.next())); + } + } + + /** + * Try to create a DOM from the input file. + * @return true if the input file is valid. + */ + protected boolean verifyFileUsingDTD(Object file) { + return true; + } +} Index: test/java/javax/jdo/schema/positive1.jdo =================================================================== --- test/java/javax/jdo/schema/positive1.jdo (revision 0) +++ test/java/javax/jdo/schema/positive1.jdo (revision 0) @@ -0,0 +1,9 @@ + + + + +