xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ce...@apache.org
Subject svn commit: r149324 - in xmlbeans/trunk: ./ src/common/org/apache/xmlbeans/impl/common/ src/newstore2/org/apache/xmlbeans/impl/newstore2/ src/typeimpl/org/apache/xmlbeans/impl/validator/ src/typeimpl/org/apache/xmlbeans/impl/values/ test/perf/bin/ test/src/xmlcursor/checkin/
Date Tue, 01 Feb 2005 00:01:14 GMT
Author: cezar
Date: Mon Jan 31 16:01:07 2005
New Revision: 149324

URL: http://svn.apache.org/viewcvs?view=rev&rev=149324
Log:
Stream validation with attributes fix, plus various small fixes. And a patch for test perf
contributed by Jamie Zyskowski.

Modified:
    xmlbeans/trunk/build.xml
    xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/XPath.java
    xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/XmlWhitespace.java
    xmlbeans/trunk/src/newstore2/org/apache/xmlbeans/impl/newstore2/Path.java
    xmlbeans/trunk/src/newstore2/org/apache/xmlbeans/impl/newstore2/Query.java
    xmlbeans/trunk/src/newstore2/org/apache/xmlbeans/impl/newstore2/SaxonXBeansDelegate.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/ValidatingInfoXMLStreamReader.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/ValidatingXMLStreamReader.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlObjectBase.java
    xmlbeans/trunk/test/perf/bin/castor.sh
    xmlbeans/trunk/test/perf/bin/jaxb.sh
    xmlbeans/trunk/test/perf/bin/jibx.sh
    xmlbeans/trunk/test/perf/bin/v1.sh
    xmlbeans/trunk/test/perf/bin/v2.sh
    xmlbeans/trunk/test/perf/bin/xerces.sh
    xmlbeans/trunk/test/src/xmlcursor/checkin/CopyTest.java
    xmlbeans/trunk/test/src/xmlcursor/checkin/GetNameTest.java
    xmlbeans/trunk/test/src/xmlcursor/checkin/InsertElementTest.java
    xmlbeans/trunk/test/src/xmlcursor/checkin/MoveTest.java
    xmlbeans/trunk/test/src/xmlcursor/checkin/SelectPathTest.java

Modified: xmlbeans/trunk/build.xml
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/build.xml?view=diff&r1=149323&r2=149324
==============================================================================
--- xmlbeans/trunk/build.xml (original)
+++ xmlbeans/trunk/build.xml Mon Jan 31 16:01:07 2005
@@ -51,11 +51,11 @@
     </target>
 
     <target name="check.saxon8.2.jar" depends="saxon.find1,saxon.find2">
-     <condition property="saxon8.2.jar.exists">
-      <or>
-        <available file="build/lib/saxon8.jar"/>
-	<available file="${env.XMLBEANS_EXTERNALS}/saxon8.jar"/>
-	</or>
+      <condition property="saxon8.2.jar.exists">
+        <or>
+          <available file="build/lib/saxon8.jar"/>
+	        <available file="${env.XMLBEANS_EXTERNALS}/saxon8.jar"/>
+	      </or>
       </condition>
     </target>
 

Modified: xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/XPath.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/XPath.java?view=diff&r1=149323&r2=149324
==============================================================================
--- xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/XPath.java (original)
+++ xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/XPath.java Mon Jan 31 16:01:07
2005
@@ -269,7 +269,7 @@
         {
             assert
                 _currentNodeVar == null ||
-                    _currentNodeVar.startsWith( "$" );
+                _currentNodeVar.startsWith( "$" );
 
             if (currentNodeVar == null)
                 _currentNodeVar = "$this";
@@ -518,7 +518,6 @@
              while ( isWhitespace( offset ) )
                 offset++;
 
-
             advance( offset );
 
             return true;
@@ -923,15 +922,12 @@
                     }
                     _externalNamespaces.put( prefix, uri );
 
-                    if (! tokenize( ";" )){
-			//TODO: uncomment
-                       ;
-			/*
-			throw newError(
-                            "Namespace declaration must end with ;" ); 
-			*/
+                    if (! tokenize( ";" ))
+                    {
+			            throw newError(
+                            "Namespace declaration must end with ;" );
+			        }
 
-			}
                     _externalNamespaces.put(_NS_BOUNDARY,new Integer(_offset));
 
                     continue;
@@ -939,7 +935,6 @@
                 
                 if (tokenize( "declare","default", "element", "namespace" ))
                 {
-
                     String uri = tokenizeQuotedUri();
                     
                     if (_namespaces.containsKey( "" ))
@@ -951,20 +946,17 @@
                     _namespaces.put( "", uri );
 
                     //return these to saxon:? Is it an error to pass external NS
-                     //that conflicts? or should we just override it?
-                      if (_externalNamespaces.containsKey( XPath._DEFAULT_ELT_NS ))
-                                     {
-                                         throw newError(
-                                             "Redefinition of default element namespace :
");
-                                     }
-                                     _externalNamespaces.put( XPath._DEFAULT_ELT_NS, uri
);
-
-                                     if (! tokenize( ";" ))
-                                        throw newError(
-                                             "Default Namespace declaration must end with
;" );
-                                     //the boundary is the last ; in the prolog...
-                                     _externalNamespaces.put(_NS_BOUNDARY,new Integer(_offset));
+                    //that conflicts? or should we just override it?
+                    if (_externalNamespaces.containsKey( XPath._DEFAULT_ELT_NS ))
+                    {
+                         throw newError("Redefinition of default element namespace : ");
+                    }
+                    _externalNamespaces.put( XPath._DEFAULT_ELT_NS, uri );
 
+                    if (! tokenize( ";" ))
+                        throw newError("Default Namespace declaration must end with ;" );
+                    //the boundary is the last ; in the prolog...
+                    _externalNamespaces.put(_NS_BOUNDARY,new Integer(_offset));
 
                     continue;
                 }
@@ -1093,7 +1085,7 @@
     }
 
     public static final String _NS_BOUNDARY = "$xmlbeans!ns_boundary";
-     public static final String _DEFAULT_ELT_NS = "$xmlbeans!default_uri";
+    public static final String _DEFAULT_ELT_NS = "$xmlbeans!default_uri";
     private final Selector _selector;
     private final boolean  _sawDeepDot;
 }

