Author: mszefler
Date: Wed Apr  4 12:42:01 2007
New Revision: 525592

URL: http://svn.apache.org/viewvc?view=rev&rev=525592
Log:
test case fixes

Modified:
    
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java
    
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilerContext.java
    
incubator/ode/trunk/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTest.java

Modified: 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java?view=diff&rev=525592&r1=525591&r2=525592
==============================================================================
--- 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java
 (original)
+++ 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java
 Wed Apr  4 12:42:01 2007
@@ -35,6 +35,7 @@
 import org.apache.ode.bpel.compiler.bom.Correlation;
 import org.apache.ode.bpel.compiler.bom.CorrelationSet;
 import org.apache.ode.bpel.compiler.bom.Expression;
+import org.apache.ode.bpel.compiler.bom.Expression11;
 import org.apache.ode.bpel.compiler.bom.FaultHandler;
 import org.apache.ode.bpel.compiler.bom.Import;
 import org.apache.ode.bpel.compiler.bom.LinkSource;
@@ -492,8 +493,9 @@
     }
 
     public OExpression compileExpr(String expr, NSContext nc) {
-        throw new UnsupportedOperationException("todo");
-        // TODO fix this for BPEL11
+        // Does this really work?
+        BpelObject cur = _structureStack.topSource();
+        return compileExpr(new 
Expression11(cur.getElement(),cur.getElement().getOwnerDocument().createTextNode(expr)),false,false);
     }
 
     private OExpression compileExpr(Expression expression, boolean 
isJoinCondition, boolean isLValue) {
@@ -988,7 +990,7 @@
 
     public void compile(OActivity context, BpelObject source, Runnable run) {
         DefaultActivityGenerator.defaultExtensibilityElements(context, source);
-        _structureStack.push(context);
+        _structureStack.push(context,source);
         try {
             run.run();
         } finally {
@@ -1571,9 +1573,15 @@
 
     private static class StructureStack {
         private Stack<OActivity> _stack = new Stack<OActivity>();
-
-        public void push(OActivity act) {
+        private Map<OActivity,BpelObject> _srcMap = new 
HashMap<OActivity,BpelObject>();
+        
+        public void push(OActivity act, BpelObject src) {
             _stack.push(act);
+            _srcMap.put(act,src);
+        }
+
+        public BpelObject topSource() {
+            return _srcMap.get(topActivity());
         }
 
         public OScope topScope() {

Modified: 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilerContext.java
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilerContext.java?view=diff&rev=525592&r1=525591&r2=525592
==============================================================================
--- 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilerContext.java
 (original)
+++ 
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilerContext.java
 Wed Apr  4 12:42:01 2007
@@ -41,7 +41,9 @@
 
 
 /**
- * Interface providing access to the compiler .
+ * Interface providing access to the compiler.
+ * 
+ * @author Maciej Szefler ( m s z e f l e r @ g m a i l . c o m )
  */
 public interface CompilerContext {
 
@@ -56,7 +58,15 @@
     OLValueExpression compileLValueExpr(Expression expr)
             throws CompilationException;
 
-    OExpression compileExpr(String locationstr, NSContext nsContext);
+    /**
+     * BPEL 1.1 legacy. 
+     * @param locationstr
+     * @param nsContext
+     * @return
+     * @throws CompilationException
+     */
+    OExpression compileExpr(String locationstr, NSContext nsContext)
+            throws CompilationException;
 
     OXslSheet compileXslt(String docStrUri)
             throws CompilationException;

Modified: 
incubator/ode/trunk/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTest.java
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTest.java?view=diff&rev=525592&r1=525591&r2=525592
==============================================================================
--- 
incubator/ode/trunk/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTest.java
 (original)
+++ 
incubator/ode/trunk/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTest.java
 Wed Apr  4 12:42:01 2007
@@ -74,6 +74,7 @@
         suite.addTest(new 
GoodCompileTCase("/2.0/good/xpath20-func/GetVariableData3-xp2.0.bpel"));
         suite.addTest(new 
GoodCompileTCase("/2.0/good/xpath20-func/GetVariableData4-xp2.0.bpel"));
         suite.addTest(new 
GoodCompileTCase("/2.0/good/xpath20-func/GetVariableProperty1-xp2.0.bpel"));
+        
         return suite;
     }
 


Reply via email to