commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ra...@apache.org
Subject svn commit: r601643 - in /commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml: WildcardTest.java env/jexl/wildcard-02.xml
Date Thu, 06 Dec 2007 07:37:55 GMT
Author: rahul
Date: Wed Dec  5 23:37:48 2007
New Revision: 601643

URL: http://svn.apache.org/viewvc?rev=601643&view=rev
Log:
Add test from SCXML-53 for wildcard testing, thanks to Ingmar Kliche <ingmar dot kliche
at googlemail dot com>.

Added:
    commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/env/jexl/wildcard-02.xml
  (with props)
Modified:
    commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/WildcardTest.java

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/WildcardTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/WildcardTest.java?rev=601643&r1=601642&r2=601643&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/WildcardTest.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/WildcardTest.java Wed
Dec  5 23:37:48 2007
@@ -45,7 +45,7 @@
     }
 
     // Test data
-    private URL wildcard01;
+    private URL wildcard01, wildcard02;
     private SCXMLExecutor exec;
 
     /**
@@ -54,13 +54,15 @@
     public void setUp() {
         wildcard01 = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml/env/jexl/wildcard-01.xml");
+        wildcard02 = this.getClass().getClassLoader().
+            getResource("org/apache/commons/scxml/env/jexl/wildcard-02.xml");
     }
 
     /**
      * Tear down instance variables required by this test case.
      */
     public void tearDown() {
-        wildcard01 = null;
+        wildcard01 = wildcard02 = null;
     }
 
     /**
@@ -78,6 +80,19 @@
             currentStates = SCXMLTestHelper.fireEvent(exec, "foo.bar.baz");
             assertEquals(1, currentStates.size());
             assertEquals("state4", ((State)currentStates.iterator().
+                next()).getId());
+        } catch (Exception e) {
+            fail(e.getMessage());
+        }
+    }
+
+    public void testWildcard02Sample() {
+        exec = SCXMLTestHelper.getExecutor(SCXMLTestHelper.parse(wildcard02));
+        assertNotNull(exec);
+        try {
+            Set currentStates = exec.getCurrentStatus().getStates();
+            assertEquals(1, currentStates.size());
+            assertEquals("state2", ((State)currentStates.iterator().
                 next()).getId());
         } catch (Exception e) {
             fail(e.getMessage());

Added: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/env/jexl/wildcard-02.xml
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/env/jexl/wildcard-02.xml?rev=601643&view=auto
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/env/jexl/wildcard-02.xml
(added)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/env/jexl/wildcard-02.xml
Wed Dec  5 23:37:48 2007
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<scxml xmlns="http://www.w3.org/2005/07/scxml"
+      version="1.0"
+      initialstate="state1">
+
+    <state id="state1">
+      <onentry>
+        <event name="success.start"/>
+      </onentry>
+      <transition event="success.*" target="state2"/>
+    </state>
+
+    <state id="state2"/>
+
+</scxml>
+

Propchange: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/env/jexl/wildcard-02.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/env/jexl/wildcard-02.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL



Mime
View raw message