Author: rahul
Date: Mon Jan 26 22:09:23 2009
New Revision: 737891
URL: http://svn.apache.org/viewvc?rev=737891&view=rev
Log:
Add a test case demonstrating choreography across orthogonal states using the
In() predicate.
Added:
commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/transitions-05.xml
(with props)
Modified:
commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/SCXMLExecutorTest.java
Modified:
commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/SCXMLExecutorTest.java
URL:
http://svn.apache.org/viewvc/commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/SCXMLExecutorTest.java?rev=737891&r1=737890&r2=737891&view=diff
==============================================================================
---
commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/SCXMLExecutorTest.java
(original)
+++
commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/SCXMLExecutorTest.java
Mon Jan 26 22:09:23 2009
@@ -51,7 +51,7 @@
// Test data
private URL microwave01jsp, microwave02jsp, microwave01jexl,
microwave02jexl, microwave03jexl, microwave04jexl, microwave05jexl,
transitions01,
- transitions02, transitions03, transitions04, prefix01, send01, send02;
+ transitions02, transitions03, transitions04, transitions05, prefix01,
send01, send02;
private SCXMLExecutor exec;
/**
@@ -81,6 +81,8 @@
getResource("org/apache/commons/scxml/transitions-03.xml");
transitions04 = this.getClass().getClassLoader().
getResource("org/apache/commons/scxml/transitions-04.xml");
+ transitions05 = this.getClass().getClassLoader().
+ getResource("org/apache/commons/scxml/transitions-05.xml");
prefix01 = this.getClass().getClassLoader().
getResource("org/apache/commons/scxml/prefix-01.xml");
send01 = this.getClass().getClassLoader().
@@ -96,7 +98,7 @@
public void tearDown() {
microwave01jsp = microwave02jsp = microwave01jexl = microwave02jexl =
microwave04jexl = microwave05jexl = transitions01 = transitions02
= transitions03 =
- transitions04 = prefix01 = send01 = send02 = null;
+ transitions04 = transitions05 = prefix01 = send01 = send02 = null;
}
/**
@@ -235,6 +237,14 @@
next()).getId());
}
+ public void testSCXMLExecutorTransitions05Sample() throws Exception {
+ SCXML scxml = SCXMLTestHelper.parse(transitions05);
+ assertNotNull(scxml);
+ exec = SCXMLTestHelper.getExecutor(scxml);
+ assertNotNull(exec);
+ SCXMLTestHelper.assertPostTriggerState(exec, "foo", "end");
+ }
+
public void testSend01Sample() throws Exception {
exec = SCXMLTestHelper.getExecutor(send01);
assertNotNull(exec);
Added:
commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/transitions-05.xml
URL:
http://svn.apache.org/viewvc/commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/transitions-05.xml?rev=737891&view=auto
==============================================================================
---
commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/transitions-05.xml
(added)
+++
commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/transitions-05.xml
Mon Jan 26 22:09:23 2009
@@ -0,0 +1,70 @@
+<?xml version="1.0"?>
+<!--
+ * 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.
+-->
+<!--
+ Uses SCXMLReader
+-->
+<scxml xmlns="http://www.w3.org/2005/07/scxml"
+ version="1.0"
+ initial="para">
+
+ <parallel id="para">
+
+ <state id="para1">
+
+ <initial>
+ <transition target="para11"/>
+ </initial>
+
+ <state id="para11">
+ <transition event="foo" target="para12"/>
+ </state>
+
+ <state id="para12">
+ <onexit>
+ <log expr="'Exiting para12'" />
+ </onexit>
+ </state>
+
+ </state>
+
+ <state id="para2">
+
+ <initial>
+ <transition target="para21"/>
+ </initial>
+
+ <state id="para21">
+ <transition cond="In('para12')" target="para22"/>
+ </state>
+
+ <state id="para22">
+ <onexit>
+ <log expr="'Exiting para22'" />
+ </onexit>
+
+ <transition target="end"/>
+ </state>
+
+ </state>
+
+ </parallel>
+
+ <state id="end" final="true" />
+
+</scxml>
+
Propchange:
commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/transitions-05.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/transitions-05.xml
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL