You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by ms...@apache.org on 2007/08/07 01:42:16 UTC

svn commit: r563339 - in /ode/branches/bart/bpel-compiler/src: main/java/org/apache/ode/bpel/compiler/ main/java/org/apache/ode/bpel/compiler/bom/ main/java/org/apache/ode/bpel/elang/xpath20/compiler/ test/java/org/apache/ode/bpel/compiler/ test/java/o...

Author: mszefler
Date: Mon Aug  6 16:42:14 2007
New Revision: 563339

URL: http://svn.apache.org/viewvc?view=rev&rev=563339
Log:
Catch up to trunk@563315

Modified:
    ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java
    ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java
    ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CommonCompilationMessages.java
    ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLRegistry.java
    ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WsdlFinderXMLEntityResolver.java
    ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObject.java
    ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ForEachActivity.java
    ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/OnAlarm.java
    ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Scope.java
    ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/WaitActivity.java
    ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/Constants.java
    ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/JaxpFunctionResolver.java
    ode/branches/bart/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/WSDLRegistryTest.java
    ode/branches/bart/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTCase.java

Modified: ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java
URL: http://svn.apache.org/viewvc/ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java?view=diff&rev=563339&r1=563338&r2=563339
==============================================================================
--- ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java (original)
+++ ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java Mon Aug  6 16:42:14 2007
@@ -166,7 +166,7 @@
                 vref.variable = _context.resolveVariable(vv.getVariable());
                 if (vv.getPart() != null) {
                     vref.part = _context.resolvePart(vref.variable, vv.getPart());
-                    if (vv.getLocation() != null)
+                    if (vv.getLocation() != null && vv.getLocation().getExpression() != null)
                         vref.location = _context.compileExpr(vv.getLocation());
                 }
                 // TODO: check for irrelevant properties.
@@ -227,7 +227,7 @@
                 vref.variable = _context.resolveVariable(vv.getVariable());
                 if (to.getAsVariableVal().getPart() != null) {
                     vref.part = _context.resolvePart(vref.variable, vv.getPart());
-                    if (vv.getLocation() != null)
+                    if (vv.getLocation() != null && vv.getLocation().getExpression() != null)
                         vref.location = _context.compileExpr(vv.getLocation());
                 }
                 // TODO: check for irrelevant properties.

Modified: ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java
URL: http://svn.apache.org/viewvc/ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java?view=diff&rev=563339&r1=563338&r2=563339
==============================================================================
--- ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java (original)
+++ ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java Mon Aug  6 16:42:14 2007
@@ -352,7 +352,7 @@
             }
 
             List<OMessageVarType.Part> parts = new ArrayList<OMessageVarType.Part>();
-            CollectionsX.transform(parts, ((Map<String, Part>) msg.getParts()).values(),
+            CollectionsX.transform(parts, ((List<Part>) msg.getOrderedParts(null)),
                     new UnaryFunction<Part, OMessageVarType.Part>() {
                         public OMessageVarType.Part apply(Part part) {
                             OVarType partType;
@@ -685,14 +685,19 @@
         assert _structureStack.size() == 0;
 
         boolean hasErrors = false;
+        StringBuffer sb = new StringBuffer();
         for (CompilationMessage msg : _errors) {
-            if (msg.severity >= CompilationMessage.ERROR)
+            if (msg.severity >= CompilationMessage.ERROR) {
                 hasErrors = true;
+                sb.append('\t');
+                sb.append(msg.toErrorString());
+                sb.append('\n');
+            }
         }
 
-        if (hasErrors)
-            throw new CompilationException(__cmsgs.errCompilationErrors(_errors.size()));
-
+        if (hasErrors) {
+            throw new CompilationException(__cmsgs.errCompilationErrors(_errors.size(), sb.toString()));
+        }
         return _oprocess;
     }
 

Modified: ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CommonCompilationMessages.java
URL: http://svn.apache.org/viewvc/ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CommonCompilationMessages.java?view=diff&rev=563339&r1=563338&r2=563339
==============================================================================
--- ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CommonCompilationMessages.java (original)
+++ ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CommonCompilationMessages.java Mon Aug  6 16:42:14 2007
@@ -40,10 +40,10 @@
             .formatCompilationMessage("Error parsing BPEL process: the BPEL is either malformed or is invalid.");
     }
 
-    /** Compilation completed with {0} error(s). */
-    public CompilationMessage errCompilationErrors(int errorCount) {
-        return this.formatCompilationMessage("Compilation completed with {0} error(s).",
-            errorCount);
+    /** Compilation completed with {0} error(s): {1} */
+    public CompilationMessage errCompilationErrors(int errorCount, String prettyErrors) {
+        return this.formatCompilationMessage("Compilation completed with {0} error(s):\n{1}",
+            errorCount, prettyErrors);
     }
 
     /** Attempt to reference undeclared link "{0}". */

Modified: ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLRegistry.java
URL: http://svn.apache.org/viewvc/ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLRegistry.java?view=diff&rev=563339&r1=563338&r2=563339
==============================================================================
--- ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLRegistry.java (original)
+++ ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLRegistry.java Mon Aug  6 16:42:14 2007
@@ -201,7 +201,7 @@
                     String schema = ((XMLSchemaType)ee).getXMLSchema();
                     Map<URI, byte[]> capture = null;
 
-                    WsdlFinderXMLEntityResolver resolver = new WsdlFinderXMLEntityResolver(rf, defuri, _internalSchemas);
+                    WsdlFinderXMLEntityResolver resolver = new WsdlFinderXMLEntityResolver(rf, defuri, _internalSchemas, false);
                     try {
                         capture = XSUtils.captureSchema(defuri, schema, resolver);
                         _schemas.putAll(capture);

Modified: ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WsdlFinderXMLEntityResolver.java
URL: http://svn.apache.org/viewvc/ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WsdlFinderXMLEntityResolver.java?view=diff&rev=563339&r1=563338&r2=563339
==============================================================================
--- ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WsdlFinderXMLEntityResolver.java (original)
+++ ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WsdlFinderXMLEntityResolver.java Mon Aug  6 16:42:14 2007
@@ -18,21 +18,20 @@
  */
 package org.apache.ode.bpel.compiler;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.xerces.xni.XMLResourceIdentifier;
-import org.apache.xerces.xni.XNIException;
-import org.apache.xerces.xni.parser.XMLEntityResolver;
-import org.apache.xerces.xni.parser.XMLInputSource;
-
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URI;
-import java.net.URISyntaxException;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.xerces.xni.XMLResourceIdentifier;
+import org.apache.xerces.xni.XNIException;
+import org.apache.xerces.xni.parser.XMLEntityResolver;
+import org.apache.xerces.xni.parser.XMLInputSource;
+
 /**
  * Xerces {@link XMLEntityResolver} implementation that defers to  our own
  * {@link ResourceFinder} interface for loading resources. This class is
@@ -65,10 +64,12 @@
      *                typically this is the system URI of the WSDL containing an 
      *                embedded schema
      */
-    public WsdlFinderXMLEntityResolver(ResourceFinder finder, URI baseURI, Map<URI, String> internalSchemas) {
+    public WsdlFinderXMLEntityResolver(ResourceFinder finder, URI baseURI, Map<URI, String> internalSchemas,
+            boolean failIfNotFound) {
         _wsdlFinder = finder;
         _baseURI = baseURI;
         _internalSchemas = internalSchemas;
+        _failIfNotFound = failIfNotFound;
     }
 
     public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
@@ -80,23 +81,15 @@
         XMLInputSource src = new XMLInputSource(resourceIdentifier);
         URI location;
 
-        try {
-            // Note: if the systemId is not specified then what we have is 
-            // an import without a schemaLocation. In this case we use the
-            // namespace to stand in for the location. If we have an 
-            // expandedsystemId, then we must use that, since schemas that
-            // are imported by other schemas will have their relative 
-            // locations encoded here. If we only have a literal system id,
-            // then it is going to be realative to our baseURI. 
-            if (resourceIdentifier.getLiteralSystemId() == null)
-                location = new URI(resourceIdentifier.getNamespace());
-            else if (resourceIdentifier.getExpandedSystemId() != null) 
-                location = _baseURI.resolve(resourceIdentifier.getExpandedSystemId());
-            else
-                location = _baseURI.resolve(resourceIdentifier.getLiteralSystemId());
-        } catch (URISyntaxException e) {
-            __log.debug("resolveEntity: URI syntax error", e);
-            throw new IOException(e.getMessage());
+        if (resourceIdentifier.getLiteralSystemId() == null) {
+            // import without schemaLocation
+            if (__log.isDebugEnabled()) __log.debug("resolveEntity: no schema location for "+resourceIdentifier.getNamespace());
+            return null;
+        } else if (resourceIdentifier.getExpandedSystemId() != null) { 
+            // schema imported by other schema
+            location = _baseURI.resolve(resourceIdentifier.getExpandedSystemId());
+        } else {
+            location = _baseURI.resolve(resourceIdentifier.getLiteralSystemId());
         }
 
         if (__log.isDebugEnabled())
@@ -120,17 +113,15 @@
             __log.debug("resolveEntity: IOException opening " + location,ioex);
 
             if (_failIfNotFound) {
-                __log.debug("resolveEntity: failIfNotFound set, rethrowing...");
+                __log.debug("resolveEntity: failIfNotFound is true, rethrowing...");
                 throw ioex;
             }
-
-            __log.debug("resolveEntity: failIfNotFound NOT set, returning NULL");
+            __log.debug("resolveEntity: failIfNotFound is false, returning null");
             return null;
         } catch (Exception ex) {
             __log.debug("resolveEntity: unexpected error: " + location);
             throw new IOException("Unexpected error loading resource: " + location);
         }
-
         return src;
     }
 

Modified: ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObject.java
URL: http://svn.apache.org/viewvc/ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObject.java?view=diff&rev=563339&r1=563338&r2=563339
==============================================================================
--- ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObject.java (original)
+++ ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObject.java Mon Aug  6 16:42:14 2007
@@ -130,6 +130,19 @@
         return e.getElement();
     }
 
+    public Element getFirstExtensibilityElementElement() {
+    	Element child = null;
+    	NodeList nl = getElement().getChildNodes();
+        for (int i = 0; i < nl.getLength(); ++i) {
+            Node node = nl.item(i);
+            if (node.getNodeType() == Node.ELEMENT_NODE && 
+            		!getType().getNamespaceURI().equals(node.getNamespaceURI())) {
+                child = (Element)node;
+                break;
+            }
+        }
+        return child;
+    }
     
     /**
      * Is this a BPEL 1.1 object?
@@ -180,6 +193,10 @@
         });
     }
 
+    protected QName rewriteTargetNS(QName target) {
+    	return new QName(getType().getNamespaceURI(), target.getLocalPart());
+    }
+    
     protected List<BpelObject> getChildren() {
         if (_children == null) {
             _children = new ArrayList<BpelObject>();

Modified: ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ForEachActivity.java
URL: http://svn.apache.org/viewvc/ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ForEachActivity.java?view=diff&rev=563339&r1=563338&r2=563339
==============================================================================
--- ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ForEachActivity.java (original)
+++ ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/ForEachActivity.java Mon Aug  6 16:42:14 2007
@@ -19,6 +19,8 @@
 
 package org.apache.ode.bpel.compiler.bom;
 
+import javax.xml.namespace.QName;
+
 import org.w3c.dom.Element;
 
 /**
@@ -56,7 +58,7 @@
      * @return start iteration counter
      */
     public Expression getStartCounter() {
-        return (Expression) getFirstChild(Bpel20QNames.START_COUNTER_VALUE);
+        return (Expression) getFirstChild(rewriteTargetNS(Bpel20QNames.START_COUNTER_VALUE));
     }
 
     /**
@@ -66,7 +68,7 @@
      * @return final counter expression
      */
     public Expression getFinalCounter() {
-        return (Expression) getFirstChild(Bpel20QNames.FINAL_COUNTER_VALUE);
+        return (Expression) getFirstChild(rewriteTargetNS(Bpel20QNames.FINAL_COUNTER_VALUE));
     }
 
     /**

Modified: ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/OnAlarm.java
URL: http://svn.apache.org/viewvc/ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/OnAlarm.java?view=diff&rev=563339&r1=563338&r2=563339
==============================================================================
--- ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/OnAlarm.java (original)
+++ ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/OnAlarm.java Mon Aug  6 16:42:14 2007
@@ -18,6 +18,8 @@
  */
 package org.apache.ode.bpel.compiler.bom;
 
+import javax.xml.namespace.QName;
+
 import org.w3c.dom.Element;
 
 /**
@@ -45,7 +47,7 @@
    * @return duration of the alarm
    */
   public Expression getFor() {
-      return (Expression) getFirstChild(Bpel20QNames.FOR);
+      return (Expression) getFirstChild(rewriteTargetNS(Bpel20QNames.FOR));
   }
 
 
@@ -55,7 +57,7 @@
    * @return deadline when alarm goes out of effect
    */
   public Expression getUntil() {
-      return (Expression) getFirstChild(Bpel20QNames.UNTIL);
+      return (Expression) getFirstChild(rewriteTargetNS(Bpel20QNames.UNTIL));
       
   }
   
@@ -64,7 +66,7 @@
    * @return the duration expression that specifies the frequency
    */
   public Expression getRepeatEvery() {
-      return (Expression) getFirstChild(Bpel20QNames.REPEAT_EVERY);
+      return (Expression) getFirstChild(rewriteTargetNS(Bpel20QNames.REPEAT_EVERY));
   }
   
   

Modified: ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Scope.java
URL: http://svn.apache.org/viewvc/ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Scope.java?view=diff&rev=563339&r1=563338&r2=563339
==============================================================================
--- ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Scope.java (original)
+++ ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Scope.java Mon Aug  6 16:42:14 2007
@@ -21,6 +21,8 @@
 import java.util.Collections;
 import java.util.List;
 
+import javax.xml.namespace.QName;
+
 import org.apache.ode.utils.stl.CollectionsX;
 import org.apache.ode.utils.stl.MemberOfFunction;
 import org.w3c.dom.Element;
@@ -129,7 +131,7 @@
      * @return the <code>OnAlarmEventHandler</code>s
      */
     public List<OnAlarm> getAlarms() {
-        BpelObject eventHandlers = getFirstChild(Bpel20QNames.EVENTHANDLERS);
+        BpelObject eventHandlers = getFirstChild(rewriteTargetNS(Bpel20QNames.EVENTHANDLERS));
         if (eventHandlers == null)
             return Collections.emptyList();
         return eventHandlers.getChildren(OnAlarm.class);
@@ -138,7 +140,7 @@
     /**
      */
     public List<OnEvent> getEvents() {
-        BpelObject eventHandlers = getFirstChild(Bpel20QNames.EVENTHANDLERS);
+        BpelObject eventHandlers = getFirstChild(rewriteTargetNS(Bpel20QNames.EVENTHANDLERS));
         if (eventHandlers == null)
             return Collections.emptyList();
 

Modified: ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/WaitActivity.java
URL: http://svn.apache.org/viewvc/ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/WaitActivity.java?view=diff&rev=563339&r1=563338&r2=563339
==============================================================================
--- ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/WaitActivity.java (original)
+++ ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/WaitActivity.java Mon Aug  6 16:42:14 2007
@@ -35,7 +35,7 @@
    * @return Returns the for.
    */
   public Expression getFor() {
-      return  (Expression) getFirstChild(Bpel20QNames.FOR);
+	  return  (Expression) getFirstChild(rewriteTargetNS(Bpel20QNames.FOR));
   }
 
   /**
@@ -44,7 +44,6 @@
    * @return the "until" expression
    */
   public Expression getUntil() {
-      return  (Expression) getFirstChild(Bpel20QNames.UNTIL);
-      
+	  return  (Expression) getFirstChild(rewriteTargetNS(Bpel20QNames.UNTIL));
   }
 }

Modified: ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/Constants.java
URL: http://svn.apache.org/viewvc/ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/Constants.java?view=diff&rev=563339&r1=563338&r2=563339
==============================================================================
--- ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/Constants.java (original)
+++ ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/Constants.java Mon Aug  6 16:42:14 2007
@@ -24,31 +24,36 @@
  * XPath-4-BPEL related constants.
  */
 public class Constants {
-  /**
-   * Extension function bpws:getVariableData('variableName', 'partName'?,
-   * 'locationPath'?)
-   */
-  public static final String EXT_FUNCTION_GETVARIABLEDATA = "getVariableData";
+    /**
+     * Extension function bpws:getVariableData('variableName', 'partName'?,
+     * 'locationPath'?)
+     */
+    public static final String EXT_FUNCTION_GETVARIABLEDATA = "getVariableData";
 
-  /**
-   * Extension function
-   * bpws:getVariableProperty('variableName','propertyName')
-   */
-  public static final String EXT_FUNCTION_GETVARIABLEPROPRTY = "getVariableProperty";
+    /**
+     * Extension function
+     * bpws:getVariableProperty('variableName','propertyName')
+     */
+    public static final String EXT_FUNCTION_GETVARIABLEPROPRTY = "getVariableProperty";
 
-  /**
-   * Extension function bpws:getLinkStatus('getLinkName')
-   */
-  public static final String EXT_FUNCTION_GETLINKSTATUS = "getLinkStatus";
+    /**
+     * Extension function bpws:getLinkStatus('getLinkName')
+     */
+    public static final String EXT_FUNCTION_GETLINKSTATUS = "getLinkStatus";
 
-  /**
-   * Extension function bpws:getLinkStatus('getLinkName')
-   */
-  public static final String EXT_FUNCTION_DOXSLTRANSFORM = "doXslTransform";
+    /**
+     * Extension function bpws:getLinkStatus('getLinkName')
+     */
+    public static final String EXT_FUNCTION_DOXSLTRANSFORM = "doXslTransform";
 
-  public static boolean isBpelNamespace(String uri){
-    return Namespaces.WS_BPEL_20_NS.equals(uri) || Namespaces.WSBPEL2_0_FINAL_EXEC.equals(uri)
-             || Namespaces.BPEL11_NS.equals(uri);
-  }
+    /**
+     * Non standard extension function ode:splitToElements(sourceText, 'separator' 'targetLocalName', 'targetNS'?)
+     */
+    public static final String NON_STDRD_FUNCTION_SPLITTOELEMENTS = "splitToElements";
+
+    public static boolean isBpelNamespace(String uri){
+        return Namespaces.WS_BPEL_20_NS.equals(uri) || Namespaces.WSBPEL2_0_FINAL_EXEC.equals(uri)
+                || Namespaces.BPEL11_NS.equals(uri);
+    }
 
 }

Modified: ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/JaxpFunctionResolver.java
URL: http://svn.apache.org/viewvc/ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/JaxpFunctionResolver.java?view=diff&rev=563339&r1=563338&r2=563339
==============================================================================
--- ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/JaxpFunctionResolver.java (original)
+++ ode/branches/bart/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/JaxpFunctionResolver.java Mon Aug  6 16:42:14 2007
@@ -35,6 +35,7 @@
 import org.apache.ode.bpel.o.OScope;
 import org.apache.ode.bpel.o.OXslSheet;
 import org.apache.ode.utils.NSContext;
+import org.apache.ode.utils.Namespaces;
 import org.apache.ode.utils.msg.MessageBundle;
 import org.apache.ode.utils.xsl.XslTransformHandler;
 
@@ -71,6 +72,11 @@
             } else {
                 throw new WrappedResolverException(__msgs.errUnknownBpelFunction(localName));
             }
+        } else if (functionName.getNamespaceURI().equals(Namespaces.ODE_EXTENSION_NS)) {
+            String localName = functionName.getLocalPart();
+            if (Constants.NON_STDRD_FUNCTION_SPLITTOELEMENTS.equals(localName)) {
+                return new SplitToElements();
+            }
         }
 
         return null;
@@ -121,6 +127,19 @@
             }
 
             _out.xslSheets.put(xslSheet.uri, xslSheet);
+            return "";
+        }
+    }
+
+    /**
+     * Compile time checking for the non standard ode:splitToElements function.
+     */
+    public class SplitToElements implements XPathFunction {
+        public Object evaluate(List params) throws XPathFunctionException {
+            if (params.size() < 3 || params.size() > 4) {
+                throw new CompilationException(
+                        __msgs.errInvalidNumberOfArguments(Constants.NON_STDRD_FUNCTION_SPLITTOELEMENTS));
+            }
             return "";
         }
     }

