xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ce...@apache.org
Subject svn commit: r232349 - in /xmlbeans/trunk: src/store/org/apache/xmlbeans/impl/store/ src/typeimpl/org/apache/xmlbeans/impl/validator/ test/perf/ test/perf/bin/ test/perf/src/org/apache/xmlbeans/test/performance/jaxb/ test/src/xmlcursor/xpath/complex/che...
Date Fri, 12 Aug 2005 18:25:47 GMT
Author: cezar
Date: Fri Aug 12 11:25:28 2005
New Revision: 232349

URL: http://svn.apache.org/viewcvs?rev=232349&view=rev
Log:
Code cleaning around the invocation code to xpath/xquery engines, plus adding back support
for old engine.

checkintests: pass


Modified:
    xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Path.java
    xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Query.java
    xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/SaxonXBeansDelegate.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java
    xmlbeans/trunk/test/perf/bin/run_all.bat
    xmlbeans/trunk/test/perf/build.xml
    xmlbeans/trunk/test/perf/src/org/apache/xmlbeans/test/performance/jaxb/NPrimTopDownJaxb.java
    xmlbeans/trunk/test/perf/src/org/apache/xmlbeans/test/performance/jaxb/POTopDownJaxb.java
    xmlbeans/trunk/test/perf/src/org/apache/xmlbeans/test/performance/jaxb/POTopDownSaveJaxb.java
    xmlbeans/trunk/test/perf/src/org/apache/xmlbeans/test/performance/jaxb/PrimTopDownJaxb.java
    xmlbeans/trunk/test/src/xmlcursor/xpath/complex/checkin/JaxenXPathTests.java

Modified: xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Path.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Path.java?rev=232349&r1=232348&r2=232349&view=diff
==============================================================================
--- xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Path.java (original)
+++ xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Path.java Fri Aug 12 11:25:28
2005
@@ -33,13 +33,20 @@
 
 public abstract class Path
 {
+    public static String _useXqrlForXpath = "use xqrl for xpath";
+    public static String _useXbeanForXpath = "use xbean for xpath";
+    public static String _useXqrl2002ForXpath = "use xqrl-2002 for xpath";
+
+    private static final int USE_XBEAN    = 0x01;
+    private static final int USE_XQRL     = 0x02;
+    private static final int USE_SAXON    = 0x04;
+    private static final int USE_XQRL2002 = 0x08;
+
     Path(String key)
     {
         _pathKey = key;
     }
 
-    public static String _useXqrlForXpath = "use xqrl for xpath";
-    public static String _useXbeanForXpath = "use xbean for xpath";
 
     interface PathEngine
     {
@@ -71,10 +78,6 @@
         return currentNodeVar;
     }
 
-    private static final int USE_XQRL = 0x02;
-    private static final int USE_XBEAN =0x01;
-    private static final int USE_SAXON =0x04;
-
     public static Path getCompiledPath(String pathExpr, XmlOptions options)
     {
         options = XmlOptions.maskNull(options);
@@ -84,7 +87,9 @@
                 ? USE_XQRL
                 : options.hasOption(_useXbeanForXpath)
                 ? USE_XBEAN
-                : USE_XBEAN|USE_XQRL|USE_SAXON; //set all bits
+                : options.hasOption(_useXqrl2002ForXpath)
+                ? USE_XQRL2002
+                : USE_XBEAN|USE_XQRL|USE_SAXON; //set all bits except XQRL2002
 
         return getCompiledPath(pathExpr, force, getCurrentNodeVar(options));
     }
@@ -97,40 +102,56 @@
 
         if ((force & USE_XBEAN) != 0)
             path = (Path) _xbeanPathCache.get(pathExpr);
-        if (path == null && (force & USE_XBEAN) != 0)
+        if (path == null && (force & USE_XQRL) != 0)
             path = (Path) _xqrlPathCache.get(pathExpr);
+        if (path == null && (force & USE_XQRL2002) != 0)
+            path = (Path) _xqrl2002PathCache.get(pathExpr);
 
         if (path != null)
             return path;
 
         if ((force & USE_XBEAN) != 0)
             path = getCompiledPathXbean(pathExpr, currentVar, namespaces);
-        if (path == null && (force & USE_XQRL) != 0 &&
-            !SaxonXBeansDelegate.bInstantiated)
+        if (path == null && (force & USE_XQRL) != 0)
             path = getCompiledPathXqrl(pathExpr, currentVar);
         if (path == null && (force & USE_SAXON) != 0)
-            path = getCompiledPathSaxon(pathExpr, currentVar,
-                namespaces);
+            path = getCompiledPathSaxon(pathExpr, currentVar, namespaces);
+        if (path == null && (force & USE_XQRL2002) != 0)
+            path = getCompiledPathXqrl2002(pathExpr, currentVar);
+
         if (path == null)
         {
             StringBuffer errMessage = new StringBuffer();
             if ((force & USE_XBEAN) != 0)
                 errMessage.append(" Trying XBeans path engine...");
-            if ((force & USE_XQRL) != 0 && !SaxonXBeansDelegate.bInstantiated)
+            if ((force & USE_XQRL) != 0)
                 errMessage.append(" Trying XQRL...");
             if ((force & USE_SAXON) != 0)
                 errMessage.append(" Trying Saxon...");
-            throw new RuntimeException(errMessage.toString()+" FAILED on "+pathExpr);
+            if ((force & USE_XQRL2002) != 0)
+                errMessage.append(" Trying XQRL2002...");
+
+            throw new RuntimeException(errMessage.toString() + " FAILED on " + pathExpr);
         }
+
         return path;
     }
 
-    static private synchronized Path getCompiledPathXqrl(String pathExpr,
-        String currentVar)
+    static private synchronized Path getCompiledPathXqrl(String pathExpr, String currentVar)
     {
         Path path = createXqrlCompiledPath(pathExpr, currentVar);
         if (path != null)
             _xqrlPathCache.put(path._pathKey, path);
+
+        return path;
+    }
+
+    static private synchronized Path getCompiledPathXqrl2002(String pathExpr, String currentVar)
+    {
+        Path path = createXqrl2002CompiledPath(pathExpr, currentVar);
+        if (path != null)
+            _xqrl2002PathCache.put(path._pathKey, path);
+
         return path;
     }
 
@@ -140,18 +161,25 @@
         Path path = XbeanPath.create(pathExpr, currentVar, namespaces);
         if (path != null)
             _xbeanPathCache.put(path._pathKey, path);
+
         return path;
     }
 
     static private synchronized Path getCompiledPathSaxon(String pathExpr, String currentVar,
Map namespaces)
     {
         Path path = null;
-        if ( namespaces == null )  namespaces = new HashMap();
-        try{
+        if ( namespaces == null )
+            namespaces = new HashMap();
+
+        try
+        {
             XPath.compileXPath(pathExpr, currentVar, namespaces);
-        }catch (XPath.XPathCompileException e){
+        }
+        catch (XPath.XPathCompileException e)
+        {
             //do nothing, this function is only called to populate the namespaces map
         }
+
         int offset =
             namespaces.get(XPath._NS_BOUNDARY) == null ?
             0 :
@@ -160,6 +188,7 @@
         path = SaxonPathImpl.create(pathExpr.substring(offset),
             currentVar,
             namespaces);
+
         return path;
     }
 
@@ -218,18 +247,27 @@
 
     private static Path createXqrlCompiledPath(String pathExpr, String currentVar)
     {
-        if (_xqrlCompilePath == null) {
-            try {
+        if (!_xqrlAvailable)
+            return null;
+
+        if (_xqrlCompilePath == null)
+        {
+            try
+            {
                 Class xqrlImpl = Class.forName("org.apache.xmlbeans.impl.store.XqrlImpl");
 
                 _xqrlCompilePath =
                         xqrlImpl.getDeclaredMethod("compilePath",
                                 new Class[]{String.class, String.class, Boolean.class});
             }
-            catch (ClassNotFoundException e) {
+            catch (ClassNotFoundException e)
+            {
+                _xqrlAvailable = false;
                 return null;
             }
-            catch (Exception e) {
+            catch (Exception e)
+            {
+                _xqrlAvailable = false;
                 throw new RuntimeException(e.getMessage(), e);
             }
         }
@@ -248,6 +286,50 @@
         }
     }
 
+    private static Path createXqrl2002CompiledPath(String pathExpr, String currentVar)
+    {
+        if (!_xqrl2002Available)
+            return null;
+
+        if (_xqrl2002CompilePath == null)
+        {
+            try
+            {
+                Class xqrlImpl = Class.forName("org.apache.xmlbeans.impl.store.Xqrl2002Impl");
+
+                _xqrl2002CompilePath =
+                    xqrlImpl.getDeclaredMethod("compilePath",
+                        new Class[]{String.class, String.class, Boolean.class});
+            }
+            catch (ClassNotFoundException e)
+            {
+                _xqrl2002Available = false;
+                return null;
+            }
+            catch (Exception e)
+            {
+                _xqrl2002Available = false;
+                throw new RuntimeException(e.getMessage(), e);
+            }
+        }
+
+        Object[] args = new Object[]{pathExpr, currentVar, new Boolean(true)};
+
+        try
+        {
+            return (Path) _xqrl2002CompilePath.invoke(null, args);
+        }
+        catch (InvocationTargetException e)
+        {
+            Throwable t = e.getCause();
+            throw new RuntimeException(t.getMessage(), t);
+        }
+        catch (IllegalAccessException e)
+        {
+            throw new RuntimeException(e.getMessage(), e);
+        }
+    }
+
     private static final class XbeanPathEngine extends ExecutionContext implements PathEngine
     {
         XbeanPathEngine(XPath xpath, Cur c)
@@ -493,6 +575,11 @@
 
     private static Map _xbeanPathCache = new HashMap();
     private static Map _xqrlPathCache = new HashMap();
+    private static Map _xqrl2002PathCache = new HashMap();
 
     private static Method _xqrlCompilePath;
+    private static Method _xqrl2002CompilePath;
+
+    private static boolean _xqrlAvailable = true;
+    private static boolean _xqrl2002Available = true;
 }

Modified: xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Query.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Query.java?rev=232349&r1=232348&r2=232349&view=diff
==============================================================================
--- xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Query.java (original)
+++ xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Query.java Fri Aug 12 11:25:28
2005
@@ -17,6 +17,7 @@
 
 import org.apache.xmlbeans.*;
 import org.apache.xmlbeans.impl.common.XPath;
+import org.apache.xmlbeans.impl.store.*;
 import org.w3c.dom.*;
 
 import javax.xml.namespace.QName;
@@ -50,54 +51,76 @@
 
     public static synchronized Query getCompiledQuery(String queryExpr, XmlOptions options)
     {
-        return getCompiledQuery(queryExpr, Path.getCurrentNodeVar(options));
+        return getCompiledQuery(queryExpr, Path.getCurrentNodeVar(options), options);
     }
 
-    static synchronized Query getCompiledQuery(String queryExpr, String currentVar)
+    static synchronized Query getCompiledQuery(String queryExpr, String currentVar, XmlOptions
options)
     {
         assert queryExpr != null;
 
+        if (options.hasOption(Path._useXqrl2002ForXpath))
+        {
+            Query res = (Query)_xqrl2002QueryCache.get(queryExpr);
+            if (res!=null)
+                return res;
+
+            res = getXqrl2002CompiledQuery(queryExpr, currentVar);
+            if (res!=null)
+            {
+                _xqrl2002QueryCache.put(queryExpr, res);
+                return res;
+            }
+            throw new RuntimeException("No 2002 query engine found.");
+        }
+
         //Parse the query via XBeans: need to figure out end of prolog
         //in order to bind $this...not good but...
         Map boundary = new HashMap();
         int boundaryVal = 0;
-        try {
+        try
+        {
             XPath.compileXPath(queryExpr, currentVar, boundary);
         }
-        catch (XPath.XPathCompileException e) {
+        catch (XPath.XPathCompileException e)
+        {
             //don't care if it fails, just care about boundary
         }
-        finally {
-            boundaryVal = boundary.get(XPath._NS_BOUNDARY) == null ?
-                    0 :
-                    ((Integer) boundary.get(XPath._NS_BOUNDARY)).intValue();
-
+        finally
+        {
+            boundaryVal = boundary.get(XPath._NS_BOUNDARY) == null ? 0 :
+                ((Integer) boundary.get(XPath._NS_BOUNDARY)).intValue();
         }
 
         //try XQRL
         Query query = (Query) _xqrlQueryCache.get(queryExpr);
         if (query != null)
             return query;
-        else {
-            query = createXqrlCompiledQuery(queryExpr, currentVar);
-            if (query != null)
-                _xqrlQueryCache.put(queryExpr, query);
-            else {
-                //query is still null; look for Saxon
-                query = (Query) _saxonQueryCache.get(queryExpr);
-                if (query != null)
-                    return query;
-                else
-                    query = SaxonQueryImpl.createSaxonCompiledQuery(queryExpr, currentVar,
boundaryVal);
-                if (query != null)
-                    _saxonQueryCache.put(queryExpr, query);
-            }
+
+        query = createXqrlCompiledQuery(queryExpr, currentVar);
+        if (query != null)
+        {
+            _xqrlQueryCache.put(queryExpr, query);
+            return query;
         }
-            if (query == null)
-                throw new RuntimeException("No query engine found");
+
+
+        //query is still null; look for Saxon
+        query = (Query) _saxonQueryCache.get(queryExpr);
+
+        if (query != null)
+            return query;
+
+        query = SaxonQueryImpl.createSaxonCompiledQuery(queryExpr, currentVar, boundaryVal);
+
+        if (query != null)
+        {
+            _saxonQueryCache.put(queryExpr, query);
             return query;
         }
 
+        throw new RuntimeException("No query engine found");
+    }
+
     public static synchronized String compileQuery(String queryExpr, XmlOptions options)
     {
         getCompiledQuery(queryExpr, options);
@@ -106,36 +129,85 @@
 
     private static Query createXqrlCompiledQuery(String queryExpr, String currentVar)
     {
-        if (_xqrlCompileQuery == null) {
-            try {
+        if (_xqrlAvailable && _xqrlCompileQuery == null)
+        {
+            try
+            {
                 Class xqrlImpl = Class.forName("org.apache.xmlbeans.impl.store.XqrlImpl");
 
                 _xqrlCompileQuery =
                         xqrlImpl.getDeclaredMethod("compileQuery",
                                 new Class[]{String.class, String.class, Boolean.class});
             }
-            catch (ClassNotFoundException e) {
+            catch (ClassNotFoundException e)
+            {
+                _xqrlAvailable = false;
                 return null;
             }
-            catch (Exception e) {
+            catch (Exception e)
+            {
+                _xqrlAvailable = false;
                 throw new RuntimeException(e.getMessage(), e);
             }
         }
 
         Object[] args = new Object[]{queryExpr, currentVar, new Boolean(true)};
 
-        try {
+        try
+        {
             return (Query) _xqrlCompileQuery.invoke(null, args);
         }
-        catch (InvocationTargetException e) {
+        catch (InvocationTargetException e)
+        {
             Throwable t = e.getCause();
             throw new RuntimeException(t.getMessage(), t);
         }
-        catch (IllegalAccessException e) {
+        catch (IllegalAccessException e)
+        {
             throw new RuntimeException(e.getMessage(), e);
         }
     }
 
+    private static Query getXqrl2002CompiledQuery(String queryExpr, String currentVar)
+    {
+        if (_xqrl2002Available && _xqrl2002CompileQuery == null)
+        {
+            try
+            {
+                Class xqrlImpl = Class.forName("org.apache.xmlbeans.impl.store.Xqrl2002Impl");
+
+                _xqrl2002CompileQuery =
+                        xqrlImpl.getDeclaredMethod("compileQuery",
+                                new Class[]{String.class, String.class, Boolean.class});
+            }
+            catch (ClassNotFoundException e)
+            {
+                _xqrl2002Available = false;
+                return null;
+            }
+            catch (Exception e)
+            {
+                _xqrl2002Available = false;
+                throw new RuntimeException(e.getMessage(), e);
+            }
+        }
+
+        Object[] args = new Object[]{queryExpr, currentVar, new Boolean(true)};
+
+        try
+        {
+            return (Query) _xqrl2002CompileQuery.invoke(null, args);
+        }
+        catch (InvocationTargetException e)
+        {
+            Throwable t = e.getCause();
+            throw new RuntimeException(t.getMessage(), t);
+        }
+        catch (IllegalAccessException e)
+        {
+            throw new RuntimeException(e.getMessage(), e);
+        }
+    }
 
     private static final class SaxonQueryImpl extends Query
     {
@@ -345,8 +417,13 @@
     }
 
 
-    private static HashMap _xqrlQueryCache = new HashMap(); //todo check for memory leaks
     private static HashMap _saxonQueryCache = new HashMap();
 
+    private static HashMap _xqrlQueryCache = new HashMap(); //todo check for memory leaks
     private static Method _xqrlCompileQuery;
+    private static boolean _xqrlAvailable = true;  // at the beginning assume is available
+
+    private static HashMap _xqrl2002QueryCache = new HashMap();
+    private static Method  _xqrl2002CompileQuery;
+    private static boolean _xqrl2002Available = true;  // at the beginning assume is available
 }

Modified: xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/SaxonXBeansDelegate.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/SaxonXBeansDelegate.java?rev=232349&r1=232348&r2=232349&view=diff
==============================================================================
--- xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/SaxonXBeansDelegate.java (original)
+++ xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/SaxonXBeansDelegate.java Fri Aug
12 11:25:28 2005
@@ -29,10 +29,15 @@
  */
 public final class SaxonXBeansDelegate
 {
-    protected static boolean bInstantiated = false;
-    static
+    protected static boolean _saxonAvailable = true; //first time assume Saxon is available
+    private static Constructor _constructor;
+    private static Constructor _xqConstructor;
+
+    private SaxonXBeansDelegate()
+    {}
+
+    static void init()
     {
-        boolean hasTheJars = false;
         Class saxonXPathImpl = null;
         Class saxonXQueryImpl = null;
         try
@@ -42,19 +47,17 @@
                 .forName("org.apache.xmlbeans.impl.xpath.saxon.XBeansXPath");
             saxonXQueryImpl = Class
                 .forName("org.apache.xmlbeans.impl.xquery.saxon.XBeansXQuery");
-
-            hasTheJars = true;
         }
         catch (ClassNotFoundException e)
         {
-            hasTheJars = false;
+            _saxonAvailable = false;
         }
         catch (NoClassDefFoundError e)
         {
-            hasTheJars = false;
+            _saxonAvailable = false;
         }
 
-        if (hasTheJars)
+        if (_saxonAvailable)
         {
             try
             {
@@ -69,17 +72,17 @@
             }
             catch (Exception e)
             {
+                _saxonAvailable = false;
                 throw new RuntimeException(e);
             }
         }
     }
 
-    private SaxonXBeansDelegate()
-    {}
-
     static SelectPathInterface createInstance(String xpath, Map namespaceMap)
     {
-        bInstantiated = true;
+        if (_saxonAvailable && _constructor == null)
+            init();
+
         if (_constructor == null)
             return null;
 
@@ -99,6 +102,9 @@
 
    static QueryInterface createQueryInstance(String query, String contextVar, int boundary)
    {
+       if (_saxonAvailable && _xqConstructor == null)
+           init();
+
         if (_xqConstructor == null)
             return null;
 
@@ -113,8 +119,6 @@
         }
     }
 
-
-
     public static interface SelectPathInterface
     {
         public List selectPath(Object node);
@@ -124,7 +128,4 @@
     {
         public List execQuery(Object node);
     }
-
-     private static Constructor _constructor;
-     private static Constructor _xqConstructor;
 }

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java?rev=232349&r1=232348&r2=232349&view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java Fri Aug
12 11:25:28 2005
@@ -209,20 +209,20 @@
             expectedQNames, errorType, badSchemaType);
     }
 
-    // For XmlEventListener.error
-
-    public void error ( XmlError error )
-    {
-        _errorState++;
-
-        if (_suspendErrors == 0)
-        {
-            _invalid = true;
-
-            if (_errorListener != null)
-                _errorListener.add( error );
-        }
-    }
+//    // For XmlEventListener.error
+//
+//    public void error ( XmlError error )
+//    {
+//        _errorState++;
+//
+//        if (_suspendErrors == 0)
+//        {
+//            _invalid = true;
+//
+//            if (_errorListener != null)
+//                _errorListener.add( error );
+//        }
+//    }
 
     public void nextEvent ( int kind, Event event )
     {

Modified: xmlbeans/trunk/test/perf/bin/run_all.bat
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/perf/bin/run_all.bat?rev=232349&r1=232348&r2=232349&view=diff
==============================================================================
--- xmlbeans/trunk/test/perf/bin/run_all.bat (original)
+++ xmlbeans/trunk/test/perf/bin/run_all.bat Fri Aug 12 11:25:28 2005
@@ -1,6 +1,6 @@
-call run_v2.bat
-call run_v1.bat
 call run_castor.bat
-call run_jaxb.bat
 call run_jibx.bat
 call run_xerces.bat
+call run_jaxb.bat
+call run_v1.bat
+call run_v2.bat

Modified: xmlbeans/trunk/test/perf/build.xml
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/perf/build.xml?rev=232349&r1=232348&r2=232349&view=diff
==============================================================================
--- xmlbeans/trunk/test/perf/build.xml (original)
+++ xmlbeans/trunk/test/perf/build.xml Fri Aug 12 11:25:28 2005
@@ -1,10 +1,10 @@
 <!-- build file -->
 <project name="xmlbeans-perf" default="usage">
-	
+
 	<target name="usage">
 		<echo>
 	Main Usage:
-	bootstrap - download and unzip benchmark jars - REQUIRED FOR BENCHMARKS 
+	bootstrap - download and unzip benchmark jars - REQUIRED FOR BENCHMARKS
 	[re]build.all - builds all schema jars and test classes
 	[re]build - builds test and tool classes only
 	[re]build.schema.jars - that's what it does :->
@@ -72,8 +72,8 @@
 	<!--
 	<property name="jibx.url" value="http://umn.dl.sourceforge.net/sourceforge/jibx/jibx-beta3c.zip"/>
 	-->
-	<property name="jibx.url" value="http://easynews.dl.sourceforge.net/sourceforge/jibx/jibx-beta3c.zip"/>

-	
+	<property name="jibx.url" value="http://easynews.dl.sourceforge.net/sourceforge/jibx/jibx-beta3c.zip"/>
+
 	<!-- v1 -->
 	<property name="v1.zip" value="${v1.dir}/xmlbeans-1.0.3.zip"/>
 	<property name="v1.url" value="http://www.apache.org/dist/xml/xmlbeans/v1.0.3/bin/xmlbeans-1.0.3.zip"/>
@@ -118,7 +118,7 @@
 		<pathelement path="${build.dir}"/>
 		<pathelement path="${perf-results.jar}"/>
 	</path>
-	
+
 	<path id="v1.classpath">
 		<fileset dir="${v1.dir}/xmlbeans-1.0.3/lib" includes="*.jar"/>
 		<pathelement path="${v1-purchase-order.jar}"/>
@@ -148,9 +148,11 @@
 	</path>
 
 	<path id="jaxb.classpath">
-		<fileset dir="${jaxb.dir}/jaxb/lib" includes="*.jar"/>
+		<!--fileset dir="${jaxb.dir}/lib" includes="*.jar"/-->
+		<fileset dir="${jaxb.dir}" includes="*.jar"/>
+		<!--fileset dir="${jaxb.dir}/jaxb/lib" includes="*.jar"/>
 		<fileset dir="${jaxb.dir}/jaxp/lib/endorsed" includes="*.jar"/>
-		<fileset dir="${jaxb.dir}/jwsdp-shared/lib" includes="*.jar"/>
+		<fileset dir="${jaxb.dir}/jwsdp-shared/lib" includes="*.jar"/-->
 		<pathelement path="${jaxb-purchase-order.jar}"/>
 		<pathelement path="${jaxb-primitives.jar}"/>
 		<pathelement path="${jaxb-non-primitives.jar}"/>
@@ -168,7 +170,7 @@
 	<target name="rebuild.all" if="bootstrap.libdir.exists" depends="check.bootstrap.libs,rebuild.schema.jars,rebuild"/>
 
 
-	<!-- conveinence src build targets  -->	
+	<!-- conveinence src build targets  -->
 	<target name="build" depends="build.tools,build.v2.perf,build.v1.perf,build.castor.perf,build.jibx.perf,build.xerces.perf,build.jaxb.perf"/>
 
 	<target name="clean">
@@ -181,7 +183,7 @@
 
 	<!-- conveinence schema jar build targets -->
 	<target name="build.schema.jars" depends="v2.schema.jars,v1.schema.jars,castor.schema.jars,jibx.schema.jars,jaxb.schema.jars"/>
-	
+
 	<target name="clean.schema.jars">
 		<delete dir="${schema.jar.build.dir}"/>
 	</target>
@@ -373,7 +375,7 @@
 		<mkdir dir="${schema.jar.build.dir}"/>
 		<chmod file="${v2.xmlbeans.root}/bin/scomp" perm="755"/>
 		<exec	dir="${v2.temp.dir}"
-					executable="${scomp}" 
+					executable="${scomp}"
 					output="${v2.temp.dir}/scomp_output.txt">
 			<env key="XMLBEANS_HOME" value="${v2.xmlbeans.root}"/>
 			<arg line="-out ${jar.name}"/>
@@ -521,6 +523,13 @@
 
 	<target name="jaxb.schema.build">
 		<echo message="starting schema compilation with jaxb"/>
+		<echo message="  jaxb.temp.dir ${jaxb.temp.dir}"/>
+		<echo message="  schema.jar.build.dir ${schema.jar.build.dir}"/>
+		<echo message="  {ns} ${ns}"/>
+		<echo message="  {env.JAVA_HOME} ${env.JAVA_HOME}"/>
+		<echo message="  {jar.name} ${jar.name}"/>
+		<echo message="  {test.case.dir}/xsd/{xsd.name} ${test.case.dir}/xsd/${xsd.name}"/>
+
 		<mkdir dir="${jaxb.temp.dir}"/>
 		<mkdir dir="${schema.jar.build.dir}"/>
 		<java classname="com.sun.tools.xjc.Driver"
@@ -539,7 +548,7 @@
 			compiler="modern"
 			executable="${env.JAVA_HOME}/bin/javac"
 			classpathref="jaxb.classpath"
-			source="1.4">
+			source="1.5">
 		</javac>
 		<jar destfile="${schema.jar.build.dir}/${jar.name}"
 				 basedir="${jaxb.temp.dir}"/>

Modified: xmlbeans/trunk/test/perf/src/org/apache/xmlbeans/test/performance/jaxb/NPrimTopDownJaxb.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/perf/src/org/apache/xmlbeans/test/performance/jaxb/NPrimTopDownJaxb.java?rev=232349&r1=232348&r2=232349&view=diff
==============================================================================
--- xmlbeans/trunk/test/perf/src/org/apache/xmlbeans/test/performance/jaxb/NPrimTopDownJaxb.java
(original)
+++ xmlbeans/trunk/test/perf/src/org/apache/xmlbeans/test/performance/jaxb/NPrimTopDownJaxb.java
Fri Aug 12 11:25:28 2005
@@ -23,21 +23,21 @@
 //import java.util.List;
 
 // from jaxb-generated schema jar(s)
-import org.openuri.nonprimitives.impl.NonPrimitivesImpl;
-import org.openuri.nonprimitives.impl.NumericsImpl;
+import org.openuri.nonprimitives.NonPrimitives;
+import org.openuri.nonprimitives.Numerics;
 
 
 public class NPrimTopDownJaxb
 {
   public static void main(String[] args) throws Exception
   {
-    
+
     final int iterations = Constants.ITERATIONS;
- 
+
     NPrimTopDownJaxb test = new NPrimTopDownJaxb();
     long cputime;
     int hash = 0;
-        
+
     // warm up the vm
     cputime = System.currentTimeMillis();
     for(int i=0; i<iterations; i++){
@@ -51,7 +51,7 @@
       hash += test.run();
     }
     cputime = System.currentTimeMillis() - cputime;
-      
+
     // print the results
     // Class.getSimpleName() is only provided in jdk1.5, so have to trim package name off
test name for logging to support 1.4
     System.out.print(Constants.DELIM+test.getClass().getName().substring(test.getClass().getName().lastIndexOf('.')+1)+"
");
@@ -59,15 +59,30 @@
     System.out.print("time "+cputime+"\n");
   }
 
+
+    static javax.xml.datatype.DatatypeFactory dtf;
+    static
+    {
+  	  try
+  	  {
+  	      dtf = javax.xml.datatype.DatatypeFactory.newInstance();
+        }
+        catch(Exception e)
+        {
+  		  e.printStackTrace();
+        }
+    }
+
+
   private int run() throws Exception
   {
     // create the doc
-    NonPrimitivesImpl nprim = new NonPrimitivesImpl();
+    NonPrimitives nprim = new NonPrimitives();
 
     // create and initialize the numerics
     for(int i=0; i<Constants.PO_NUM_LINEITEMS; i++)
     {
-      NumericsImpl numerics = new NumericsImpl();
+      Numerics numerics = new Numerics();
       numerics.setMydecimal(Constants.myBigDecimal);
       numerics.setMyinteger(Constants.myPosBigInteger);
       numerics.setMyneginteger(Constants.myNegBigInteger);
@@ -76,9 +91,9 @@
       numerics.setMyposinteger(Constants.myPosBigInteger);
       nprim.getNumerics().add(numerics);
     }
-    
+
     // create and initialize the misc element
-    nprim.setMydate(Constants.myDate);
+    nprim.setMydate(dtf.newXMLGregorianCalendar(Constants.myDate));
     nprim.setMystring(Constants.myString);
 
     // calculate a hash to return

Modified: xmlbeans/trunk/test/perf/src/org/apache/xmlbeans/test/performance/jaxb/POTopDownJaxb.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/perf/src/org/apache/xmlbeans/test/performance/jaxb/POTopDownJaxb.java?rev=232349&r1=232348&r2=232349&view=diff
==============================================================================
--- xmlbeans/trunk/test/perf/src/org/apache/xmlbeans/test/performance/jaxb/POTopDownJaxb.java
(original)
+++ xmlbeans/trunk/test/perf/src/org/apache/xmlbeans/test/performance/jaxb/POTopDownJaxb.java
Fri Aug 12 11:25:28 2005
@@ -15,6 +15,7 @@
 package org.apache.xmlbeans.test.performance.jaxb;
 
 import java.util.Calendar;
+import java.util.GregorianCalendar;
 
 import org.apache.xmlbeans.test.performance.utils.Constants;
 
@@ -24,24 +25,25 @@
 //import javax.xml.transform.stream.StreamSource;
 //import java.util.List;
 
+
 // from jaxb-generated schema jar(s)
-import org.openuri.easypo.impl.PurchaseOrderImpl;
-import org.openuri.easypo.impl.CustomerImpl;
-import org.openuri.easypo.impl.LineItemImpl;
-import org.openuri.easypo.impl.ShipperImpl;
+import org.openuri.easypo.PurchaseOrder;
+import org.openuri.easypo.Customer;
+import org.openuri.easypo.LineItem;
+import org.openuri.easypo.Shipper;
 
 
 public class POTopDownJaxb
 {
   public static void main(String[] args) throws Exception
   {
-    
+
     final int iterations = Constants.ITERATIONS;
- 
+
     POTopDownJaxb test = new POTopDownJaxb();
     long cputime;
     int hash = 0;
-        
+
     // warm up the vm
     cputime = System.currentTimeMillis();
     for(int i=0; i<iterations; i++){
@@ -55,7 +57,7 @@
       hash += test.run();
     }
     cputime = System.currentTimeMillis() - cputime;
-      
+
     // print the results
     // Class.getSimpleName() is only provided in jdk1.5, so have to trim package name off
test name for logging to support 1.4
     System.out.print(Constants.DELIM+test.getClass().getName().substring(test.getClass().getName().lastIndexOf('.')+1)+"
");
@@ -63,33 +65,48 @@
     System.out.print("time "+cputime+"\n");
   }
 
+
+    static javax.xml.datatype.DatatypeFactory dtf;
+    static
+    {
+  	  try
+  	  {
+  	      dtf = javax.xml.datatype.DatatypeFactory.newInstance();
+        }
+        catch(Exception e)
+        {
+  		  e.printStackTrace();
+        }
+    }
+
+
   private int run() throws Exception
   {
     // create the purchase order
-    PurchaseOrderImpl po = new PurchaseOrderImpl();
+    PurchaseOrder po = new PurchaseOrder();
 
     // create and initialize the customer
-    CustomerImpl customer = new CustomerImpl();
+    Customer customer = new Customer();
     customer.setName(Constants.PO_CUSTOMER_NAME);
     customer.setAddress(Constants.PO_CUSTOMER_ADDR);
     po.setCustomer(customer);
 
     // set the date
-    po.setDate(Calendar.getInstance());
+    po.setDate(dtf.newXMLGregorianCalendar(new GregorianCalendar()));
 
     // create and initialize the line item array
     for(int i=0; i<Constants.PO_NUM_LINEITEMS; i++)
     {
-      LineItemImpl li = new LineItemImpl();
+      LineItem li = new LineItem();
       li.setDescription(Constants.PO_LI_DESC);
       li.setPerUnitOunces(Constants.PO_LI_PUO);
       li.setPrice(Constants.PO_LI_PRICE);
       li.setQuantity(Constants.PO_LI_QUANTITY);
       po.getLineItem().add(li);
     }
-    
+
     // create and initialize the shipper
-    ShipperImpl shipper = new ShipperImpl();
+    Shipper shipper = new Shipper();
     shipper.setName(Constants.PO_SHIPPER_NAME);
     shipper.setPerOunceRate(Constants.PO_SHIPPER_POR);
     po.setShipper(shipper);

Modified: xmlbeans/trunk/test/perf/src/org/apache/xmlbeans/test/performance/jaxb/POTopDownSaveJaxb.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/perf/src/org/apache/xmlbeans/test/performance/jaxb/POTopDownSaveJaxb.java?rev=232349&r1=232348&r2=232349&view=diff
==============================================================================
--- xmlbeans/trunk/test/perf/src/org/apache/xmlbeans/test/performance/jaxb/POTopDownSaveJaxb.java
(original)
+++ xmlbeans/trunk/test/perf/src/org/apache/xmlbeans/test/performance/jaxb/POTopDownSaveJaxb.java
Fri Aug 12 11:25:28 2005
@@ -15,6 +15,7 @@
 package org.apache.xmlbeans.test.performance.jaxb;
 
 import java.util.Calendar;
+import java.util.GregorianCalendar;
 import java.io.StringWriter;
 
 import org.apache.xmlbeans.test.performance.utils.Constants;
@@ -26,23 +27,23 @@
 //import java.util.List;
 
 // from jaxb-generated schema jar(s)
-import org.openuri.easypo.impl.PurchaseOrderImpl;
-import org.openuri.easypo.impl.CustomerImpl;
-import org.openuri.easypo.impl.LineItemImpl;
-import org.openuri.easypo.impl.ShipperImpl;
+import org.openuri.easypo.PurchaseOrder;
+import org.openuri.easypo.Customer;
+import org.openuri.easypo.LineItem;
+import org.openuri.easypo.Shipper;
 
 
 public class POTopDownSaveJaxb
 {
   public static void main(String[] args) throws Exception
   {
-    
+
     final int iterations = Constants.ITERATIONS;
- 
+
     POTopDownSaveJaxb test = new POTopDownSaveJaxb();
     long cputime;
     int hash = 0;
-        
+
     // warm up the vm
     cputime = System.currentTimeMillis();
     for(int i=0; i<iterations; i++){
@@ -56,7 +57,7 @@
       hash += test.run();
     }
     cputime = System.currentTimeMillis() - cputime;
-      
+
     // print the results
     // Class.getSimpleName() is only provided in jdk1.5, so have to trim package name off
test name for logging to support 1.4
     System.out.print(Constants.DELIM+test.getClass().getName().substring(test.getClass().getName().lastIndexOf('.')+1)+"
");
@@ -64,33 +65,49 @@
     System.out.print("time "+cputime+"\n");
   }
 
+
+    static javax.xml.datatype.DatatypeFactory dtf;
+    static
+    {
+  	  try
+  	  {
+  	      dtf = javax.xml.datatype.DatatypeFactory.newInstance();
+        }
+        catch(Exception e)
+        {
+  		  e.printStackTrace();
+        }
+    }
+
+
+
   private int run() throws Exception
   {
     // create the purchase order
-    PurchaseOrderImpl po = new PurchaseOrderImpl();
+    PurchaseOrder po = new PurchaseOrder();
 
     // create and initialize the customer
-    CustomerImpl customer = new CustomerImpl();
+    Customer customer = new Customer();
     customer.setName(Constants.PO_CUSTOMER_NAME);
     customer.setAddress(Constants.PO_CUSTOMER_ADDR);
     po.setCustomer(customer);
 
     // set the date
-    po.setDate(Calendar.getInstance());
+    po.setDate(dtf.newXMLGregorianCalendar(new GregorianCalendar()));
 
     // create and initialize the line item array
     for(int i=0; i<Constants.PO_NUM_LINEITEMS; i++)
     {
-      LineItemImpl li = new LineItemImpl();
+      LineItem li = new LineItem();
       li.setDescription(Constants.PO_LI_DESC);
       li.setPerUnitOunces(Constants.PO_LI_PUO);
       li.setPrice(Constants.PO_LI_PRICE);
       li.setQuantity(Constants.PO_LI_QUANTITY);
       po.getLineItem().add(li);
     }
-    
+
     // create and initialize the shipper
-    ShipperImpl shipper = new ShipperImpl();
+    Shipper shipper = new Shipper();
     shipper.setName(Constants.PO_SHIPPER_NAME);
     shipper.setPerOunceRate(Constants.PO_SHIPPER_POR);
     po.setShipper(shipper);

Modified: xmlbeans/trunk/test/perf/src/org/apache/xmlbeans/test/performance/jaxb/PrimTopDownJaxb.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/perf/src/org/apache/xmlbeans/test/performance/jaxb/PrimTopDownJaxb.java?rev=232349&r1=232348&r2=232349&view=diff
==============================================================================
--- xmlbeans/trunk/test/perf/src/org/apache/xmlbeans/test/performance/jaxb/PrimTopDownJaxb.java
(original)
+++ xmlbeans/trunk/test/perf/src/org/apache/xmlbeans/test/performance/jaxb/PrimTopDownJaxb.java
Fri Aug 12 11:25:28 2005
@@ -23,9 +23,9 @@
 //import java.util.List;
 
 // from jaxb-generated schema jar(s)
-import org.openuri.primitives.impl.PrimitivesImpl;
-import org.openuri.primitives.impl.NumericsImpl;
-import org.openuri.primitives.impl.MiscImpl;
+import org.openuri.primitives.Primitives;
+import org.openuri.primitives.Numerics;
+import org.openuri.primitives.Misc;
 
 
 public class PrimTopDownJaxb
@@ -33,11 +33,11 @@
   public static void main(String[] args) throws Exception
   {
     final int iterations = Constants.ITERATIONS;
- 
+
     PrimTopDownJaxb test = new PrimTopDownJaxb();
     long cputime;
     int hash = 0;
-        
+
     // warm up the vm
     cputime = System.currentTimeMillis();
     for(int i=0; i<iterations; i++){
@@ -51,7 +51,7 @@
       hash += test.run();
     }
     cputime = System.currentTimeMillis() - cputime;
-      
+
     // print the results
     // Class.getSimpleName() is only provided in jdk1.5, so have to trim package name off
test name for logging to support 1.4
     System.out.print(Constants.DELIM+test.getClass().getName().substring(test.getClass().getName().lastIndexOf('.')+1)+"
");
@@ -62,12 +62,12 @@
   private int run() throws Exception
   {
     // create the doc
-    PrimitivesImpl prim = new PrimitivesImpl();
+    Primitives prim = new Primitives();
 
     // create and initialize the numerics
     for(int i=0; i<Constants.PO_NUM_LINEITEMS; i++)
     {
-      NumericsImpl numerics = new NumericsImpl();
+      Numerics numerics = new Numerics();
       numerics.setMybyte(Constants.myByte);
       numerics.setMyint(Constants.myInt);
       numerics.setMylong(Constants.myLong);
@@ -77,9 +77,9 @@
       numerics.setMyfloat(Constants.myFloat);
       prim.getNumerics().add(numerics);
     }
-    
+
     // create and initialize the misc element
-    MiscImpl misc = new MiscImpl();
+    Misc misc = new Misc();
     misc.setMybool(Constants.myBool);
     prim.setMisc(misc);
 

Modified: xmlbeans/trunk/test/src/xmlcursor/xpath/complex/checkin/JaxenXPathTests.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/xmlcursor/xpath/complex/checkin/JaxenXPathTests.java?rev=232349&r1=232348&r2=232349&view=diff
==============================================================================
--- xmlbeans/trunk/test/src/xmlcursor/xpath/complex/checkin/JaxenXPathTests.java (original)
+++ xmlbeans/trunk/test/src/xmlcursor/xpath/complex/checkin/JaxenXPathTests.java Fri Aug 12
11:25:28 2005
@@ -77,7 +77,7 @@
             {
                 bFail = true;
                 errors.append("**********************Failed at test " + i +
-                    "\n");
+                    "\n  path:" + xpathes[i] + "\n");
                 if (e.getMessage() == null)
                 {
                     StringWriter sw = new StringWriter();



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org


Mime
View raw message