Modified: xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/XmlWhitespace.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/XmlWhitespace.java?view=diff&r1=149323&r2=149324
==============================================================================
--- xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/XmlWhitespace.java (original)
+++ xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/XmlWhitespace.java Mon Jan 31
16:01:07 2005
@@ -154,5 +154,4 @@
 
         return new String(ch, 0, (i == 0 || ch[i - 1] != ' ') ? i : i - 1);
     }
-
 }

Modified: xmlbeans/trunk/src/newstore2/org/apache/xmlbeans/impl/newstore2/Path.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/newstore2/org/apache/xmlbeans/impl/newstore2/Path.java?view=diff&r1=149323&r2=149324
==============================================================================
--- xmlbeans/trunk/src/newstore2/org/apache/xmlbeans/impl/newstore2/Path.java (original)
+++ xmlbeans/trunk/src/newstore2/org/apache/xmlbeans/impl/newstore2/Path.java Mon Jan 31 16:01:07
2005
@@ -64,8 +64,7 @@
             currentNodeVar = (String) options.get(XmlOptions.XQUERY_CURRENT_NODE_VAR);
 
             if (currentNodeVar.startsWith("$")) {
-                throw
-                        new IllegalArgumentException("Omit the '$' prefix for the current
node variable");
+                throw new IllegalArgumentException("Omit the '$' prefix for the current node
variable");
             }
         }
 
@@ -171,9 +170,9 @@
     {
         static Path create(String pathExpr, String currentVar, Map namespaces)
         {
-            try {
-                return
-                        new XbeanPath(pathExpr, currentVar,
+            try
+            {
+                return new XbeanPath(pathExpr, currentVar,
                                 XPath.compileXPath(pathExpr, currentVar, namespaces));
             }
             catch (XPathCompileException e) {

Modified: xmlbeans/trunk/src/newstore2/org/apache/xmlbeans/impl/newstore2/Query.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/newstore2/org/apache/xmlbeans/impl/newstore2/Query.java?view=diff&r1=149323&r2=149324
==============================================================================
--- xmlbeans/trunk/src/newstore2/org/apache/xmlbeans/impl/newstore2/Query.java (original)
+++ xmlbeans/trunk/src/newstore2/org/apache/xmlbeans/impl/newstore2/Query.java Mon Jan 31
16:01:07 2005
@@ -344,7 +344,7 @@
     }
 
 
-    private static HashMap _xqrlQueryCache = new HashMap();
+    private static HashMap _xqrlQueryCache = new HashMap(); //todo check for memory leaks
     private static HashMap _saxonQueryCache = new HashMap();
 
     private static Method _xqrlCompileQuery;

Modified: xmlbeans/trunk/src/newstore2/org/apache/xmlbeans/impl/newstore2/SaxonXBeansDelegate.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/newstore2/org/apache/xmlbeans/impl/newstore2/SaxonXBeansDelegate.java?view=diff&r1=149323&r2=149324
==============================================================================
--- xmlbeans/trunk/src/newstore2/org/apache/xmlbeans/impl/newstore2/SaxonXBeansDelegate.java
(original)
+++ xmlbeans/trunk/src/newstore2/org/apache/xmlbeans/impl/newstore2/SaxonXBeansDelegate.java
Mon Jan 31 16:01:07 2005
@@ -30,57 +30,55 @@
 public final class SaxonXBeansDelegate
 {
     static
+    {
+        boolean hasTheJars = false;
+        Class saxonXPathImpl = null;
+        Class saxonXQueryImpl = null;
+        try
         {
-            boolean hasTheJars = false;
-            Class saxonXPathImpl = null;
-            Class saxonXQueryImpl = null;
-            try
-            {
-                // from xbean_xpath.jar
-                saxonXPathImpl = Class
-                        .forName( "org.apache.xmlbeans.impl.xpath.saxon.XBeansXPath" );
-                saxonXQueryImpl = Class
-                        .forName( "org.apache.xmlbeans.impl.xquery.saxon.XBeansXQuery" );
+            // from xbean_xpath.jar
+            saxonXPathImpl = Class
+                .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;
+        }
+        catch (NoClassDefFoundError e)
+        {
+            hasTheJars = false;
+        }
 
-                hasTheJars = true;
-            }
-            catch ( ClassNotFoundException e )
+        if (hasTheJars)
+        {
+            try
             {
-                hasTheJars = false;
+                _constructor =
+                    saxonXPathImpl.getConstructor(new Class[]{String.class,
+                                                              Map.class,
+                                                              String.class});
+                _xqConstructor =
+                    saxonXQueryImpl.getConstructor(new Class[]{String.class,
+                                                               String.class,
+                                                               Integer.class});
             }
-            catch ( NoClassDefFoundError e )
+            catch (Exception e)
             {
-                hasTheJars = false;
-            }
-
-            if (hasTheJars)
-            {
-                try
-                {
-                    _constructor =
-                        saxonXPathImpl.getConstructor( new Class[] { String.class,
-                                                                     Map.class,
-                                                                     String.class} );
-                    _xqConstructor =
-                            saxonXQueryImpl.getConstructor( new Class[] { String.class,
-                                                                          String.class,
-                                                                          Integer.class}
);
-
-                }
-                catch ( Exception e )
-                {
-                    throw new RuntimeException( e );
-                }
+                throw new RuntimeException(e);
             }
         }
+    }
 
     private SaxonXBeansDelegate()
     {}
 
     static SelectPathInterface createInstance(String xpath, Map namespaceMap)
     {
-           if (_constructor == null)
+        if (_constructor == null)
             return null;
 
         try
@@ -98,8 +96,8 @@
     }
 
    static QueryInterface createQueryInstance(String query, String contextVar, int boundary)
-    {
-           if (_xqConstructor == null)
+   {
+        if (_xqConstructor == null)
             return null;
 
         try
@@ -127,5 +125,4 @@
 
      private static Constructor _constructor;
      private static Constructor _xqConstructor;
-
 }

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/ValidatingInfoXMLStreamReader.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/ValidatingInfoXMLStreamReader.java?view=diff&r1=149323&r2=149324
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/ValidatingInfoXMLStreamReader.java
(original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/ValidatingInfoXMLStreamReader.java
Mon Jan 31 16:01:07 2005
@@ -23,6 +23,8 @@
 import org.apache.xmlbeans.GDuration;
 
 import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.events.XMLEvent;
 import javax.xml.namespace.QName;
 import java.math.BigDecimal;
 import java.util.List;
@@ -42,6 +44,29 @@
     {
         super();
     }
+
+    private int _attCount = -1;
+    private int _attIndex =  0;
+
+    public int nextWithAttributes()
+        throws XMLStreamException
+    {
+        if (_attIndex < _attCount)
+        {
+            validate_attribute(_attIndex);
+            _attIndex ++;
+            return XMLEvent.ATTRIBUTE;
+        }
+        else
+            return next();
+    }
+
+    protected void validate_attributes(int attCount)
+    {
+        _attCount = attCount;
+        _attIndex = 0;
+    }
+
 
     /**
      * @return Returns the SchemaType of the current element.

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/ValidatingXMLStreamReader.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/ValidatingXMLStreamReader.java?view=diff&r1=149323&r2=149324
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/ValidatingXMLStreamReader.java
(original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/ValidatingXMLStreamReader.java
Mon Jan 31 16:01:07 2005
@@ -446,15 +446,8 @@
             _validator.nextEvent(Validator.BEGIN, _elemEvent);
 
             int attCount = getAttributeCount();
-            for(int i=0; i<attCount; i++)
-            {
-                _attEvent.setAttributeIndex(i);
-                QName qn = _attEvent.getName();
-                if (isSpecialAttribute(qn))
-                    continue;
+            validate_attributes(attCount);
 
-                _validator.nextEvent(Validator.ATTR, _attEvent);
-            }
             break;
 
         case XMLEvent.ATTRIBUTE:
@@ -606,12 +599,10 @@
         initValidator(validationType);
         _validator.nextEvent(Validator.BEGIN, _simpleEvent);
 
-        for (int i=0; i<_attNamesList.size(); i++)
-        {
-            _simpleEvent._qname = (QName)_attNamesList.get(i);
-            _simpleEvent._text = (String)_attValuesList.get(i);
-            _validator.nextEvent(Validator.ATTR, _simpleEvent);
-        }
+        // validate attributes from _attNamesList
+        validate_attributes(_attNamesList.size());
+        _attNamesList = null;
+        _attValuesList = null;
 
         _state = STATE_VALIDATING;
     }
@@ -668,6 +659,36 @@
         }
         else
             _errorListener.add(XmlError.forMessage(msg));
+    }
+
+    protected void validate_attributes(int attCount)
+    {
+        for(int i=0; i<attCount; i++)
+        {
+            validate_attribute(i);
+        }
+    }
+
+    protected void validate_attribute(int attIndex)
+    {
+        ValidatorListener.Event event;
+        if (_attNamesList==null)
+        {
+            _attEvent.setAttributeIndex(attIndex);
+            QName qn = _attEvent.getName();
+            if (isSpecialAttribute(qn))
+                return;
+
+            event = _attEvent;
+        }
+        else
+        {
+            _simpleEvent._qname = (QName)_attNamesList.get(attIndex);
+            _simpleEvent._text = (String)_attValuesList.get(attIndex);
+            event = _simpleEvent;
+        }
+
+        _validator.nextEvent(Validator.ATTR, event);
     }
 
     /**

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlObjectBase.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlObjectBase.java?view=diff&r1=149323&r2=149324
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlObjectBase.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlObjectBase.java Mon Jan
31 16:01:07 2005
@@ -92,7 +92,7 @@
     public final Object monitor()
     {
         if (has_store())
-            return get_store().get_root_object();
+            return get_store().get_locale();
         return this;
     }
 
@@ -2375,8 +2375,6 @@
         {
             if (!xc.isContainer())
                 return null;
-
-            List result = new ArrayList();
 
             if (xc.toFirstAttribute())
             {

Modified: xmlbeans/trunk/test/perf/bin/castor.sh
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/perf/bin/castor.sh?view=diff&r1=149323&r2=149324
==============================================================================
--- xmlbeans/trunk/test/perf/bin/castor.sh (original)
+++ xmlbeans/trunk/test/perf/bin/castor.sh Mon Jan 31 16:01:07 2005
@@ -1,3 +1,25 @@
 #/bin/sh
 
-java -Xmx64m -Xbootclasspath/p:$XMLBEANS_PERFROOT/3rdparty/xerces/xerces-2_6_2/xml-apis.jar:$XMLBEANS_PERFROOT/3rdparty/xerces/xerces-2_6_2/xercesImpl.jar
-classpath $XMLBEANS_PERFROOT/build:$XMLBEANS_PERFROOT/schema_build/castor-purchase-order.jar:$XMLBEANS_PERFROOT/schema_build/castor-primitives.jar:$XMLBEANS_PERFROOT/schema_build/castor-non-primitives.jar:$XMLBEANS_PERFROOT/3rdparty/castor/castor-0.9.5.4.jar
-DPERF_ROOT=$XMLBEANS_PERFROOT org.apache.xmlbeans.test.performance.castor.$* 
+export MEM=64
+export FLAVOR=
+export FILENAME=
+
+#scan first param
+case "$2" in
+	memory) export MEM=$3 ;;
+	flavor) export FLAVOR=$3 ;;
+	filename) export FILENAME=$3 ;;
+esac
+#scan second param
+case "$4" in
+	memory) export MEM=$5 ;;
+	flavor) export FLAVOR=$5 ;;
+	filename) export FILENAME=$5 ;;
+esac
+#scan third param
+case "$6" in
+	memory) export MEM=$7 ;;
+	flavor) export FLAVOR=$7 ;;
+	filename) export FILENAME=$7 ;;
+esac
+java -Xmx"$MEM"m -Xbootclasspath/p:$XMLBEANS_PERFROOT/3rdparty/xerces/xerces-2_6_2/xml-apis.jar:$XMLBEANS_PERFROOT/3rdparty/xerces/xerces-2_6_2/xercesImpl.jar
-classpath $XMLBEANS_PERFROOT/build:$XMLBEANS_PERFROOT/schema_build/castor-purchase-order.jar:$XMLBEANS_PERFROOT/schema_build/castor-primitives.jar:$XMLBEANS_PERFROOT/schema_build/castor-non-primitives.jar:$XMLBEANS_PERFROOT/3rdparty/castor/castor-0.9.5.4.jar
-DPERF_ROOT=$XMLBEANS_PERFROOT org.apache.xmlbeans.test.performance.castor.$1 $FLAVOR $FILENAME


Modified: xmlbeans/trunk/test/perf/bin/jaxb.sh
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/perf/bin/jaxb.sh?view=diff&r1=149323&r2=149324
==============================================================================
--- xmlbeans/trunk/test/perf/bin/jaxb.sh (original)
+++ xmlbeans/trunk/test/perf/bin/jaxb.sh Mon Jan 31 16:01:07 2005
@@ -1,3 +1,26 @@
 #/bin/sh
 
-java -Xmx64m -Xbootclasspath/p:$XMLBEANS_PERFROOT/3rdparty/xerces/xerces-2_6_2/xml-apis.jar:$XMLBEANS_PERFROOT/3rdparty/xerces/xerces-2_6_2/xercesImpl.jar
-classpath $XMLBEANS_PERFROOT/build:$XMLBEANS_PERFROOT/schema_build/jaxb-purchase-order.jar:$XMLBEANS_PERFROOT/schema_build/jaxb-primitives.jar:$XMLBEANS_PERFROOT/schema_build/jaxb-non-primitives.jar:$JAXB_LIBDIR/jaxb-libs.jar:$JAXB_LIBDIR/jaxb-impl.jar:$JAXB_LIBDIR/jaxb-api.jar:$JAXB_LIBDIR/relaxngDatatype.jar:$JAXB_LIBDIR/xsdlib.jar
-DPERF_ROOT=$XMLBEANS_PERFROOT org.apache.xmlbeans.test.performance.jaxb.$* 
+export MEM=64
+export FLAVOR=
+export FILENAME=
+
+#scan first param
+case "$2" in
+	memory) export MEM=$3 ;;
+	flavor) export FLAVOR=$3 ;;
+	filename) export FILENAME=$3 ;;
+esac
+#scan second param
+case "$4" in
+	memory) export MEM=$5 ;;
+	flavor) export FLAVOR=$5 ;;
+	filename) export FILENAME=$5 ;;
+esac
+#scan third param
+case "$6" in
+	memory) export MEM=$7 ;;
+	flavor) export FLAVOR=$7 ;;
+	filename) export FILENAME=$7 ;;
+esac
+
+java -Xmx"$MEM"m -Xbootclasspath/p:$XMLBEANS_PERFROOT/3rdparty/xerces/xerces-2_6_2/xml-apis.jar:$XMLBEANS_PERFROOT/3rdparty/xerces/xerces-2_6_2/xercesImpl.jar
-classpath $XMLBEANS_PERFROOT/build:$XMLBEANS_PERFROOT/schema_build/jaxb-purchase-order.jar:$XMLBEANS_PERFROOT/schema_build/jaxb-primitives.jar:$XMLBEANS_PERFROOT/schema_build/jaxb-non-primitives.jar:$JAXB_LIBDIR/jaxb-libs.jar:$JAXB_LIBDIR/jaxb-impl.jar:$JAXB_LIBDIR/jaxb-api.jar:$JAXB_LIBDIR/relaxngDatatype.jar:$JAXB_LIBDIR/xsdlib.jar
-DPERF_ROOT=$XMLBEANS_PERFROOT org.apache.xmlbeans.test.performance.jaxb.$1 $FLAVOR $FILENAME


Modified: xmlbeans/trunk/test/perf/bin/jibx.sh
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/perf/bin/jibx.sh?view=diff&r1=149323&r2=149324
==============================================================================
--- xmlbeans/trunk/test/perf/bin/jibx.sh (original)
+++ xmlbeans/trunk/test/perf/bin/jibx.sh Mon Jan 31 16:01:07 2005
@@ -1,3 +1,26 @@
 #/bin/sh
 
-java -Xmx64m -classpath $XMLBEANS_PERFROOT/build:$XMLBEANS_PERFROOT/schema_build/jibx-purchase-order.jar:$XMLBEANS_PERFROOT/3rdparty/jibx/jibx//lib/jibx-run.jar:$XMLBEANS_PERFROOT/3rdparty/jibx/jibx/lib/xpp3.jar
-DPERF_ROOT=$XMLBEANS_PERFROOT org.apache.xmlbeans.test.performance.jibx.$* 
+export MEM=64
+export FLAVOR=
+export FILENAME=
+
+#scan first param
+case "$2" in
+	memory) export MEM=$3 ;;
+	flavor) export FLAVOR=$3 ;;
+	filename) export FILENAME=$3 ;;
+esac
+#scan second param
+case "$4" in
+	memory) export MEM=$5 ;;
+	flavor) export FLAVOR=$5 ;;
+	filename) export FILENAME=$5 ;;
+esac
+#scan third param
+case "$6" in
+	memory) export MEM=$7 ;;
+	flavor) export FLAVOR=$7 ;;
+	filename) export FILENAME=$7 ;;
+esac
+
+java -Xmx"$MEM"m -classpath $XMLBEANS_PERFROOT/build:$XMLBEANS_PERFROOT/schema_build/jibx-purchase-order.jar:$XMLBEANS_PERFROOT/3rdparty/jibx/jibx//lib/jibx-run.jar:$XMLBEANS_PERFROOT/3rdparty/jibx/jibx/lib/xpp3.jar
-DPERF_ROOT=$XMLBEANS_PERFROOT org.apache.xmlbeans.test.performance.jibx.$1 $FLAVOR $FILENAME


Modified: xmlbeans/trunk/test/perf/bin/v1.sh
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/perf/bin/v1.sh?view=diff&r1=149323&r2=149324
==============================================================================
--- xmlbeans/trunk/test/perf/bin/v1.sh (original)
+++ xmlbeans/trunk/test/perf/bin/v1.sh Mon Jan 31 16:01:07 2005
@@ -1,4 +1,27 @@
 V1_LIB=$XMLBEANS_PERFROOT/3rdparty/v1/xmlbeans-1.0.3/lib
 export V1_LIB
 
-java -Xmx64m -classpath $XMLBEANS_PERFROOT/build:$XMLBEANS_PERFROOT/schema_build/v1-purchase-order.jar:$XMLBEANS_PERFROOT/schema_build/v1-primitives.jar:$XMLBEANS_PERFROOT/schema_build/v1-non-primitives.jar:$V1_LIB/xbean.jar:$XMLBEANS_HOME/external/lib/piccolo_apache_dist_20040629_v2.jar
-DPERF_ROOT=$XMLBEANS_PERFROOT org.apache.xmlbeans.test.performance.v1.$* 
+export MEM=64
+export FLAVOR=
+export FILENAME=
+
+#scan first param
+case "$2" in
+	memory) export MEM=$3 ;;
+	flavor) export FLAVOR=$3 ;;
+	filename) export FILENAME=$3 ;;
+esac
+#scan second param
+case "$4" in
+	memory) export MEM=$5 ;;
+	flavor) export FLAVOR=$5 ;;
+	filename) export FILENAME=$5 ;;
+esac
+#scan third param
+case "$6" in
+	memory) export MEM=$7 ;;
+	flavor) export FLAVOR=$7 ;;
+	filename) export FILENAME=$7 ;;
+esac
+
+java -Xmx"$MEM"m -classpath $XMLBEANS_PERFROOT/build:$XMLBEANS_PERFROOT/schema_build/v1-purchase-order.jar:$XMLBEANS_PERFROOT/schema_build/v1-primitives.jar:$XMLBEANS_PERFROOT/schema_build/v1-non-primitives.jar:$V1_LIB/xbean.jar:$XMLBEANS_HOME/external/lib/piccolo_apache_dist_20040629_v2.jar
-DPERF_ROOT=$XMLBEANS_PERFROOT org.apache.xmlbeans.test.performance.v1.$1 $FLAVOR $FILENAME


Modified: xmlbeans/trunk/test/perf/bin/v2.sh
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/perf/bin/v2.sh?view=diff&r1=149323&r2=149324
==============================================================================
--- xmlbeans/trunk/test/perf/bin/v2.sh (original)
+++ xmlbeans/trunk/test/perf/bin/v2.sh Mon Jan 31 16:01:07 2005
@@ -1 +1,25 @@
-java -Xmx64m -classpath $XMLBEANS_PERFROOT/build:$XMLBEANS_PERFROOT/schema_build/v2-purchase-order.jar:$XMLBEANS_PERFROOT/schema_build/v2-primitives.jar:$XMLBEANS_PERFROOT/schema_build/v2-non-primitives.jar:$XMLBEANS_HOME/build/lib/xbean.jar:$XMLBEANS_HOME/build/lib/jsr173_api.jar:$XMLBEANS_HOME/external/lib/piccolo_apache_dist_20040629_v2.jar
-DPERF_ROOT=$XMLBEANS_PERFROOT org.apache.xmlbeans.test.performance.v2.$* 
+
+export MEM=64
+export FLAVOR=
+export FILENAME=
+
+#scan first param
+case "$2" in
+	memory) export MEM=$3 ;;
+	flavor) export FLAVOR=$3 ;;
+	filename) export FILENAME=$3 ;;
+esac
+#scan second param
+case "$4" in
+	memory) export MEM=$5 ;;
+	flavor) export FLAVOR=$5 ;;
+	filename) export FILENAME=$5 ;;
+esac
+#scan third param
+case "$6" in
+	memory) export MEM=$7 ;;
+	flavor) export FLAVOR=$7 ;;
+	filename) export FILENAME=$7 ;;
+esac
+
+java -Xmx"$MEM"m -classpath $XMLBEANS_PERFROOT/build:$XMLBEANS_PERFROOT/schema_build/v2-purchase-order.jar:$XMLBEANS_PERFROOT/schema_build/v2-primitives.jar:$XMLBEANS_PERFROOT/schema_build/v2-non-primitives.jar:$XMLBEANS_HOME/build/lib/xbean.jar:$XMLBEANS_HOME/build/lib/jsr173_api.jar:$XMLBEANS_HOME/external/lib/piccolo_apache_dist_20040629_v2.jar
-DPERF_ROOT=$XMLBEANS_PERFROOT org.apache.xmlbeans.test.performance.v2.$1 $FLAVOR $FILENAME


Modified: xmlbeans/trunk/test/perf/bin/xerces.sh
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/perf/bin/xerces.sh?view=diff&r1=149323&r2=149324
==============================================================================
--- xmlbeans/trunk/test/perf/bin/xerces.sh (original)
+++ xmlbeans/trunk/test/perf/bin/xerces.sh Mon Jan 31 16:01:07 2005
@@ -1,3 +1,26 @@
 #/bin/sh
 
-java -Xbootclasspath/p:$XMLBEANS_PERFROOT/3rdparty/xerces/xerces-2_6_2/xml-apis.jar:$XMLBEANS_PERFROOT/3rdparty/xerces/xerces-2_6_2/xercesImpl.jar
-Xmx64m -classpath $XMLBEANS_PERFROOT/build -DPERF_ROOT=$XMLBEANS_PERFROOT org.apache.xmlbeans.test.performance.xerces.$*

+export MEM=64
+export FLAVOR=
+export FILENAME=
+
+#scan first param
+case "$2" in
+	memory) export MEM=$3 ;;
+	flavor) export FLAVOR=$3 ;;
+	filename) export FILENAME=$3 ;;
+esac
+#scan second param
+case "$4" in
+	memory) export MEM=$5 ;;
+	flavor) export FLAVOR=$5 ;;
+	filename) export FILENAME=$5 ;;
+esac
+#scan third param
+case "$6" in
+	memory) export MEM=$7 ;;
+	flavor) export FLAVOR=$7 ;;
+	filename) export FILENAME=$7 ;;
+esac
+
+java -Xbootclasspath/p:$XMLBEANS_PERFROOT/3rdparty/xerces/xerces-2_6_2/xml-apis.jar:$XMLBEANS_PERFROOT/3rdparty/xerces/xerces-2_6_2/xercesImpl.jar
-Xmx"$MEM"m -classpath $XMLBEANS_PERFROOT/build -DPERF_ROOT=$XMLBEANS_PERFROOT org.apache.xmlbeans.test.performance.xerces.$1
$FLAVOR $FILENAME 

Modified: xmlbeans/trunk/test/src/xmlcursor/checkin/CopyTest.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/xmlcursor/checkin/CopyTest.java?view=diff&r1=149323&r2=149324
==============================================================================
--- xmlbeans/trunk/test/src/xmlcursor/checkin/CopyTest.java (original)
+++ xmlbeans/trunk/test/src/xmlcursor/checkin/CopyTest.java Mon Jan 31 16:01:07 2005
@@ -90,11 +90,11 @@
         XmlCursor xc0 = xobj0.newCursor();
         XmlCursor xc1 = xobj1.newCursor();
 
-        xc0.selectPath(Common.CLM_NS_XQUERY_DEFAULT + " $this//Initial");
+        xc0.selectPath(Common.CLM_NS_XQUERY_DEFAULT + " .//Initial");
         xc0.toNextSelection();
          String sQuery=
-                 "declare namespace po=\"http://xbean.test/xmlcursor/PurchaseOrder\";"+
-                 "$this//po:zip";
+                 "declare namespace po=\"http://xbean.test/xmlcursor/PurchaseOrder\"; "+
+                 ".//po:zip";
         xc1.selectPath( sQuery );
         xc1.toNextSelection();
 
@@ -135,12 +135,12 @@
         XmlCursor xc0 = xobj0.newCursor();
         XmlCursor xc1 = xobj1.newCursor();
 
-        xc0.selectPath(Common.CLM_NS_XQUERY_DEFAULT + "$this//Initial");
+        xc0.selectPath(Common.CLM_NS_XQUERY_DEFAULT + " .//Initial");
         xc0.toNextSelection();
 
          String sQuery=
-                 "declare namespace po=\"http://xbean.test/xmlcursor/PurchaseOrder\";"+
-                 "$this//po:zip";
+                 "declare namespace po=\"http://xbean.test/xmlcursor/PurchaseOrder\"; "+
+                 ".//po:zip";
         xc1.selectPath( sQuery );
         xc1.selectPath( sQuery );
         xc1.toNextSelection();
@@ -182,12 +182,12 @@
         m_xo = XmlObject.Factory.parse(
                  JarUtil.getResourceFromJar(Common.TRANXML_FILE_XMLCURSOR_PO));
 
-        String ns="declare namespace po=\"http://xbean.test/xmlcursor/PurchaseOrder\";";
+        String ns="declare namespace po=\"http://xbean.test/xmlcursor/PurchaseOrder\"; ";
         m_xc = m_xo.newCursor();
         XmlCursor xc1 = m_xo.newCursor();
-        m_xc.selectPath(ns+" $this//po:shipTo/po:city");
+        m_xc.selectPath(ns+" .//po:shipTo/po:city");
         m_xc.toNextSelection();
-        xc1.selectPath(ns +" $this//po:billTo/po:city");
+        xc1.selectPath(ns +" .//po:billTo/po:city");
         xc1.toNextSelection();
         m_xc.copyXml(xc1);
         xc1.toPrevToken();
@@ -202,15 +202,15 @@
 
     public void testCopyElementToMiddleOfTEXT() throws Exception {
 
-        String ns="declare namespace po=\"http://xbean.test/xmlcursor/PurchaseOrder\";";
+        String ns="declare namespace po=\"http://xbean.test/xmlcursor/PurchaseOrder\"; ";
         String exp_ns="xmlns:po=\"http://xbean.test/xmlcursor/PurchaseOrder\"";
         m_xo = XmlObject.Factory.parse(
                 JarUtil.getResourceFromJar(Common.TRANXML_FILE_XMLCURSOR_PO));
         m_xc = m_xo.newCursor();
         XmlCursor xc1 = m_xo.newCursor();
-        m_xc.selectPath(ns+" $this//po:shipTo/po:city");
+        m_xc.selectPath(ns+" .//po:shipTo/po:city");
         m_xc.toNextSelection();
-        xc1.selectPath(ns+" $this//po:billTo/po:city");
+        xc1.selectPath(ns+" .//po:billTo/po:city");
         xc1.toNextSelection();
         xc1.toNextToken();
         xc1.toNextChar(4);  // should be at 'T' in "Old Town"
@@ -230,7 +230,7 @@
         assertEquals("<po:city "+exp_ns+">Mill Valley</po:city>", m_xc.xmlText());
     }
 
-    
+
 
 }
 

Modified: xmlbeans/trunk/test/src/xmlcursor/checkin/GetNameTest.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/xmlcursor/checkin/GetNameTest.java?view=diff&r1=149323&r2=149324
==============================================================================
--- xmlbeans/trunk/test/src/xmlcursor/checkin/GetNameTest.java (original)
+++ xmlbeans/trunk/test/src/xmlcursor/checkin/GetNameTest.java Mon Jan 31 16:01:07 2005
@@ -87,9 +87,9 @@
         m_xo = XmlObject.Factory.parse(
                   JarUtil.getResourceFromJar(Common.TRANXML_FILE_XMLCURSOR_PO));
         m_xc = m_xo.newCursor();
-        String ns="declare namespace po=\"http://xbean.test/xmlcursor/PurchaseOrder\";";
+        String ns="declare namespace po=\"http://xbean.test/xmlcursor/PurchaseOrder\"; ";
 
-        m_xc.selectPath(ns+" $this//po:shipTo/po:city");
+        m_xc.selectPath(ns+" .//po:shipTo/po:city");
         m_xc.toNextSelection();
         assertEquals("city", m_xc.getName().getLocalPart());
     }
@@ -97,7 +97,7 @@
     public void testGetNameFromEND() throws Exception {
         m_xo = XmlObject.Factory.parse("<foo><bar>text</bar></foo>");
         m_xc = m_xo.newCursor();
-        m_xc.selectPath("$this//bar");
+        m_xc.selectPath(".//bar");
         toNextTokenOfType(m_xc, TokenType.END);
         assertEquals(null, m_xc.getName());
     }
@@ -106,9 +106,9 @@
         m_xo = XmlObject.Factory.parse(
                   JarUtil.getResourceFromJar(Common.TRANXML_FILE_XMLCURSOR_PO));
         m_xc = m_xo.newCursor();
-        String ns="declare namespace po=\"http://xbean.test/xmlcursor/PurchaseOrder\";";
+        String ns="declare namespace po=\"http://xbean.test/xmlcursor/PurchaseOrder\"; ";
 
-        m_xc.selectPath(ns+" $this//po:shipTo");
+        m_xc.selectPath(ns+" .//po:shipTo");
         m_xc.toNextSelection();
         toNextTokenOfType(m_xc, TokenType.ATTR);
         assertEquals("country", m_xc.getName().getLocalPart());
@@ -125,7 +125,7 @@
         m_xo =  XmlObject.Factory.parse(
                 JarUtil.getResourceFromJar(Common.TRANXML_FILE_CLM));
         m_xc = m_xo.newCursor();
-        m_xc.selectPath(Common.CLM_NS_XQUERY_DEFAULT + "$this//ETA");
+        m_xc.selectPath(Common.CLM_NS_XQUERY_DEFAULT + ".//ETA");
         m_xc.toNextSelection();
         assertEquals("ETA", m_xc.getName().getLocalPart());
         assertEquals(Common.CLM_NS, m_xc.getName().getNamespaceURI());
@@ -134,8 +134,8 @@
     public void testGetNameAttrWithDefaultNamespace() throws Exception {
         m_xo = XmlObject.Factory.parse(Common.XML_FOO_NS_PREFIX);
         m_xc = m_xo.newCursor();
-        String sDefaultElemNS = "declare default element namespace \"http://ecommerce.org/schema\";";
-        m_xc.selectPath(sDefaultElemNS + "$this//price");
+        String sDefaultElemNS = "declare default element namespace \"http://ecommerce.org/schema\";
";
+        m_xc.selectPath(sDefaultElemNS + ".//price");
         m_xc.toNextSelection();
         m_xc.toFirstAttribute();
         assertEquals("units", m_xc.getName().getLocalPart());

Modified: xmlbeans/trunk/test/src/xmlcursor/checkin/InsertElementTest.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/xmlcursor/checkin/InsertElementTest.java?view=diff&r1=149323&r2=149324
==============================================================================
--- xmlbeans/trunk/test/src/xmlcursor/checkin/InsertElementTest.java (original)
+++ xmlbeans/trunk/test/src/xmlcursor/checkin/InsertElementTest.java Mon Jan 31 16:01:07 2005
@@ -134,7 +134,7 @@
                  JarUtil.getResourceFromJar(Common.TRANXML_FILE_CLM));
         m_xc = m_xo.newCursor();
         m_xc.selectPath(Common.CLM_NS_XQUERY_DEFAULT +
-                        "$this//FleetID");
+                        ".//FleetID");
         m_xc.toNextSelection();
         m_xc.insertElementWithText("name", "uri", "value");
         m_xc.toPrevSibling();

Modified: xmlbeans/trunk/test/src/xmlcursor/checkin/MoveTest.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/xmlcursor/checkin/MoveTest.java?view=diff&r1=149323&r2=149324
==============================================================================
--- xmlbeans/trunk/test/src/xmlcursor/checkin/MoveTest.java (original)
+++ xmlbeans/trunk/test/src/xmlcursor/checkin/MoveTest.java Mon Jan 31 16:01:07 2005
@@ -83,12 +83,12 @@
         XmlCursor xc0 = xobj0.newCursor();
         XmlCursor xc1 = xobj1.newCursor();
 
-        xc0.selectPath(Common.CLM_NS_XQUERY_DEFAULT + "$this//Initial");
+        xc0.selectPath(Common.CLM_NS_XQUERY_DEFAULT + ".//Initial");
         xc0.toNextSelection();
 
         String sQuery=
-                "declare namespace po=\"http://xbean.test/xmlcursor/PurchaseOrder\";"+
-                 "$this//po:zip";
+                "declare namespace po=\"http://xbean.test/xmlcursor/PurchaseOrder\"; "+
+                ".//po:zip";
         xc1.selectPath( sQuery );
         assertTrue( 0 < xc1.getSelectionCount());
         xc1.toNextSelection();
@@ -127,13 +127,13 @@
     public void testMoveNewLocation() throws Exception {
        m_xo=XmlObject.Factory.parse(
                 JarUtil.getResourceFromJar(Common.TRANXML_FILE_XMLCURSOR_PO));
-        String ns="declare namespace po=\"http://xbean.test/xmlcursor/PurchaseOrder\";";
+        String ns="declare namespace po=\"http://xbean.test/xmlcursor/PurchaseOrder\"; ";
 
         m_xc = m_xo.newCursor();
         XmlCursor xc1 = m_xo.newCursor();
-        m_xc.selectPath(ns+" $this//po:shipTo/po:city");
+        m_xc.selectPath(ns+" .//po:shipTo/po:city");
         m_xc.toNextSelection();
-        xc1.selectPath(ns +" $this//po:billTo/po:city");
+        xc1.selectPath(ns +" .//po:billTo/po:city");
         xc1.toNextSelection();
         m_xc.moveXml(xc1);
         xc1.toPrevToken();
@@ -151,13 +151,13 @@
     public void testMoveElementToMiddleOfTEXT() throws Exception {
         m_xo = XmlObject.Factory.parse(
                  JarUtil.getResourceFromJar(Common.TRANXML_FILE_XMLCURSOR_PO));
-        String ns="declare namespace po=\"http://xbean.test/xmlcursor/PurchaseOrder\";";
+        String ns="declare namespace po=\"http://xbean.test/xmlcursor/PurchaseOrder\"; ";
 
         m_xc = m_xo.newCursor();
         XmlCursor xc1 = m_xo.newCursor();
-        m_xc.selectPath(ns+" $this//po:shipTo/po:city");
+        m_xc.selectPath(ns+" .//po:shipTo/po:city");
         m_xc.toNextSelection();
-        xc1.selectPath(ns+" $this//po:billTo/po:city");
+        xc1.selectPath(ns+" .//po:billTo/po:city");
         xc1.toNextSelection();
         xc1.toNextToken();
         xc1.toNextChar(4);  // should be at 'T' in "Old Town"

Modified: xmlbeans/trunk/test/src/xmlcursor/checkin/SelectPathTest.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/xmlcursor/checkin/SelectPathTest.java?view=diff&r1=149323&r2=149324
==============================================================================
--- xmlbeans/trunk/test/src/xmlcursor/checkin/SelectPathTest.java (original)
+++ xmlbeans/trunk/test/src/xmlcursor/checkin/SelectPathTest.java Mon Jan 31 16:01:07 2005
@@ -68,7 +68,7 @@
         m_xo = XmlObject.Factory.parse(
                 JarUtil.getResourceFromJar(Common.TRANXML_FILE_CLM));
         m_xc = m_xo.newCursor();
-        String sLocalPath ="$this//FleetID";
+        String sLocalPath =".//FleetID";
         m_xc.selectPath(sLocalPath);
         assertEquals(0, m_xc.getSelectionCount());
         m_xc.selectPath(Common.CLM_NS_XQUERY_DEFAULT +
@@ -81,9 +81,9 @@
                  JarUtil.getResourceFromJar(Common.TRANXML_FILE_XMLCURSOR_PO));
         m_xc = m_xo.newCursor();
         String ns="declare namespace po=\"http://xbean.test/xmlcursor/PurchaseOrder\";";
-        m_xc.selectPath(ns+" $this//po:ciTy");
+        m_xc.selectPath(ns+" .//po:ciTy");
         assertEquals(0, m_xc.getSelectionCount());
-        m_xc.selectPath(ns+" $this//po:city");
+        m_xc.selectPath(ns+" .//po:city");
         assertEquals(2, m_xc.getSelectionCount());
     }
 
@@ -92,7 +92,7 @@
                 JarUtil.getResourceFromJar(Common.TRANXML_FILE_XMLCURSOR_PO));
         m_xc = m_xo.newCursor();
         String ns="declare namespace po=\"http://xbean.test/xmlcursor/PurchaseOrder\";";
-        m_xc.selectPath(ns+" $this//po:item");
+        m_xc.selectPath(ns+" .//po:item");
         assertEquals(2, m_xc.getSelectionCount());
     }
 



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


Mime
View raw message