Author: ate
Date: Mon Oct 27 01:36:49 2014
New Revision: 1634437
URL: http://svn.apache.org/r1634437
Log:
SCXML-214: Replace JAXP xpath expression evaluation with Commons JXPath
- first 'prove' of using JXPath:
- fixing the broken XPathExampleTest using JXPath evaluation of the _event
Object using xpath navigation
- datamodel data nodes directly accessible through the SCXML Context (besides
also as xpath variables)
Modified:
commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/xpath/XPathExampleTest.java
commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/xpath/example-01.xml
Modified:
commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/xpath/XPathExampleTest.java
URL:
http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/xpath/XPathExampleTest.java?rev=1634437&r1=1634436&r2=1634437&view=diff
==============================================================================
---
commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/xpath/XPathExampleTest.java
(original)
+++
commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/xpath/XPathExampleTest.java
Mon Oct 27 01:36:49 2014
@@ -33,11 +33,7 @@ import org.junit.Test;
*/
public class XPathExampleTest {
- /* TODO: disabled test because the XPathContext cannot yet resolve
$_event/data
- and the old $_eventdata system variable has been removed.
- this probably requires replacing the XPathContext handling with
Commons JXPath or similar solution
@Test
- */
public void testExample01Sample() throws Exception {
SCXMLExecutor exec =
SCXMLTestHelper.getExecutor("org/apache/commons/scxml2/env/xpath/example-01.xml");
Modified:
commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/xpath/example-01.xml
URL:
http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/xpath/example-01.xml?rev=1634437&r1=1634436&r2=1634437&view=diff
==============================================================================
---
commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/xpath/example-01.xml
(original)
+++
commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/xpath/example-01.xml
Mon Oct 27 01:36:49 2014
@@ -35,24 +35,19 @@
</data>
</datamodel>
- <state id="start">
- <onentry>
- <log label="Lion"
- expr="$jungle/animals/lion/name" />
- </onentry>
- <transition cond="$jungle/animals/lion/age = 12"
- target="mid" />
- </state>
+ <state id="start">
+ <onentry>
+ <log label="Lion" expr="$jungle/animals/lion/name" />
+ </onentry>
+ <transition cond="jungle/animals/lion/age = 12" target="mid" />
+ </state>
- <state id="mid">
- <onentry>
- <log label="Total age"
- expr="$jungle/animals/lion/age +
- $jungle/animals/tiger/age" />
- </onentry>
- <transition event="foo" cond="$_event/data/test/status = 'complete'"
- target="end" />
- </state>
+ <state id="mid">
+ <onentry>
+ <log label="Total age" expr="$jungle/animals/lion/age +
jungle/animals/tiger/age" />
+ </onentry>
+ <transition event="foo" cond="$_event/data/test/status = 'complete'"
target="end" />
+ </state>
<final id="end"/>