Modified: ode/branches/bart/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/WSDLRegistryTest.java
URL: http://svn.apache.org/viewvc/ode/branches/bart/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/WSDLRegistryTest.java?view=diff&rev=563339&r1=563338&r2=563339
==============================================================================
--- ode/branches/bart/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/WSDLRegistryTest.java (original)
+++ ode/branches/bart/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/WSDLRegistryTest.java Mon Aug  6 16:42:14 2007
@@ -68,7 +68,9 @@
     // load & register wsdl
     WSDLFactory4BPEL factory = (WSDLFactory4BPEL)WSDLFactoryBPEL11.newInstance();
     WSDLReader reader = factory.newWSDLReader();
-    ResourceFinder finder = new DefaultResourceFinder(new File(wsd.getPath()).getParentFile());
+    
+    //ResourceFinder finder = new DefaultResourceFinder(new File(wsd.getPath()).getParentFile());
+    ResourceFinder finder = new DefaultResourceFinder(new File(wsd.toURI().getPath()).getParentFile());
     WSDLLocatorImpl loc = new WSDLLocatorImpl(finder,wsd.toURI());
     Definition4BPEL wsdl = (Definition4BPEL) reader.readWSDL(loc);
     _registry.addDefinition(wsdl, finder, wsd.toURI());

Modified: ode/branches/bart/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTCase.java
URL: http://svn.apache.org/viewvc/ode/branches/bart/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTCase.java?view=diff&rev=563339&r1=563338&r2=563339
==============================================================================
--- ode/branches/bart/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTCase.java (original)
+++ ode/branches/bart/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTCase.java Mon Aug  6 16:42:14 2007
@@ -42,11 +42,12 @@
     protected final Log __log = LogFactory.getLog(getClass());
     private BpelC _compiler;
     private ArrayList<CompilationMessage> _errors = new ArrayList<CompilationMessage>();
-    private File  _bpel;
+    private String _bpel;
+
 
     GoodCompileTCase(String bpel) {
         super(bpel);
-        _bpel = new File(getClass().getResource(bpel).getPath());
+        _bpel = bpel;
     }
 
     protected void setUp() throws Exception {
@@ -59,7 +60,8 @@
 
     public void runTest() throws Exception {
         try {
-            _compiler.compile(_bpel);
+        	File bpelFile = new File(getClass().getResource(_bpel).toURI().getPath());
+        	_compiler.compile(bpelFile);
         } catch (Exception ex) {
             ex.printStackTrace();
             fail("Compilation did not succeed.");