Author: assaf
Date: Fri Oct 6 15:03:35 2006
New Revision: 453788
URL: http://svn.apache.org/viewvc?view=rev&rev=453788
Log:
Running test cases by compiling 2.0 processes from bpel-scripts
Added:
incubator/ode/trunk/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTest.java
(with props)
Removed:
incubator/ode/trunk/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileSuite.java
Modified:
incubator/ode/trunk/bpel-compiler/pom.xml
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/DefaultActivityGenerator.java
incubator/ode/trunk/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTCase.java
Modified: incubator/ode/trunk/bpel-compiler/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/pom.xml?view=diff&rev=453788&r1=453787&r2=453788
==============================================================================
--- incubator/ode/trunk/bpel-compiler/pom.xml (original)
+++ incubator/ode/trunk/bpel-compiler/pom.xml Fri Oct 6 15:03:35 2006
@@ -67,5 +67,10 @@
<groupId>org.apache.ode</groupId>
<artifactId>ode-utils</artifactId>
</dependency>
+ <dependency>
+ <scope>test</scope>
+ <groupId>org.apache.ode</groupId>
+ <artifactId>ode-bpel-scripts</artifactId>
+ </dependency>
</dependencies>
</project>
Modified:
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/DefaultActivityGenerator.java
URL:
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/DefaultActivityGenerator.java?view=diff&rev=453788&r1=453787&r2=453788
==============================================================================
---
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/DefaultActivityGenerator.java
(original)
+++
incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/DefaultActivityGenerator.java
Fri Oct 6 15:03:35 2006
@@ -42,6 +42,10 @@
}
static void defaultExtensibilityElements(OActivity output, BpelObject src,
OActivity parent) {
+ failureHandlinExtensibilityElement(output, src, parent);
+ }
+
+ static private void failureHandlinExtensibilityElement(OActivity output,
BpelObject src, OActivity parent) {
if (parent != null && parent.failureHandling != null)
output.failureHandling = parent.failureHandling;
if (src != null) {
@@ -81,58 +85,6 @@
textValue = DOMUtils.getTextContent(element);
if (textValue != null)
output.failureHandling.faultOnFailure =
Boolean.valueOf(textValue).booleanValue();
- }
- }
- }
- }
-
- protected void defaultExtensibilityElements(OActivity output, Activity
srcx) {
- handleFailureExtensibility(output, srcx);
- }
-
- private void handleFailureExtensibility(OActivity output, Activity srcx) {
- // Failure handling extensibility element.
- Element failure = (Element)
srcx.getExtensibilityElements().get(FailureHandling.FAILURE_EXT_ELEMENT);
- if (failure != null) {
- output.failureHandling = new FailureHandling();
- String textValue;
- Element element = DOMUtils.findChildByName(failure, new
QName(FailureHandling.EXTENSION_NS_URI, "retryFor"));
- if (element != null) {
- textValue = DOMUtils.getTextContent(element);
- if (textValue != null) {
- try {
- output.failureHandling.retryFor =
Integer.parseInt(textValue);
- if (output.failureHandling.retryFor < 0)
- throw new
CompilationException(__cmsgs.errInvalidRetryForValue(textValue));
- } catch (NumberFormatException except) {
- throw new
CompilationException(__cmsgs.errInvalidRetryForValue(textValue));
- }
- }
- }
- element = DOMUtils.findChildByName(failure, new
QName(FailureHandling.EXTENSION_NS_URI, "retryDelay"));
- if (element != null) {
- textValue = DOMUtils.getTextContent(element);
- if (textValue != null) {
- try {
- output.failureHandling.retryDelay =
Integer.parseInt(textValue);
- if (output.failureHandling.retryDelay < 0)
- throw new
CompilationException(__cmsgs.errInvalidRetryDelayValue(textValue));
- } catch (NumberFormatException except) {
- throw new
CompilationException(__cmsgs.errInvalidRetryDelayValue(textValue));
- }
- }
- }
- element = DOMUtils.findChildByName(failure, new
QName(FailureHandling.EXTENSION_NS_URI, "faultOnFailure"));
- if (element != null) {
- textValue = DOMUtils.getTextContent(element);
- if (textValue != null)
- output.failureHandling.faultOnFailure =
Boolean.valueOf(textValue).booleanValue();
- }
- } else {
- for (OActivity parent : _context.getActivityStack()) {
- if (parent.failureHandling != null) {
- output.failureHandling = parent.failureHandling;
- break;
}
}
}
Modified:
incubator/ode/trunk/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTCase.java
URL:
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTCase.java?view=diff&rev=453788&r1=453787&r2=453788
==============================================================================
---
incubator/ode/trunk/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTCase.java
(original)
+++
incubator/ode/trunk/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTCase.java
Fri Oct 6 15:03:35 2006
@@ -37,35 +37,35 @@
*/
class GoodCompileTCase extends TestCase implements CompileListener {
- private BpelC _compiler;
- private ArrayList<CompilationMessage> _errors = new
ArrayList<CompilationMessage>();
- private URL _bpelURL;
+ private BpelC _compiler;
+ private ArrayList<CompilationMessage> _errors = new
ArrayList<CompilationMessage>();
+ private File _bpel;
- GoodCompileTCase(String bpel) {
- super(bpel);
- _bpelURL = getClass().getResource(bpel);
- }
+ GoodCompileTCase(String bpel) {
+ super(bpel);
+ _bpel = new File("../bpel-scripts/src/main/resources", bpel);
+ }
- protected void setUp() throws Exception {
- super.setUp();
- _compiler = BpelC.newBpelCompiler();
- _compiler.setCompileListener(this);
- _compiler.setOutputStream(new
ByteArrayOutputStream(StreamUtils.DEFAULT_BUFFER_SIZE));
- _errors.clear();
- }
+ protected void setUp() throws Exception {
+ super.setUp();
+ _compiler = BpelC.newBpelCompiler();
+ _compiler.setCompileListener(this);
+ _compiler.setOutputStream(new
ByteArrayOutputStream(StreamUtils.DEFAULT_BUFFER_SIZE));
+ _errors.clear();
+ }
- public void runTest() throws Exception {
- try {
- _compiler.compile(new File(_bpelURL.toURI()));
- } catch (Exception ex) {
- ex.printStackTrace();
- fail("Compilation did not succeed.");
+ public void runTest() throws Exception {
+ try {
+ _compiler.compile(_bpel);
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ fail("Compilation did not succeed.");
+ }
}
- }
- public void onCompilationMessage(CompilationMessage compilationMessage) {
- _errors.add(compilationMessage);
- System.err.println(compilationMessage.toString());
- }
+ public void onCompilationMessage(CompilationMessage compilationMessage) {
+ _errors.add(compilationMessage);
+ System.err.println(compilationMessage.toString());
+ }
}
Added:
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=auto&rev=453788
==============================================================================
---
incubator/ode/trunk/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTest.java
(added)
+++
incubator/ode/trunk/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTest.java
Fri Oct 6 15:03:35 2006
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.compiler_2_0;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * A series of BPEL 2.0 compilation test.
+ */
+public class GoodCompileTest extends TestCase {
+
+ public static Test suite() throws Exception {
+ TestSuite suite = new TestSuite();
+ suite.addTest(new
GoodCompileTCase("/2.0/good/assign/Assign1-2.0.bpel"));
+ suite.addTest(new
GoodCompileTCase("/2.0/good/assign/Assign2-2.0.bpel"));
+ suite.addTest(new
GoodCompileTCase("/2.0/good/assign/Assign3-2.0.bpel"));
+ suite.addTest(new
GoodCompileTCase("/2.0/good/assign/Assign5-2.0.bpel"));
+ suite.addTest(new
GoodCompileTCase("/2.0/good/assign/Assign6-2.0.bpel"));
+ suite.addTest(new
GoodCompileTCase("/2.0/good/assign/Assign7-2.0.bpel"));
+ suite.addTest(new
GoodCompileTCase("/2.0/good/assign/Assign8-2.0.bpel"));
+ suite.addTest(new
GoodCompileTCase("/2.0/good/assign/Assign9-2.0.bpel"));
+ // suite.addTest(new
GoodCompileTCase("/2.0/good/AsyncProcess/AsyncProcess2.bpel"));
+ suite.addTest(new
GoodCompileTCase("/2.0/good/compensation/comp1-2.0.bpel"));
+ suite.addTest(new
GoodCompileTCase("/2.0/good/compensation/comp2-2.0.bpel"));
+ suite.addTest(new GoodCompileTCase("/2.0/good/flow/flow2-2.0.bpel"));
+ suite.addTest(new GoodCompileTCase("/2.0/good/flow/flow3-2.0.bpel"));
+ suite.addTest(new GoodCompileTCase("/2.0/good/flow/flow4-2.0.bpel"));
+ suite.addTest(new GoodCompileTCase("/2.0/good/flow/flow5-2.0.bpel"));
+ suite.addTest(new GoodCompileTCase("/2.0/good/flow/flow6-2.0.bpel"));
+ suite.addTest(new GoodCompileTCase("/2.0/good/flow/flow7-2.0.bpel"));
+ suite.addTest(new GoodCompileTCase("/2.0/good/if/If1-2.0.bpel"));
+ suite.addTest(new GoodCompileTCase("/2.0/good/if/If2-2.0.bpel"));
+ suite.addTest(new GoodCompileTCase("/2.0/good/if/If3-2.0.bpel"));
+ suite.addTest(new GoodCompileTCase("/2.0/good/pick/Pick3-2.0.bpel"));
+ suite.addTest(new GoodCompileTCase("/2.0/good/pick/Pick4-2.0.bpel"));
+ suite.addTest(new GoodCompileTCase("/2.0/good/pick/Pick5-2.0.bpel"));
+ suite.addTest(new GoodCompileTCase("/2.0/good/pick/Pick6-2.0.bpel"));
+ suite.addTest(new
GoodCompileTCase("/2.0/good/rethrow/Rethrow1-2.0.bpel"));
+ suite.addTest(new
GoodCompileTCase("/2.0/good/rethrow/Rethrow2-2.0.bpel"));
+ suite.addTest(new GoodCompileTCase("/2.0/good/throw/Throw1-2.0.bpel"));
+ suite.addTest(new GoodCompileTCase("/2.0/good/throw/Throw2-2.0.bpel"));
+ suite.addTest(new GoodCompileTCase("/2.0/good/throw/Throw3-2.0.bpel"));
+ suite.addTest(new GoodCompileTCase("/2.0/good/throw/Throw4-2.0.bpel"));
+ suite.addTest(new GoodCompileTCase("/2.0/good/throw/Throw5-2.0.bpel"));
+ suite.addTest(new GoodCompileTCase("/2.0/good/throw/Throw6-2.0.bpel"));
+ suite.addTest(new GoodCompileTCase("/2.0/good/throw/Throw7-2.0.bpel"));
+ suite.addTest(new GoodCompileTCase("/2.0/good/wait/Wait1-2.0.bpel"));
+ suite.addTest(new GoodCompileTCase("/2.0/good/wait/Wait2-2.0.bpel"));
+ suite.addTest(new GoodCompileTCase("/2.0/good/while/While1-2.0.bpel"));
+ suite.addTest(new
GoodCompileTCase("/2.0/good/xpath10-func/GetVariableData1-2.0.bpel"));
+ suite.addTest(new
GoodCompileTCase("/2.0/good/xpath10-func/GetVariableData2-2.0.bpel"));
+ suite.addTest(new
GoodCompileTCase("/2.0/good/xpath10-func/GetVariableData3-2.0.bpel"));
+ suite.addTest(new
GoodCompileTCase("/2.0/good/xpath10-func/GetVariableData4-2.0.bpel"));
+ suite.addTest(new
GoodCompileTCase("/2.0/good/xpath10-func/GetVariableProperty1-2.0.bpel"));
+ suite.addTest(new
GoodCompileTCase("/2.0/good/xpath20-func/GetVariableData1-xp2.0.bpel"));
+ suite.addTest(new
GoodCompileTCase("/2.0/good/xpath20-func/GetVariableData2-xp2.0.bpel"));
+ 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;
+ }
+
+}
Propchange:
incubator/ode/trunk/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/ode/trunk/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTest.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange:
incubator/ode/trunk/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain