You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlbeans.apache.org by ce...@apache.org on 2005/03/30 03:08:56 UTC
svn commit: r159457 - in xmlbeans/trunk: ./ test/src/common/
test/src/compile/scomp/checkin/ test/src/compile/scomp/common/
test/src/compile/scomp/common/mockobj/ test/src/compile/scomp/detailed/
test/src/compile/scomp/som/common/ test/src/drt/drtcases/
test/src/misc/common/ test/src/misc/detailed/
test/src/tools/inst2xsd/common/ test/tools/src/tools/JUnit/
Author: cezar
Date: Tue Mar 29 17:08:52 2005
New Revision: 159457
URL: http://svn.apache.org/viewcvs?view=rev&rev=159457
Log:
Contributed by Jacob Danner - Refactored test files to pull location information from single location reducing code duplication. checkintest passed.
Added:
xmlbeans/trunk/test/src/common/
xmlbeans/trunk/test/src/common/Common.java
Modified:
xmlbeans/trunk/test/src/compile/scomp/checkin/XmlBeansCompCheckinTests.java
xmlbeans/trunk/test/src/compile/scomp/common/CompileCommon.java
xmlbeans/trunk/test/src/compile/scomp/common/CompileTestBase.java
xmlbeans/trunk/test/src/compile/scomp/common/mockobj/TestFiler.java
xmlbeans/trunk/test/src/compile/scomp/detailed/DetailedCompTests.java
xmlbeans/trunk/test/src/compile/scomp/detailed/XmlBeanCompilationTests.java
xmlbeans/trunk/test/src/compile/scomp/som/common/SomTestBase.java
xmlbeans/trunk/test/src/drt/drtcases/TestEnv.java
xmlbeans/trunk/test/src/misc/common/JiraTestBase.java
xmlbeans/trunk/test/src/misc/detailed/JiraRegression50_100Test.java
xmlbeans/trunk/test/src/tools/inst2xsd/common/Inst2XsdCommon.java
xmlbeans/trunk/test/src/tools/inst2xsd/common/Inst2XsdTestBase.java
xmlbeans/trunk/test/tools/src/tools/JUnit/TestReportMergeUtility.java
xmlbeans/trunk/test/tools/src/tools/JUnit/XmlResultFormatter.java
xmlbeans/trunk/test/tools/src/tools/JUnit/XmlResultFormatterImpl.java
xmlbeans/trunk/testbuild.xml
Added: xmlbeans/trunk/test/src/common/Common.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/common/Common.java?view=auto&rev=159457
==============================================================================
--- xmlbeans/trunk/test/src/common/Common.java (added)
+++ xmlbeans/trunk/test/src/common/Common.java Tue Mar 29 17:08:52 2005
@@ -0,0 +1,335 @@
+/* Copyright 2004 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 common;
+
+import org.apache.xmlbeans.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.*;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import javax.xml.namespace.QName;
+
+/**
+ *
+ */
+public class Common extends TestCase
+{
+ public static final String P = File.separator;
+
+ public static String FWROOT = getRootFile();
+ public static String CASEROOT = getCaseLocation();
+ public static String XBEAN_CASE_ROOT = getCaseLocation() + P + "xbean";
+
+ //location of files under "cases folder"
+ public static String OUTPUTROOT = FWROOT+P+"build" + P + "test" + P + "output";
+
+
+ public LinkedList errorList;
+ public XmlOptions xmOpts;
+
+ public Common(String name)
+ {
+ super(name);
+ errorList = new LinkedList();
+ xmOpts = new XmlOptions();
+ xmOpts.setErrorListener(errorList);
+ }
+
+ /**
+ * If System.property for 'xbean.rootdir' == null
+ * use '.' as basePath
+ * '.' should be where the build.xml file lives
+ *
+ * @return
+ * @throws IllegalStateException
+ */
+ public static String getRootFile() throws IllegalStateException
+ {
+ String baseDir = System.getProperty("xbean.rootdir");
+ if (baseDir == null)
+ return new File(".").getAbsolutePath();
+ else
+ return new File(baseDir).getAbsolutePath();
+ }
+
+ /**
+ * If System.property for 'cases.location' == null
+ * use '.' as basePath and add test/cases/xbea'.'
+ * should be where the build.xml file lives
+ *
+ * @return
+ * @throws IllegalStateException
+ */
+ public static String getCaseLocation() throws IllegalStateException
+ {
+ String baseDir = System.getProperty("cases.location");
+ if (baseDir == null) {
+ return new File("." + P + "test" + P + "cases").getAbsolutePath();
+ } else {
+ return new File(baseDir).getAbsolutePath();
+ }
+ }
+
+ /**
+ * Gets a case file from under CASEROOT with location passed in as strPath
+ *
+ * @param strPath
+ * @return file Object for references location
+ */
+ public static File xbeanCase(String strPath)
+ {
+ return (new File(CASEROOT, strPath));
+ }
+
+ /**
+ * Creates directory under output directory as noted by strPath
+ *
+ * @param strPath
+ * @return File Object specified by strPath
+ */
+ public static File xbeanOutput(String strPath)
+ {
+ File result = (new File(OUTPUTROOT, strPath));
+ File parentdir = result.getParentFile();
+ parentdir.mkdirs();
+ return result;
+ }
+
+ /**
+ * Recursively deletes files under specified directory
+ *
+ * @param dir
+ */
+ public static void deltree(File dir)
+ {
+ if (dir.exists()) {
+ if (dir.isDirectory()) {
+ String[] list = dir.list();
+ for (int i = 0; i < list.length; i++)
+ deltree(new File(dir, list[i]));
+ }
+ if (!dir.delete())
+ System.out.println("Could not delete " + dir);
+ //throw new IllegalStateException("Could not delete " + dir);
+ }
+ }
+
+ /**
+ * Convenience method for displaying errorListener contents after validation
+ *
+ * @param errors
+ */
+ public static void listErrors(List errors)
+ {
+ for (int i = 0; i < errors.size(); i++) {
+ XmlError error = (XmlError) errors.get(i);
+ if (error.getSeverity() == XmlError.SEVERITY_ERROR)
+ System.out.println(error.toString());
+ }
+ }
+
+ /**
+ * check list of errors/warnings/msgs and print them. Return true if errors found
+ * @param errors
+ * @return
+ */
+ public static boolean printOptionErrMsgs(Collection errors)
+ {
+ boolean errFound = false;
+ if (!errors.isEmpty()) {
+ for (Iterator i = errors.iterator(); i.hasNext();) {
+ XmlError eacherr = (XmlError) i.next();
+ int errSeverity = eacherr.getSeverity();
+ if (errSeverity == XmlError.SEVERITY_ERROR) {
+ System.out.println("Err Msg (s) at line #" + eacherr.getLine() + ": " + eacherr.getMessage());
+ errFound = true;
+ } else if (errSeverity == XmlError.SEVERITY_WARNING) {
+ System.out.println("Warning Msg (s) at line #" + eacherr.getLine() + ": " + eacherr.getMessage());
+ } else if (errSeverity == XmlError.SEVERITY_INFO) {
+ System.out.println("Info Msg (s) at line #" + eacherr.getLine() + ": " + eacherr.getMessage());
+ }
+ }
+ errors.clear();
+ }
+ return errFound;
+ }
+
+ /**
+ * Validate schemas to instance based on the docType
+ * @param schemas
+ * @param instances
+ * @param docType
+ * @throws Exception
+ */
+ public static void validateInstance(String[] schemas, String[] instances, QName docType) throws Exception
+ {
+ SchemaTypeLoader stl = makeSchemaTypeLoader(schemas);
+ XmlOptions options = new XmlOptions();
+
+ if (docType != null) {
+ SchemaType docSchema = stl.findDocumentType(docType);
+ Assert.assertTrue(docSchema != null);
+ options.put(XmlOptions.DOCUMENT_TYPE, docSchema);
+ }
+
+ for (int i = 0; i < instances.length; i++) {
+ XmlObject x =
+ stl.parse((String) instances[i], null, options);
+
+ //if (!startOnDocument) {
+ // XmlCursor c = x.newCursor();
+ // c.toFirstChild();
+ // x = c.getObject();
+ // c.dispose();
+ //}
+
+ List xel = new ArrayList();
+
+ options.put(XmlOptions.ERROR_LISTENER, xel);
+
+ boolean isValid = x.validate(options);
+
+ if (!isValid) {
+ StringBuffer errorTxt = new StringBuffer("Invalid doc, expected a valid doc: ");
+ errorTxt.append("Instance(" + i + "): ");
+ errorTxt.append(x.xmlText());
+ errorTxt.append("Errors: ");
+ for (int j = 0; j < xel.size(); j++)
+ errorTxt.append(xel.get(j) + "\n");
+ System.err.println(errorTxt.toString());
+ throw new Exception("Instance not valid\n" + errorTxt.toString());
+ }
+ }
+ }
+
+
+ /**
+ * Convenience method for creating an XmlObject from a String
+ *
+ * @param XsdAsString
+ * @return
+ */
+ public static XmlObject compileXsdString(String XsdAsString)
+ {
+ XmlObject xobj = null;
+ try {
+ xobj = XmlObject.Factory.parse(XsdAsString);
+ } catch (XmlException xme) {
+ if (!xme.getErrors().isEmpty()) {
+ for (Iterator itr = xme.getErrors().iterator(); itr.hasNext();) {
+ System.out.println("Parse Errors :" + itr.next());
+ }
+ }
+ } finally {
+ Assert.assertNotNull(xobj);
+ return xobj;
+ }
+ }
+
+
+ /**
+ * Convenience method for creating an XmlObject from a File referenced as a String of the path to the file
+ *
+ * @param XsdFilePath
+ * @return
+ */
+ public static XmlObject compileXsdFile(String XsdFilePath)
+ {
+ XmlObject xobj = null;
+ try {
+ xobj = XmlObject.Factory.parse(new File(XsdFilePath));
+ } catch (XmlException xme) {
+ if (!xme.getErrors().isEmpty()) {
+ for (Iterator itr = xme.getErrors().iterator(); itr.hasNext();) {
+ System.out.println("Parse Errors :" + itr.next());
+ }
+ }
+ } catch (IOException ioe) {
+ ioe.printStackTrace();
+ ioe.getMessage();
+ } finally {
+ Assert.assertNotNull(xobj);
+ return xobj;
+ }
+ }
+
+ /**
+ * Convenience method to create a SchemaTypeLoader from a set of xsds
+ *
+ * @param schemas
+ * @return
+ * @throws Exception
+ */
+ public static SchemaTypeLoader makeSchemaTypeLoader(String[] schemas)
+ throws Exception
+ {
+ XmlObject[] schemaDocs = new XmlObject[schemas.length];
+
+ for (int i = 0; i < schemas.length; i++) {
+ schemaDocs[i] =
+ XmlObject.Factory.parse(schemas[i]);
+ }
+
+ return XmlBeans.loadXsd(schemaDocs);
+ }
+
+ /**
+ * Is the JVM being used a 1.4 version?
+ * Used for tests involving the javasource=1.5 compilation setting
+ *
+ * @return true if java.version starts with 1.4
+ */
+ public static boolean isJDK14()
+ {
+ return System.getProperty("java.version").startsWith("1.4");
+ }
+
+ /**
+ * Convenience class for creating tests in a multithreaded env
+ */
+ public static abstract class TestThread extends Thread
+ {
+ protected Throwable _throwable;
+ protected boolean _result;
+ protected XmlOptions xm;
+ protected ArrayList errors;
+
+ public TestThread()
+ {
+ xm = new XmlOptions();
+ ArrayList errors = new ArrayList();
+ xm.setErrorListener(errors);
+ xm.setValidateOnSet();
+ }
+
+ public Throwable getException()
+ {
+ return _throwable;
+ }
+
+ public boolean getResult()
+ {
+ return _result;
+ }
+
+
+ }
+
+
+}
Modified: xmlbeans/trunk/test/src/compile/scomp/checkin/XmlBeansCompCheckinTests.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/compile/scomp/checkin/XmlBeansCompCheckinTests.java?view=diff&r1=159456&r2=159457
==============================================================================
--- xmlbeans/trunk/test/src/compile/scomp/checkin/XmlBeansCompCheckinTests.java (original)
+++ xmlbeans/trunk/test/src/compile/scomp/checkin/XmlBeansCompCheckinTests.java Tue Mar 29 17:08:52 2005
@@ -34,8 +34,7 @@
*
*/
public class XmlBeansCompCheckinTests extends CompileTestBase
-{ String P = File.separator;
- public List xm_errors;
+{ public List xm_errors;
public XmlOptions xm_opts;
Vector expBinType;
Vector expSrcType;
@@ -160,7 +159,7 @@
System.err.println(i.next());
throw e;
}
-
+
Assert.assertTrue("Expected partial schema type system", ((SchemaTypeSystemImpl)sts).isIncomplete());
@@ -171,7 +170,7 @@
File tempDir = null;
try {
//setUp outputDirectory
- tempDir = new File(CompileCommon.outputroot, "psom_save");
+ tempDir = new File(OUTPUTROOT, "psom_save");
tempDir.mkdirs();
tempDir.deleteOnExit();
Assert.assertTrue("Output Directory Init needed to be empty",
@@ -184,7 +183,7 @@
// ok
System.out.println("sts.saveToDirectory() threw IllegalStateException as expected");
}
-
+
//make sure nothing was written
Assert.assertTrue("Partial SOM output dir needed to be empty",
tempDir.listFiles().length == 0);
@@ -204,7 +203,7 @@
// ok
System.out.println("sts.save() threw IllegalStateException as expected");
}
-
+
//make sure nothing was written
Assert.assertTrue("Filer -Bin- Partial SOM " +
"output dir needed to be empty",
@@ -212,11 +211,11 @@
Assert.assertTrue("Filer -SRC- Partial SOM " +
"output dir needed to be empty",
tf.getSrcFileVec().size() == 0);
-
+
Assert.assertFalse("Filer Create Source File " +
"method should not have been invoked",
tf.isCreateSourceFile());
-
+
Assert.assertFalse("Filer Create Binary File " +
"method should not have been invoked",
tf.isCreateBinaryFile());
Modified: xmlbeans/trunk/test/src/compile/scomp/common/CompileCommon.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/compile/scomp/common/CompileCommon.java?view=diff&r1=159456&r2=159457
==============================================================================
--- xmlbeans/trunk/test/src/compile/scomp/common/CompileCommon.java (original)
+++ xmlbeans/trunk/test/src/compile/scomp/common/CompileCommon.java Tue Mar 29 17:08:52 2005
@@ -14,77 +14,20 @@
*/
package compile.scomp.common;
-import org.apache.xmlbeans.XmlError;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
import java.util.Vector;
+import common.Common;
+
/**
*
- *
+ *
*/
-public class CompileCommon {
-
- public static final String P = File.separator;
-
- public static String fwroot = getRootFile();
- public static String caseroot = fwroot +P+"test" + P + "cases";
- //location of files under "cases folder"
- public static String fileLocation = caseroot+P + "xbean" + P + "compile" + P + "scomp" + P;
- public static File outputroot = new File(fwroot, "build" + P + "test" + P + "output");
-
-
- /**
- * If System.property for 'xbean.rootdir' == null
- * use '.' as basePath
- * '.' should be where the build.xml file lives
- * @return
- * @throws IllegalStateException
- */
- public static String getRootFile() throws IllegalStateException {
- String baseDir = System.getProperty("xbean.rootdir");
- if(baseDir == null)
- return new File(".").getAbsolutePath();
- else
- return new File(baseDir).getAbsolutePath();
- }
-
- public static File xbeanCase(String str) {
- return (new File(caseroot + fileLocation, str));
- }
-
- public static File xbeanOutput(String str) {
- File result = (new File(outputroot, str));
- File parentdir = result.getParentFile();
- parentdir.mkdirs();
- return result;
- }
-
- public static void deltree(File dir) {
- if (dir.exists()) {
- if (dir.isDirectory()) {
- String[] list = dir.list();
- for (int i = 0; i < list.length; i++)
- deltree(new File(dir, list[i]));
- }
- if (!dir.delete())
- System.out.println("Could not delete " + dir);
- //throw new IllegalStateException("Could not delete " + dir);
- }
- }
+public class CompileCommon extends Common{
- public static void listErrors(List errors) {
- for (int i = 0; i < errors.size(); i++) {
- XmlError error = (XmlError) errors.get(i);
- if (error.getSeverity() == XmlError.SEVERITY_ERROR)
- System.out.println(error.toString());
- }
- }
+ public static String fileLocation = XBEAN_CASE_ROOT +P + "compile" + P + "scomp" + P;
- public static boolean isJDK14() {
- return System.getProperty("java.version").startsWith("1.4");
+ public CompileCommon(String name){
+ super(name);
}
/** compare contents of two vectors */
Modified: xmlbeans/trunk/test/src/compile/scomp/common/CompileTestBase.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/compile/scomp/common/CompileTestBase.java?view=diff&r1=159456&r2=159457
==============================================================================
--- xmlbeans/trunk/test/src/compile/scomp/common/CompileTestBase.java (original)
+++ xmlbeans/trunk/test/src/compile/scomp/common/CompileTestBase.java Tue Mar 29 17:08:52 2005
@@ -14,7 +14,6 @@
*/
package compile.scomp.common;
-import junit.framework.TestCase;
import junit.framework.Assert;
import org.apache.xmlbeans.impl.tool.SchemaCompiler;
import org.apache.xmlbeans.impl.tool.Diff;
@@ -30,12 +29,11 @@
import java.util.ArrayList;
/**
- *
+ * TODO: modify for deprecation warnings
*/
-public class CompileTestBase extends TestCase {
+public class CompileTestBase extends CompileCommon {
- public static final String P = File.separator;
- public static String outputDir = "compile" + P + "scomp" + P + "incr";
+ public static String outputDir = OUTPUTROOT+P+"compile" + P + "scomp" + P + "incr";
public static String outPath = P + outputDir + P + "out";
public static String sanityPath = P + outputDir + P + "sanity";
@@ -87,9 +85,9 @@
public CompileTestBase(String name) {
super(name);
- out = CompileCommon.xbeanOutput(outPath);
- sanity = CompileCommon.xbeanOutput(sanityPath);
- outincr = CompileCommon.xbeanOutput(incrPath);
+ out = xbeanOutput(outPath);
+ sanity = xbeanOutput(sanityPath);
+ outincr = xbeanOutput(incrPath);
errors = new ArrayList();
xm = new XmlOptions();
@@ -127,9 +125,9 @@
String classesDir, String outputDir,
SchemaCompiler.Parameters params) {
- File srcdir = CompileCommon.xbeanOutput(srcDir);
- File classesdir = CompileCommon.xbeanOutput(classesDir);
- File outputjar = CompileCommon.xbeanOutput(outputDir);
+ File srcdir = xbeanOutput(srcDir);
+ File classesdir = xbeanOutput(classesDir);
+ File outputjar = xbeanOutput(outputDir);
params.setXsdFiles(schemas);
params.setSrcDir(srcdir);
params.setClassesDir(classesdir);
@@ -150,8 +148,8 @@
/**
* compares type systems and populates error list based on differences in files
*
- * @param out
- * @param outincr
+ * @param outDir
+ * @param outIncrDir
* @param errors
*/
public void compareandPopErrors(File outDir, File outIncrDir, List errors) {
@@ -168,8 +166,6 @@
* compares type systems and populates error list based on
* default out and outincr directories
*
- * @param out
- * @param outincr
* @param errors
*/
public void compareandPopErrors(List errors) {
@@ -277,7 +273,7 @@
}
public void findElementbyQName(SchemaTypeSystem sts, QName[] lookup) throws Exception {
-
+
for (int i = 0; i < lookup.length; i++) {
if (sts.findElement(lookup[i]) == null)
throw new Exception("Element was expected but not found\n" + lookup[i]);
Modified: xmlbeans/trunk/test/src/compile/scomp/common/mockobj/TestFiler.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/compile/scomp/common/mockobj/TestFiler.java?view=diff&r1=159456&r2=159457
==============================================================================
--- xmlbeans/trunk/test/src/compile/scomp/common/mockobj/TestFiler.java (original)
+++ xmlbeans/trunk/test/src/compile/scomp/common/mockobj/TestFiler.java Tue Mar 29 17:08:52 2005
@@ -22,6 +22,7 @@
import java.io.IOException;
import java.io.Writer;
import java.util.Vector;
+import common.Common;
/**
*
@@ -38,7 +39,7 @@
public TestFiler()
{
- String base = new File("." + P + "build" + P + "test" + P + "output").getAbsolutePath() +
+ String base = new File(Common.OUTPUTROOT).getAbsolutePath() +
P + "filer" + P;
String sClass = base + "classes";
String sSrc = base + "src";
Modified: xmlbeans/trunk/test/src/compile/scomp/detailed/DetailedCompTests.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/compile/scomp/detailed/DetailedCompTests.java?view=diff&r1=159456&r2=159457
==============================================================================
--- xmlbeans/trunk/test/src/compile/scomp/detailed/DetailedCompTests.java (original)
+++ xmlbeans/trunk/test/src/compile/scomp/detailed/DetailedCompTests.java Tue Mar 29 17:08:52 2005
@@ -16,25 +16,14 @@
package compile.scomp.detailed;
import junit.framework.TestCase;
-import junit.framework.Assert;
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.apache.xmlbeans.impl.common.QNameHelper;
-import org.apache.xmlbeans.impl.tool.SchemaCodeGenerator;
-import org.apache.xmlbeans.impl.tool.SchemaCompiler;
-import org.apache.xmlbeans.impl.tool.CodeGenUtil;
-import org.apache.xmlbeans.impl.tool.Diff;
-import org.w3.x2001.xmlSchema.SchemaDocument;
-import org.w3.x2001.xmlSchema.TopLevelComplexType;
+import junit.framework.Assert;
import org.apache.xmlbeans.*;
import java.io.File;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
import java.util.*;
-import tools.util.TestRunUtil;
import compile.scomp.common.CompileCommon;
import javax.xml.namespace.QName;
@@ -70,6 +59,7 @@
try{
SchemaTypeSystem sts = XmlBeans.compileXmlBeans(null, null,
schemas, null, XmlBeans.getBuiltinTypeSystem(), null, xm_opt);
+ Assert.assertTrue("STS was null", sts != null);
}catch(XmlException xmlEx){
valDocEx = true;
System.err.println("Expected Error: "+xmlEx.getMessage());
Modified: xmlbeans/trunk/test/src/compile/scomp/detailed/XmlBeanCompilationTests.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/compile/scomp/detailed/XmlBeanCompilationTests.java?view=diff&r1=159456&r2=159457
==============================================================================
--- xmlbeans/trunk/test/src/compile/scomp/detailed/XmlBeanCompilationTests.java (original)
+++ xmlbeans/trunk/test/src/compile/scomp/detailed/XmlBeanCompilationTests.java Tue Mar 29 17:08:52 2005
@@ -38,7 +38,6 @@
*/
public class XmlBeanCompilationTests extends CompileTestBase
{
- String P = File.separator;
public List xm_errors;
public XmlOptions xm_opts;
Vector expBinType;
@@ -89,9 +88,8 @@
{
TestFiler f = new TestFiler();
//initialize all of the values
- String extCaseDir = CompileCommon.caseroot + P +
- "xbean" + P + "extensions" + P;
- String extSrcDir = CompileCommon.caseroot + P +
+ String extCaseDir = XBEAN_CASE_ROOT + P + "extensions" + P;
+ String extSrcDir = CASEROOT + P +
".." + P + "src" + P + "xmlobject" + P + "extensions" + P;
File[] cPath = CompileTestBase.getClassPath();
String dir = extCaseDir + P + "interfaceFeature" + P + "averageCase";
@@ -273,7 +271,7 @@
}
-
+
Modified: xmlbeans/trunk/test/src/compile/scomp/som/common/SomTestBase.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/compile/scomp/som/common/SomTestBase.java?view=diff&r1=159456&r2=159457
==============================================================================
--- xmlbeans/trunk/test/src/compile/scomp/som/common/SomTestBase.java (original)
+++ xmlbeans/trunk/test/src/compile/scomp/som/common/SomTestBase.java Tue Mar 29 17:08:52 2005
@@ -49,9 +49,8 @@
*/
public class SomTestBase extends CompileTestBase
{
- public static String P = File.separator;
- public static String casesRootDir = CompileCommon.caseroot + P + "xbean" + P + "compile" + P + "som" + P;
- public static String somOutputRootDir = CompileCommon.outputroot + P + "som" + P;
+ public static String casesRootDir = XBEAN_CASE_ROOT+ P + "compile" + P + "som" + P;
+ public static String somOutputRootDir = OUTPUTROOT+ P + "som" + P;
public static long runid;
public static PrintWriter outlog = null;
@@ -244,7 +243,7 @@
out.println("\t+++-> Each derived prop name : " + schemaProperty.getName());
}
- // TODO anonymus types
+ // TODO anonymus types
//schema.getAnonymousTypes();
}
Modified: xmlbeans/trunk/test/src/drt/drtcases/TestEnv.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/drt/drtcases/TestEnv.java?view=diff&r1=159456&r2=159457
==============================================================================
--- xmlbeans/trunk/test/src/drt/drtcases/TestEnv.java (original)
+++ xmlbeans/trunk/test/src/drt/drtcases/TestEnv.java Tue Mar 29 17:08:52 2005
@@ -18,13 +18,19 @@
import java.io.File;
import java.io.IOException;
-public class TestEnv
+public class TestEnv extends common.Common
{
- private static File fwroot = getRootFile();
- private static File caseroot = new File(fwroot, "test/cases/xbean");
- private static File outputroot = new File(fwroot, "build/test/output");
+ private static File fwroot = new File(FWROOT);
+ private static File caseroot = new File(XBEAN_CASE_ROOT);
+ private static File outputroot = new File(OUTPUTROOT);
- public static File getRootFile() throws IllegalStateException
+ public TestEnv(){
+ super("Test Env");
+ }
+ public TestEnv(String name){
+ super(name);
+ }
+ /*public static File getRootFile() throws IllegalStateException
{
try
{
@@ -62,5 +68,5 @@
if (!dir.delete())
throw new IllegalStateException("Could not delete " + dir);
}
- }
+ } */
}
Modified: xmlbeans/trunk/test/src/misc/common/JiraTestBase.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/misc/common/JiraTestBase.java?view=diff&r1=159456&r2=159457
==============================================================================
--- xmlbeans/trunk/test/src/misc/common/JiraTestBase.java (original)
+++ xmlbeans/trunk/test/src/misc/common/JiraTestBase.java Tue Mar 29 17:08:52 2005
@@ -3,232 +3,29 @@
*/
package misc.common;
-import junit.framework.TestCase;
-import junit.framework.Assert;
-
import java.io.File;
-import java.io.IOException;
-import java.util.*;
-
-import org.apache.xmlbeans.*;
-
-import javax.xml.namespace.QName;
+import common.Common;
/**
*
*/
-public class JiraTestBase extends TestCase
+public class JiraTestBase extends Common
{
- public static final String P = File.separator;
-
- public static String fwroot = getRootFile();
- public static String caseroot = fwroot + P + "test" + P + "cases";
//location of files under "cases folder"
- public static String JIRA_CASES = caseroot + P + "xbean" + P + "misc" +
- P +
- "jira" +
- P;
- public static File outputroot = new File(fwroot,
- "build" + P + "test" + P +
- "jiraoutput");
-
+ public static String JIRA_CASES = XBEAN_CASE_ROOT + P + "xbean" + P + "misc" +
+ P + "jira" + P;
+ public static File outputroot = new File(OUTPUTROOT+P+"jiraoutput");
- public static String scompTestFilesRoot = fwroot + P + "test" + P + "cases" + P + "xbean" + P + "misc" + P + "jira" + P;
- public static String schemaCompOutputDirPath = fwroot + P + "build" + P + "test" + P + "output" + P + "jira" + P;
+ public static String scompTestFilesRoot = XBEAN_CASE_ROOT + P + "misc" + P + "jira" + P;
+ public static String schemaCompOutputDirPath = OUTPUTROOT+ P + "jira" + P;
public static File schemaCompOutputDirFile = null;
public static File schemaCompSrcDir = null;
public static File schemaCompClassesDir = null;
public static final int THREAD_COUNT = 150;
public static final int ITERATION_COUNT = 2;
- public LinkedList errorList;
- public XmlOptions xmOpts;
public JiraTestBase(String name){
super(name);
- errorList = new LinkedList();
- xmOpts = new XmlOptions();
- xmOpts.setErrorListener(errorList);
- }
-
- /**
- * If System.property for 'xbean.rootdir' == null use '.' as basePath '.'
- * should be where the build.xml file lives
- *
- * @return
- * @throws IllegalStateException
- */
- public static String getRootFile() throws IllegalStateException
- {
- String baseDir = System.getProperty("xbean.rootdir");
- if (baseDir == null) {
- return new File(".").getAbsolutePath();
- } else {
- return new File(baseDir).getAbsolutePath();
- }
- }
-
- public static File xbeanCase(String str)
- {
- return (new File(caseroot + JIRA_CASES, str));
- }
-
- public static void deltree(File dir)
- {
- if (dir.exists()) {
- if (dir.isDirectory()) {
- String[] list = dir.list();
- for (int i = 0; i < list.length; i++) {
- deltree(new File(dir, list[i]));
- }
- }
- if (!dir.delete()) {
- System.out.println("Could not delete " + dir);
- }
- //throw new IllegalStateException("Could not delete " + dir);
- }
- }
-
- /*
- * Helper Methods
- *
- */
- public static XmlObject compileXsdString(String XsdAsString) {
- XmlObject xobj = null;
- try {
- xobj = XmlObject.Factory.parse(XsdAsString);
- } catch (XmlException xme) {
- if (!xme.getErrors().isEmpty()) {
- for (Iterator itr = xme.getErrors().iterator(); itr.hasNext();) {
- System.out.println("Parse Errors :" + itr.next());
- }
- }
- } finally {
- Assert.assertNotNull(xobj);
- return xobj;
- }
- }
-
- public static XmlObject compileXsdFile(String XsdFilePath) {
- XmlObject xobj = null;
- try {
- xobj = XmlObject.Factory.parse(new File(XsdFilePath));
- } catch (XmlException xme) {
- if (!xme.getErrors().isEmpty()) {
- for (Iterator itr = xme.getErrors().iterator(); itr.hasNext();) {
- System.out.println("Parse Errors :" + itr.next());
- }
- }
- } catch (IOException ioe) {
- ioe.printStackTrace();
- ioe.getMessage();
- } finally {
- Assert.assertNotNull(xobj);
- return xobj;
- }
}
-
-
- public boolean printOptionErrMsgs(Collection errors) {
- // check list of errors/warnings/msgs and print them. Return true if errors found
- boolean errFound = false;
- if (!errors.isEmpty()) {
- for (Iterator i = errors.iterator(); i.hasNext();) {
- XmlError eacherr = (XmlError) i.next();
- int errSeverity = eacherr.getSeverity();
- if (errSeverity == XmlError.SEVERITY_ERROR) {
- System.out.println("Err Msg (s) at line #" + eacherr.getLine() + ": " + eacherr.getMessage());
- errFound = true;
- } else if (errSeverity == XmlError.SEVERITY_WARNING) {
- System.out.println("Warning Msg (s) at line #" + eacherr.getLine() + ": " + eacherr.getMessage());
- } else if (errSeverity == XmlError.SEVERITY_INFO) {
- System.out.println("Info Msg (s) at line #" + eacherr.getLine() + ": " + eacherr.getMessage());
- }
- }
- errors.clear();
- }
- return errFound;
- }
-
- public void validateInstance(String[] schemas, String[] instances, QName docType) throws Exception {
- SchemaTypeLoader stl = makeSchemaTypeLoader(schemas);
- XmlOptions options = new XmlOptions();
-
- if (docType != null) {
- SchemaType docSchema = stl.findDocumentType(docType);
- Assert.assertTrue(docSchema != null);
- options.put(XmlOptions.DOCUMENT_TYPE, docSchema);
- }
-
- for (int i = 0; i < instances.length; i++) {
- XmlObject x =
- stl.parse((String) instances[i], null, options);
-
- //if (!startOnDocument) {
- // XmlCursor c = x.newCursor();
- // c.toFirstChild();
- // x = c.getObject();
- // c.dispose();
- //}
-
- List xel = new ArrayList();
-
- options.put(XmlOptions.ERROR_LISTENER, xel);
-
- boolean isValid = x.validate(options);
-
- if (!isValid) {
- StringBuffer errorTxt = new StringBuffer("Invalid doc, expected a valid doc: ");
- errorTxt.append("Instance(" + i + "): ");
- errorTxt.append(x.xmlText());
- errorTxt.append("Errors: ");
- for (int j = 0; j < xel.size(); j++)
- errorTxt.append(xel.get(j) + "\n");
- System.err.println(errorTxt.toString());
- throw new Exception("Instance not valid\n" + errorTxt.toString());
- }
- }
- }
-
- public SchemaTypeLoader makeSchemaTypeLoader(String[] schemas)
- throws Exception {
- XmlObject[] schemaDocs = new XmlObject[schemas.length];
-
- for (int i = 0; i < schemas.length; i++) {
- schemaDocs[i] =
- XmlObject.Factory.parse(schemas[i]);
- }
-
- return XmlBeans.loadXsd(schemaDocs);
- }
-
- public static abstract class TestThread extends Thread
- {
- protected Throwable _throwable;
- protected boolean _result;
- protected XmlOptions xm;
- protected ArrayList errors;
-
- public TestThread()
- {
- xm = new XmlOptions();
- ArrayList errors = new ArrayList();
- xm.setErrorListener(errors);
- xm.setValidateOnSet();
- }
-
- public Throwable getException()
- {
- return _throwable;
- }
-
- public boolean getResult()
- {
- return _result;
- }
-
-
- }
-
-
}
Modified: xmlbeans/trunk/test/src/misc/detailed/JiraRegression50_100Test.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/misc/detailed/JiraRegression50_100Test.java?view=diff&r1=159456&r2=159457
==============================================================================
--- xmlbeans/trunk/test/src/misc/detailed/JiraRegression50_100Test.java (original)
+++ xmlbeans/trunk/test/src/misc/detailed/JiraRegression50_100Test.java Tue Mar 29 17:08:52 2005
@@ -159,8 +159,7 @@
public void test_jira_XmlBeans57() throws Exception
{
String P = File.separator;
- String outputDir = fwroot + P + "build" +
- P + "test" + P + "output" + P + "dav";
+ String outputDir = OUTPUTROOT + P + "dav";
File srcDir = new File(outputDir + P + "src");
srcDir.mkdirs();
Modified: xmlbeans/trunk/test/src/tools/inst2xsd/common/Inst2XsdCommon.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/tools/inst2xsd/common/Inst2XsdCommon.java?view=diff&r1=159456&r2=159457
==============================================================================
--- xmlbeans/trunk/test/src/tools/inst2xsd/common/Inst2XsdCommon.java (original)
+++ xmlbeans/trunk/test/src/tools/inst2xsd/common/Inst2XsdCommon.java Tue Mar 29 17:08:52 2005
@@ -16,11 +16,6 @@
import org.apache.xmlbeans.*;
import org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions;
-import org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument;
-
-import java.util.Collection;
-import java.util.ArrayList;
-import java.util.Iterator;
public class Inst2XsdCommon {
Modified: xmlbeans/trunk/test/src/tools/inst2xsd/common/Inst2XsdTestBase.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/tools/inst2xsd/common/Inst2XsdTestBase.java?view=diff&r1=159456&r2=159457
==============================================================================
--- xmlbeans/trunk/test/src/tools/inst2xsd/common/Inst2XsdTestBase.java (original)
+++ xmlbeans/trunk/test/src/tools/inst2xsd/common/Inst2XsdTestBase.java Tue Mar 29 17:08:52 2005
@@ -19,24 +19,20 @@
import org.apache.xmlbeans.impl.inst2xsd.Inst2XsdOptions;
import org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument;
-import java.io.File;
-import java.io.IOException;
-import java.util.Arrays;
import java.util.Collection;
import java.util.ArrayList;
import java.util.Iterator;
-import junit.framework.TestCase;
import tools.xml.XmlComparator;
+import common.Common;
-public class Inst2XsdTestBase extends TestCase {
+public class Inst2XsdTestBase extends Common {
- public static final String P = File.separator;
public static tools.inst2xsd.common.Inst2XsdCommon common;
public static boolean _verbose = true;
- public static final String fwroot = System.getProperty("cases.location");
- public static String caseroot = fwroot+P+"xbean";// + P + "test" + P + "cases" + P + "xbean";
+ public static final String fwroot = FWROOT;
+ public static String caseroot = XBEAN_CASE_ROOT;
//location of files under "cases folder"
public static String miscDir = caseroot + P + "tools";
public static String inst2xsdDir = miscDir + P + "inst2xsd" + P;
@@ -138,25 +134,25 @@
public void runAttrTypeChecking(XmlObject act, String expType) throws Exception {
log("=== Venetian options ===");
- runAttrTypeChecking(act, expType, common.getVenetianOptions());
+ runAttrTypeChecking(act, expType, Inst2XsdCommon.getVenetianOptions());
log("=== Russian options ===");
- runAttrTypeChecking(act, expType, common.getRussianOptions());
+ runAttrTypeChecking(act, expType, Inst2XsdCommon.getRussianOptions());
log("=== Salami options ===");
- runAttrTypeChecking(act, expType, common.getSalamiOptions());
+ runAttrTypeChecking(act, expType, Inst2XsdCommon.getSalamiOptions());
log("=== Default options ===");
- runAttrTypeChecking(act, expType, common.getDefaultInstOptions());
+ runAttrTypeChecking(act, expType, Inst2XsdCommon.getDefaultInstOptions());
}
public void runAttrTypeChecking(XmlObject act, String primType, String derType) throws Exception {
log("=== Venetian options ===");
- runAttrTypeChecking(act, primType, derType, common.getVenetianOptions());
+ runAttrTypeChecking(act, primType, derType, Inst2XsdCommon.getVenetianOptions());
log("=== Russian options ===");
- runAttrTypeChecking(act, primType, derType, common.getRussianOptions());
+ runAttrTypeChecking(act, primType, derType, Inst2XsdCommon.getRussianOptions());
log("=== Salami options ===");
- runAttrTypeChecking(act, primType, derType, common.getSalamiOptions());
+ runAttrTypeChecking(act, primType, derType, Inst2XsdCommon.getSalamiOptions());
log("=== Default options ===");
- runAttrTypeChecking(act, primType, derType, common.getDefaultInstOptions());
+ runAttrTypeChecking(act, primType, derType, Inst2XsdCommon.getDefaultInstOptions());
}
private void runAttrTypeChecking(XmlObject act, String primType, String derType, Inst2XsdOptions opt) throws Exception {
@@ -194,13 +190,13 @@
//element value test methods
public void runTypeChecking(XmlObject act, String expType) throws Exception {
log("=== Venetian options ===");
- runTypeChecking(act, expType, common.getVenetianOptions());
+ runTypeChecking(act, expType, Inst2XsdCommon.getVenetianOptions());
log("=== Russian options ===");
- runTypeChecking(act, expType, common.getRussianOptions());
+ runTypeChecking(act, expType, Inst2XsdCommon.getRussianOptions());
log("=== Salami options ===");
- runTypeChecking(act, expType, common.getSalamiOptions());
+ runTypeChecking(act, expType, Inst2XsdCommon.getSalamiOptions());
log("=== Default options ===");
- runTypeChecking(act, expType, common.getDefaultInstOptions());
+ runTypeChecking(act, expType, Inst2XsdCommon.getDefaultInstOptions());
}
@@ -225,13 +221,13 @@
//type coercion/LCD test methods
public void runLCDTypeCheckTest(String val1, String val2, String expType) throws Exception {
log("=== Venetian options ===");
- runLCDTypeChecking(val1, val2, expType, common.getVenetianOptions());
+ runLCDTypeChecking(val1, val2, expType, Inst2XsdCommon.getVenetianOptions());
log("=== Russian options ===");
- runLCDTypeChecking(val1, val2, expType, common.getRussianOptions());
+ runLCDTypeChecking(val1, val2, expType, Inst2XsdCommon.getRussianOptions());
log("=== Salami options ===");
- runLCDTypeChecking(val1, val2, expType, common.getSalamiOptions());
+ runLCDTypeChecking(val1, val2, expType, Inst2XsdCommon.getSalamiOptions());
log("=== Default options ===");
- runLCDTypeChecking(val1, val2, expType, common.getDefaultInstOptions());
+ runLCDTypeChecking(val1, val2, expType, Inst2XsdCommon.getDefaultInstOptions());
}
private void runLCDTypeChecking(String val1, String val2, String expType, Inst2XsdOptions opt) throws Exception {
@@ -242,11 +238,11 @@
log("expType: " + expType);
checkInstance(venetian, new XmlObject[]{act});
- if (opt.getDesign() == opt.DESIGN_VENETIAN_BLIND)
+ if (opt.getDesign() == Inst2XsdOptions.DESIGN_VENETIAN_BLIND)
compare(venetian[0], getExpLCDXml_vb(expType));
- else if (opt.getDesign() == opt.DESIGN_SALAMI_SLICE)
+ else if (opt.getDesign() == Inst2XsdOptions.DESIGN_SALAMI_SLICE)
compare(venetian[0], getExpLCDXml_ss(expType));
- else if (opt.getDesign() == opt.DESIGN_RUSSIAN_DOLL)
+ else if (opt.getDesign() == Inst2XsdOptions.DESIGN_RUSSIAN_DOLL)
compare(venetian[0], getExpLCDXml_rd(expType));
else
compare(venetian[0], getExpLCDXml_vb(expType));
@@ -325,16 +321,16 @@
public static XmlObject[] runInst2Xsd(String inst) throws XmlException {
- return runInst2Xsd(new XmlObject[]{XmlObject.Factory.parse(inst, common.getXmlOptions())},
- common.getDefaultInstOptions());
+ return runInst2Xsd(new XmlObject[]{XmlObject.Factory.parse(inst, Inst2XsdCommon.getXmlOptions())},
+ Inst2XsdCommon.getDefaultInstOptions());
}
public static XmlObject[] runInst2Xsd(XmlObject inst) {
- return Inst2Xsd.inst2xsd(new XmlObject[]{inst}, common.getDefaultInstOptions());
+ return Inst2Xsd.inst2xsd(new XmlObject[]{inst}, Inst2XsdCommon.getDefaultInstOptions());
}
public static XmlObject[] runInst2Xsd(XmlObject[] inst) {
- return Inst2Xsd.inst2xsd(inst, common.getDefaultInstOptions());
+ return Inst2Xsd.inst2xsd(inst, Inst2XsdCommon.getDefaultInstOptions());
}
public static XmlObject[] runInst2Xsd(XmlObject inst, Inst2XsdOptions options) {
@@ -414,11 +410,11 @@
public static void compare(XmlObject act, XmlObject exp)
throws XmlException, Exception {
- XmlComparator.Diagnostic diag = XmlComparator.lenientlyCompareTwoXmlStrings(act.xmlText(common.getXmlOptions()),
- exp.xmlText(common.getXmlOptions()));
+ XmlComparator.Diagnostic diag = XmlComparator.lenientlyCompareTwoXmlStrings(act.xmlText(Inst2XsdCommon.getXmlOptions()),
+ exp.xmlText(Inst2XsdCommon.getXmlOptions()));
if (diag.hasMessage()) {
- log("Expected: \n" + exp.xmlText(common.getXmlOptions()));
- log("Actual: \n" + act.xmlText(common.getXmlOptions()));
+ log("Expected: \n" + exp.xmlText(Inst2XsdCommon.getXmlOptions()));
+ log("Actual: \n" + act.xmlText(Inst2XsdCommon.getXmlOptions()));
throw new Exception("Xml Comparison Failed:\n" + diag.toString());
}
}
@@ -426,7 +422,7 @@
public static void log(XmlObject[] doc) {
if (_verbose) {
for (int i = 0; i < doc.length; i++) {
- log("Schema[" + i + "] - " + doc[i].xmlText(common.getXmlOptions()));
+ log("Schema[" + i + "] - " + doc[i].xmlText(Inst2XsdCommon.getXmlOptions()));
}
}
}
@@ -438,7 +434,7 @@
public static void log(XmlObject obj) {
if (_verbose)
- System.out.println(obj.xmlText(common.getXmlOptions()));
+ System.out.println(obj.xmlText(Inst2XsdCommon.getXmlOptions()));
}
Modified: xmlbeans/trunk/test/tools/src/tools/JUnit/TestReportMergeUtility.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/tools/src/tools/JUnit/TestReportMergeUtility.java?view=diff&r1=159456&r2=159457
==============================================================================
--- xmlbeans/trunk/test/tools/src/tools/JUnit/TestReportMergeUtility.java (original)
+++ xmlbeans/trunk/test/tools/src/tools/JUnit/TestReportMergeUtility.java Tue Mar 29 17:08:52 2005
@@ -98,7 +98,7 @@
// runid
String dateFormatStr = "_yy_MMM_dd_HH_mm_ss_SS";
- String dateStr = new SimpleDateFormat(dateFormatStr).format(new Date());
+ String dateStr = new SimpleDateFormat(dateFormatStr).format(new java.util.Date());
String defRunId = System.getProperty("user.name").toUpperCase() + dateStr;
String runId = System.getProperty("RUNID", defRunId);
log.setRunid(runId);
Modified: xmlbeans/trunk/test/tools/src/tools/JUnit/XmlResultFormatter.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/tools/src/tools/JUnit/XmlResultFormatter.java?view=diff&r1=159456&r2=159457
==============================================================================
--- xmlbeans/trunk/test/tools/src/tools/JUnit/XmlResultFormatter.java (original)
+++ xmlbeans/trunk/test/tools/src/tools/JUnit/XmlResultFormatter.java Tue Mar 29 17:08:52 2005
@@ -177,7 +177,7 @@
testUnit = fullTestName;
String testMethod = ((TestCase) test).getName();
// Get the last token from testUnit for the logical name
- startindex = testUnit.lastIndexOf(".");
+ startindex = testUnit.lastIndexOf(".");
String baseClass = testUnit.substring(startindex+1);
// update the extra fields of TestRecord
@@ -286,7 +286,7 @@
// Set the logical test name... 'Class.Methodname'
tr.setLogicalname(rec.getTestLogicalName());
// Set the test Start time as a String
- tr.setExectime(new Date(rec.getStartTime()).toString());
+ tr.setExectime(new java.util.Date(rec.getStartTime()).toString());
String status = rec.getStatusString();
// Set the test result
if (status.equals("SUCCESS"))
Modified: xmlbeans/trunk/test/tools/src/tools/JUnit/XmlResultFormatterImpl.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/tools/src/tools/JUnit/XmlResultFormatterImpl.java?view=diff&r1=159456&r2=159457
==============================================================================
--- xmlbeans/trunk/test/tools/src/tools/JUnit/XmlResultFormatterImpl.java (original)
+++ xmlbeans/trunk/test/tools/src/tools/JUnit/XmlResultFormatterImpl.java Tue Mar 29 17:08:52 2005
@@ -402,7 +402,7 @@
// runid
String dateFormatStr = "_yy_MMM_dd_HH_mm_ss_SS";
- String dateStr = new SimpleDateFormat(dateFormatStr).format(new Date(startTime));
+ String dateStr = new SimpleDateFormat(dateFormatStr).format(new java.util.Date(startTime));
String defRunId = System.getProperty("user.name").toUpperCase() + dateStr;
String runId = System.getProperty("RUNID", defRunId);
log.setRunid(runId);
@@ -449,7 +449,7 @@
TestLogDocument.TestLog.HeaderInfo hdrInfo = log.addNewHeaderInfo();
hdrInfo.setResultcount(Integer.toString(testCount));
hdrInfo.setChecksum(Integer.toString(testCount));
- hdrInfo.setExecdate(new Date(startTime).toString());
+ hdrInfo.setExecdate(new java.util.Date(startTime).toString());
hdrInfo.setExecaccount(System.getProperty("user.name"));
// Add test-results
@@ -489,7 +489,7 @@
tr.setLogicalname(rec.getTestLogicalName());
// Set the test Start time as a String
- tr.setExectime(new Date(rec.getStartTime()).toString());
+ tr.setExectime(new java.util.Date(rec.getStartTime()).toString());
String status = rec.getStatusString();
@@ -502,7 +502,7 @@
tr.setResult(TestResultType.Result.ABORT);
// Set the test execution time.. in milliseconds
- String dur = Long.toString(rec.getEndTime() - rec.getStartTime());
+ String dur = java.lang.Long.toString(rec.getEndTime() - rec.getStartTime());
tr.setDuration(dur);
// Set the completion status..
Modified: xmlbeans/trunk/testbuild.xml
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/testbuild.xml?view=diff&r1=159456&r2=159457
==============================================================================
--- xmlbeans/trunk/testbuild.xml (original)
+++ xmlbeans/trunk/testbuild.xml Tue Mar 29 17:08:52 2005
@@ -186,6 +186,8 @@
<!--needed for xquery-->
<include name="**/*.xq"/>
<include name="**/*.xsddonotcompile"/>
+ <include name="**/*.xsd_"/>
+ <include name="**/*.jar"/>
<include name="**/*.txt"/>
<include name="**/*.xml"/>
<include name="**/*.xsdconfig"/>
@@ -501,7 +503,7 @@
<antcall target="build.schemas"/>
<antcall target="build.tests"/>
-
+
</else>
</if>
<antcall target="build.xqcases"/>
@@ -531,7 +533,7 @@
basedir="${build.dir.test.tools}" update="false"
excludes="**/*.java"/>
</target>
-
+
<target name="check.testreport">
<condition property="check.testreport.exists">
<available file="${build.dir.test.lib}/TestReport.xsd.jar"/>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org