You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by rr...@apache.org on 2010/02/10 23:03:12 UTC
svn commit: r908666 - in /ode/branches/APACHE_ODE_1.X/bpel-compiler/src:
main/java/org/apache/ode/bpel/elang/xpath10/compiler/
test/java/org/apache/ode/bpel/compiler/
Author: rr
Date: Wed Feb 10 22:03:07 2010
New Revision: 908666
URL: http://svn.apache.org/viewvc?rev=908666&view=rev
Log:
ODE-749: StaticCheckSuite doesn't run with the normal tests (Thanks to Antoine Toulme)
Modified:
ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/JaxenBpelHandler.java
ode/branches/APACHE_ODE_1.X/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/StaticCheckSuite.java
ode/branches/APACHE_ODE_1.X/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/StaticCheckTCase.java
Modified: ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/JaxenBpelHandler.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/JaxenBpelHandler.java?rev=908666&r1=908665&r2=908666&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/JaxenBpelHandler.java (original)
+++ ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/JaxenBpelHandler.java Wed Feb 10 22:03:07 2010
@@ -118,22 +118,18 @@
throw new CompilationException(
__msgs.errUndeclaredFunctionPrefix(prefix,c.getFunctionName()));
} else if (isBpelNamespace(ns)) {
- try {
if (Constants.EXT_FUNCTION_GETVARIABLEDATA.equals(c.getFunctionName())) {
- compileGetVariableData(c);
+ compileGetVariableData(c);
} else if (Constants.EXT_FUNCTION_GETVARIABLEPROPRTY.equals(c
.getFunctionName())) {
- compileGetVariableProperty(c);
+ compileGetVariableProperty(c);
} else if (Constants.EXT_FUNCTION_GETLINKSTATUS.equals(c.getFunctionName())) {
- compileGetLinkStatus(c);
+ compileGetLinkStatus(c);
} else if (Constants.EXT_FUNCTION_DOXSLTRANSFORM.equals(c.getFunctionName())) {
- compileDoXslTransform(c);
+ compileDoXslTransform(c);
} else {
- throw new CompilationException(__msgs.errUnknownBpelFunction(c.getFunctionName()));
+ throw new CompilationException(__msgs.errUnknownBpelFunction(c.getFunctionName()));
}
- } catch (CompilationException ce) {
- throw new RuntimeException(ce);
- }
}
}
Modified: ode/branches/APACHE_ODE_1.X/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/StaticCheckSuite.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/StaticCheckSuite.java?rev=908666&r1=908665&r2=908666&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/StaticCheckSuite.java (original)
+++ ode/branches/APACHE_ODE_1.X/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/StaticCheckSuite.java Wed Feb 10 22:03:07 2010
@@ -19,29 +19,34 @@
package org.apache.ode.bpel.compiler;
import junit.framework.Test;
+import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* JUnit {@link TestSuite} for running a series of {@link StaticCheckTCase}s.
*/
-public class StaticCheckSuite extends TestSuite {
+public class StaticCheckSuite extends TestCase {
- public static Test suite() throws Exception {
- TestSuite suite = new StaticCheckSuite();
- suite.addTest(new StaticCheckTCase("NoRootActivity"));
- suite.addTest(new StaticCheckTCase("PortTypeMismatch"));
- suite.addTest(new StaticCheckTCase("UndeclaredPropertyAlias"));
- suite.addTest(new StaticCheckTCase("UnknownBpelFunction"));
- suite.addTest(new StaticCheckTCase("UndeclaredVariable"));
- suite.addTest(new StaticCheckTCase("DuplicateLinkTarget"));
- suite.addTest(new StaticCheckTCase("DuplicateLinkSource"));
- suite.addTest(new StaticCheckTCase("DuplicateLinkDecl"));
- suite.addTest(new StaticCheckTCase("LinkMissingSourceActivity"));
- suite.addTest(new StaticCheckTCase("LinkMissingTargetActivity"));
- suite.addTest(new StaticCheckTCase("DuplicateVariableDecl"));
- // We simply can't test the next one without using the BOM; both the parser
- // and schema validation would rule it out.
- //suite.addTest(new StaticCheckTest("CompensateNAtoContext"));
- return suite;
- }
+ /**
+ * @return a test suite of tests that show compilation failures.
+ * @throws Exception
+ */
+ public static Test suite() throws Exception {
+ TestSuite suite = new TestSuite();
+ suite.addTest(new StaticCheckTCase("NoRootActivity"));
+ suite.addTest(new StaticCheckTCase("PortTypeMismatch"));
+ suite.addTest(new StaticCheckTCase("UndeclaredPropertyAlias"));
+ suite.addTest(new StaticCheckTCase("UnknownBpelFunction"));
+ suite.addTest(new StaticCheckTCase("UndeclaredVariable"));
+ suite.addTest(new StaticCheckTCase("DuplicateLinkTarget"));
+ suite.addTest(new StaticCheckTCase("DuplicateLinkSource"));
+ suite.addTest(new StaticCheckTCase("DuplicateLinkDecl"));
+ suite.addTest(new StaticCheckTCase("LinkMissingSourceActivity"));
+ suite.addTest(new StaticCheckTCase("LinkMissingTargetActivity"));
+ suite.addTest(new StaticCheckTCase("DuplicateVariableDecl"));
+ // We simply can't test the next one without using the BOM; both the parser
+ // and schema validation would rule it out.
+ //suite.addTest(new StaticCheckTest("CompensateNAtoContext"));
+ return suite;
+ }
}
Modified: ode/branches/APACHE_ODE_1.X/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/StaticCheckTCase.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/StaticCheckTCase.java?rev=908666&r1=908665&r2=908666&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/StaticCheckTCase.java (original)
+++ ode/branches/APACHE_ODE_1.X/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/StaticCheckTCase.java Wed Feb 10 22:03:07 2010
@@ -28,11 +28,14 @@
import java.util.List;
import java.util.Set;
+import javax.xml.transform.TransformerFactory;
+
import junit.framework.TestCase;
import org.apache.ode.bpel.compiler.api.CompilationException;
import org.apache.ode.bpel.compiler.api.CompilationMessage;
import org.apache.ode.bpel.compiler.api.CompileListener;
+import org.apache.ode.utils.xsl.XslTransformHandler;
/**
@@ -63,6 +66,8 @@
protected void setUp() throws Exception {
super.setUp();
+ TransformerFactory trsf = new net.sf.saxon.TransformerFactoryImpl();
+ XslTransformHandler.getInstance().setTransformerFactory(trsf);
_compiler = BpelC.newBpelCompiler();
_compiler.setCompileListener(this);
_errors.clear();
@@ -86,7 +91,7 @@
public void runTest() throws Exception {
try {
- _compiler.compile(new File(_bpelURL.toURI()), 0);
+ _compiler.compile(new File(_bpelURL.toURI()), 1L);
fail("Expected compilation exception.");
} catch (CompilationException ce) {
_errors.add(ce.getCompilationMessage());