commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ra...@apache.org
Subject svn commit: r600018 - in /commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml: TieBreakerTest.java tie-breaker-06.xml
Date Fri, 30 Nov 2007 23:52:58 GMT
Author: rahul
Date: Fri Nov 30 15:52:50 2007
New Revision: 600018

URL: http://svn.apache.org/viewvc?rev=600018&view=rev
Log:
Added a test case for <send>s in the same executable content block. No functional change.

Added:
    commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/tie-breaker-06.xml 
 (with props)
Modified:
    commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/TieBreakerTest.java

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/TieBreakerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/TieBreakerTest.java?rev=600018&r1=600017&r2=600018&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/TieBreakerTest.java
(original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/TieBreakerTest.java
Fri Nov 30 15:52:50 2007
@@ -55,7 +55,7 @@
 
     // Test data
     private URL tiebreaker01, tiebreaker02, tiebreaker03, tiebreaker04,
-        tiebreaker05;
+        tiebreaker05, tiebreaker06;
     private SCXMLExecutor exec;
 
     /**
@@ -72,6 +72,8 @@
             getResource("org/apache/commons/scxml/tie-breaker-04.xml");
         tiebreaker05 = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml/tie-breaker-05.xml");
+        tiebreaker06 = this.getClass().getClassLoader().
+            getResource("org/apache/commons/scxml/tie-breaker-06.xml");
     }
 
     /**
@@ -79,7 +81,7 @@
      */
     public void tearDown() {
         tiebreaker01 = tiebreaker02 = tiebreaker03 = tiebreaker04 =
-            tiebreaker05 = null;
+            tiebreaker05 = tiebreaker06 = null;
     }
 
     /**
@@ -154,6 +156,13 @@
             assertTrue(id.equals("s12") || id.equals("s212")
                 || id.equals("s2112"));
         }
+    }
+
+    public void testTieBreaker06() {
+        exec = SCXMLTestHelper.getExecutor(tiebreaker06);
+        assertNotNull(exec);
+        Set currentStates = exec.getCurrentStatus().getStates();
+        assertEquals(1, currentStates.size());
     }
 
     public static void main(String args[]) {

Added: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/tie-breaker-06.xml
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/tie-breaker-06.xml?rev=600018&view=auto
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/tie-breaker-06.xml (added)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/tie-breaker-06.xml Fri
Nov 30 15:52:50 2007
@@ -0,0 +1,40 @@
+<?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.
+-->
+<!-- A fictitious state machine used by test cases.
+     <send>s in the same executable content block -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" initialstate="main">
+
+  <state id="main">
+
+    <onentry>
+      <send event="internal_event1"/>
+      <send event="internal_event2"/>
+    </onentry>
+
+    <transition event="internal_event1">
+      <log label="Expected"
+           expr="'Transition for first send (internal_event1) followed'"/>
+    </transition>
+    <transition event="internal_event2">
+      <log label="Unexpected"
+           expr="'Transition for second send (internal_event2) followed'"/>
+    </transition>
+
+  </state>
+
+</scxml>

Propchange: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/tie-breaker-06.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/tie-breaker-06.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL



Mime
View raw message