You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ra...@apache.org on 2006/07/19 16:48:51 UTC

svn commit: r423479 - in /jakarta/commons/proper/scxml/trunk/src: main/java/org/apache/commons/scxml/io/ main/java/org/apache/commons/scxml/model/ test/java/org/apache/commons/scxml/model/

Author: rahul
Date: Wed Jul 19 07:48:50 2006
New Revision: 423479

URL: http://svn.apache.org/viewvc?rev=423479&view=rev
Log:
SCXML-3
Add @src processing for <assign> tag

Added:
    jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/PathResolverHolder.java   (with props)
    jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/AssignTest.java   (with props)
    jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/assign-src.xml   (with props)
    jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/assign-test.xml   (with props)
Modified:
    jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/SCXMLDigester.java
    jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Assign.java
    jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Invoke.java
    jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/ModelTestSuite.java

Modified: jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/SCXMLDigester.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/SCXMLDigester.java?rev=423479&r1=423478&r2=423479&view=diff
==============================================================================
--- jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/SCXMLDigester.java (original)
+++ jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/SCXMLDigester.java Wed Jul 19 07:48:50 2006
@@ -61,6 +61,7 @@
 import org.apache.commons.scxml.model.OnExit;
 import org.apache.commons.scxml.model.Parallel;
 import org.apache.commons.scxml.model.Param;
+import org.apache.commons.scxml.model.PathResolverHolder;
 import org.apache.commons.scxml.model.SCXML;
 import org.apache.commons.scxml.model.Send;
 import org.apache.commons.scxml.model.State;
@@ -688,10 +689,10 @@
         scxmlRules.add(XPU_TR_TAR_ST, new SetNextRule("setTarget"));
 
         //// Parallels
-        addParallelRules(XPU_ST_PAR, scxmlRules, customActions, scxml);
+        addParallelRules(XPU_ST_PAR, scxmlRules, pr, customActions, scxml);
 
         //// Ifs
-        addIfRules(XPU_IF, scxmlRules, customActions);
+        addIfRules(XPU_IF, scxmlRules, pr, customActions);
 
         //// Custom actions
         addCustomActionRules(XPU_ONEN, scxmlRules, customActions);
@@ -728,8 +729,8 @@
         addHistoryRules(xp + XPF_HIST, scxmlRules, customActions, pr, scxml);
         addParentRule(xp, scxmlRules, parent);
         addTransitionRules(xp + XPF_TR, scxmlRules, "addTransition",
-            customActions);
-        addHandlerRules(xp, scxmlRules, customActions);
+            pr, customActions);
+        addHandlerRules(xp, scxmlRules, pr, customActions);
         scxmlRules.add(xp, new UpdateModelRule(scxml));
     }
 
@@ -741,14 +742,15 @@
      * @param scxmlRules The rule set to be used for digestion
      * @param customActions The list of custom actions this digester needs
      *                      to be able to process
+     * @param pr The {@link PathResolver} for this document
      * @param scxml The parent SCXML document (or null)
      */
     private static void addParallelRules(final String xp,
-            final ExtendedBaseRules scxmlRules, final List customActions,
-            final SCXML scxml) {
+            final ExtendedBaseRules scxmlRules, final PathResolver pr,
+            final List customActions, final SCXML scxml) {
         addSimpleRulesTuple(xp, scxmlRules, Parallel.class, null, null,
                 "setParallel");
-        addHandlerRules(xp, scxmlRules, customActions);
+        addHandlerRules(xp, scxmlRules, pr, customActions);
         addParentRule(xp, scxmlRules, 1);
         scxmlRules.add(xp, new UpdateModelRule(scxml));
     }
@@ -813,13 +815,13 @@
             final PathResolver pr, final SCXML scxml) {
         scxmlRules.add(xp, new ObjectCreateRule(Invoke.class));
         scxmlRules.add(xp, new SetPropertiesRule());
-        scxmlRules.add(xp, new UpdateInvokeRule(pr));
+        scxmlRules.add(xp, new SetPathResolverRule(pr));
         scxmlRules.add(xp + XPF_PRM, new ObjectCreateRule(Param.class));
         scxmlRules.add(xp + XPF_PRM, new SetPropertiesRule());
         scxmlRules.add(xp + XPF_PRM, new SetNextRule("addParam"));
         scxmlRules.add(xp + XPF_FIN, new ObjectCreateRule(Finalize.class));
         scxmlRules.add(xp + XPF_FIN, new UpdateFinalizeRule());
-        addActionRules(xp + XPF_FIN, scxmlRules, customActions);
+        addActionRules(xp + XPF_FIN, scxmlRules, pr, customActions);
         scxmlRules.add(xp + XPF_FIN, new SetNextRule("setFinalize"));
         scxmlRules.add(xp, new SetNextRule("setInvoke"));
     }
@@ -842,7 +844,7 @@
         addPseudoStatePropertiesRules(xp, scxmlRules, customActions, pr);
         scxmlRules.add(xp, new UpdateModelRule(scxml));
         addTransitionRules(xp + XPF_TR, scxmlRules, "setTransition",
-            customActions);
+            pr, customActions);
         scxmlRules.add(xp, new SetNextRule("setInitial"));
     }
 
@@ -866,7 +868,7 @@
         scxmlRules.add(xp, new SetPropertiesRule(new String[] {"type"},
             new String[] {"type"}));
         addTransitionRules(xp + XPF_TR, scxmlRules, "setTransition",
-            customActions);
+            pr, customActions);
         scxmlRules.add(xp, new SetNextRule("addHistory"));
     }
 
@@ -925,18 +927,19 @@
      * @param scxmlRules The rule set to be used for digestion
      * @param setNextMethod The method name for adding this transition
      *             to its parent (defined by the SCXML Java object model).
+     * @param pr The {@link PathResolver} for this document
      * @param customActions The list of custom actions this digester needs
      *                      to be able to process
      */
     private static void addTransitionRules(final String xp,
             final ExtendedBaseRules scxmlRules, final String setNextMethod,
-            final List customActions) {
+            final PathResolver pr, final List customActions) {
         scxmlRules.add(xp, new ObjectCreateRule(Transition.class));
         scxmlRules.add(xp, new SetPropertiesRule(
             new String[] {"event", "cond", "target"},
             new String[] {"event", "cond", "next"}));
         scxmlRules.add(xp + XPF_TAR, new SetPropertiesRule());
-        addActionRules(xp, scxmlRules, customActions);
+        addActionRules(xp, scxmlRules, pr, customActions);
         scxmlRules.add(xp + XPF_EXT, new Rule() {
             public void end(final String namespace, final String name) {
                 Transition t = (Transition) getDigester().peek(1);
@@ -955,16 +958,18 @@
      * @param xp The Digester style XPath expression of the parent
      *           XML element
      * @param scxmlRules The rule set to be used for digestion
+     * @param pr The {@link PathResolver} for this document
      * @param customActions The list of custom actions this digester needs
      *                      to be able to process
      */
     private static void addHandlerRules(final String xp,
-            final ExtendedBaseRules scxmlRules, final List customActions) {
+            final ExtendedBaseRules scxmlRules, final PathResolver pr,
+            final List customActions) {
         scxmlRules.add(xp + XPF_ONEN, new ObjectCreateRule(OnEntry.class));
-        addActionRules(xp + XPF_ONEN, scxmlRules, customActions);
+        addActionRules(xp + XPF_ONEN, scxmlRules, pr, customActions);
         scxmlRules.add(xp + XPF_ONEN, new SetNextRule("setOnEntry"));
         scxmlRules.add(xp + XPF_ONEX, new ObjectCreateRule(OnExit.class));
-        addActionRules(xp + XPF_ONEX, scxmlRules, customActions);
+        addActionRules(xp + XPF_ONEX, scxmlRules, pr, customActions);
         scxmlRules.add(xp + XPF_ONEX, new SetNextRule("setOnExit"));
     }
 
@@ -974,12 +979,15 @@
      * @param xp The Digester style XPath expression of the parent
      *           XML element
      * @param scxmlRules The rule set to be used for digestion
+     * @param pr The {@link PathResolver} for this document
      * @param customActions The list of custom actions this digester needs
      *                      to be able to process
      */
     private static void addActionRules(final String xp,
-            final ExtendedBaseRules scxmlRules, final List customActions) {
+            final ExtendedBaseRules scxmlRules, final PathResolver pr,
+            final List customActions) {
         addActionRulesTuple(xp + XPF_ASN, scxmlRules, Assign.class);
+        scxmlRules.add(xp + XPF_ASN, new SetPathResolverRule(pr));
         addActionRulesTuple(xp + XPF_VAR, scxmlRules, Var.class);
         addActionRulesTuple(xp + XPF_LOG, scxmlRules, Log.class);
         addSendRulesTuple(xp + XPF_SND, scxmlRules);
@@ -1077,13 +1085,15 @@
      * @param xp The Digester style XPath expression of the parent
      *           XML element
      * @param scxmlRules The rule set to be used for digestion
+     * @param pr The {@link PathResolver} for this document
      * @param customActions The list of custom actions this digester needs
      *                      to be able to process
      */
     private static void addIfRules(final String xp,
-            final ExtendedBaseRules scxmlRules, final List customActions) {
+            final ExtendedBaseRules scxmlRules, final PathResolver pr,
+            final List customActions) {
         addActionRulesTuple(xp, scxmlRules, If.class);
-        addActionRules(xp, scxmlRules, customActions);
+        addActionRules(xp, scxmlRules, pr, customActions);
         addActionRulesTuple(xp + XPF_EIF, scxmlRules, ElseIf.class);
         addActionRulesTuple(xp + XPF_ELS, scxmlRules, Else.class);
     }
@@ -1404,11 +1414,10 @@
     }
 
     /**
-     * Custom digestion rule for setting PathResolver for runtime retrieval
-     * and parent state.
+     * Custom digestion rule for setting PathResolver for runtime retrieval.
      *
      */
-    public static class UpdateInvokeRule extends Rule {
+    public static class SetPathResolverRule extends Rule {
 
         /**
          * The PathResolver to set.
@@ -1422,7 +1431,7 @@
          *
          * @see PathResolver
          */
-        public UpdateInvokeRule(final PathResolver pr) {
+        public SetPathResolverRule(final PathResolver pr) {
             super();
             this.pr = pr;
         }
@@ -1432,8 +1441,9 @@
          */
         public final void begin(final String namespace, final String name,
                 final Attributes attributes) {
-            Invoke invoke = (Invoke) getDigester().peek();
-            invoke.setPathResolver(pr);
+            PathResolverHolder prHolder = (PathResolverHolder) getDigester().
+                peek();
+            prHolder.setPathResolver(pr);
         }
     }
 

Modified: jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Assign.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Assign.java?rev=423479&r1=423478&r2=423479&view=diff
==============================================================================
--- jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Assign.java (original)
+++ jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Assign.java Wed Jul 19 07:48:50 2006
@@ -19,15 +19,20 @@
 
 import java.util.Collection;
 
+import javax.xml.parsers.DocumentBuilderFactory;
+
 import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.commons.scxml.Context;
 import org.apache.commons.scxml.ErrorReporter;
 import org.apache.commons.scxml.Evaluator;
 import org.apache.commons.scxml.EventDispatcher;
+import org.apache.commons.scxml.PathResolver;
 import org.apache.commons.scxml.SCInstance;
 import org.apache.commons.scxml.SCXMLExpressionException;
 import org.apache.commons.scxml.SCXMLHelper;
 import org.apache.commons.scxml.TriggerEvent;
+import org.w3c.dom.Document;
 import org.w3c.dom.Node;
 
 /**
@@ -35,7 +40,7 @@
  * &lt;assign&gt; SCXML element.
  *
  */
-public final class Assign extends Action {
+public final class Assign extends Action implements PathResolverHolder {
 
     /**
      * Left hand side expression evaluating to a previously
@@ -60,6 +65,11 @@
     private String expr;
 
     /**
+     * {@link PathResolver} for resolving the "src" result.
+     */
+    private PathResolver pathResolver;
+
+    /**
      * Constructor.
      */
     public Assign() {
@@ -139,6 +149,24 @@
     }
 
     /**
+     * Get the {@link PathResolver}.
+     *
+     * @return Returns the pathResolver.
+     */
+    public PathResolver getPathResolver() {
+        return pathResolver;
+    }
+
+    /**
+     * Set the {@link PathResolver}.
+     *
+     * @param pathResolver The pathResolver to set.
+     */
+    public void setPathResolver(final PathResolver pathResolver) {
+        this.pathResolver = pathResolver;
+    }
+
+    /**
      * {@inheritDoc}
      */
     public void execute(final EventDispatcher evtDispatcher,
@@ -156,14 +184,19 @@
                 // a Node, if so, import it at location
                 Node newNode = null;
                 try {
-                    newNode = eval.evalLocation(ctx, expr);
+                    if (src != null && src.trim().length() > 0) {
+                        newNode = getSrcNode();
+                    } else {
+                        newNode = eval.evalLocation(ctx, expr);
+                    }
                     if (newNode != null) {
                         // adopt children, possible spec clarification needed
-                        Node importedNode = oldNode.getOwnerDocument().
-                            importNode(newNode, true);
-                        for (Node child = importedNode.getFirstChild();
-                            child != null; child = child.getNextSibling()) {
-                                oldNode.appendChild(child);
+                        for (Node child = newNode.getFirstChild();
+                                child != null;
+                                child = child.getNextSibling()) {
+                            Node importedNode = oldNode.getOwnerDocument().
+                                importNode(child, true);
+                            oldNode.appendChild(importedNode);
                         }
                     }
                 } catch (SCXMLExpressionException see) {
@@ -184,7 +217,12 @@
                 errRep.onError(ErrorReporter.UNDEFINED_VARIABLE, name
                     + " = null", parentState);
             } else {
-                Object varObj = eval.eval(ctx, expr);
+                Object varObj = null;
+                if (src != null && src.trim().length() > 0) {
+                    varObj = getSrcNode();
+                } else {
+                    varObj = eval.eval(ctx, expr);
+                }
                 ctx.set(name, varObj);
                 TriggerEvent ev = new TriggerEvent(name + ".change",
                     TriggerEvent.CHANGE_EVENT);
@@ -193,5 +231,29 @@
         }
     }
 
-}
+    /**
+     * Get the {@link Node} the "src" attribute points to.
+     *
+     * @return The node the "src" attribute points to.
+     */
+    private Node getSrcNode() {
+        String resolvedSrc = src;
+        if (pathResolver != null) {
+            resolvedSrc = pathResolver.resolvePath(src);
+        }
+        Document doc = null;
+        try {
+            doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().
+                parse(resolvedSrc);
+        } catch (Throwable t) {
+            org.apache.commons.logging.Log log = LogFactory.
+                getLog(Assign.class);
+            log.error(t.getMessage(), t);
+        }
+        if (doc == null) {
+            return null;
+        }
+        return doc.getDocumentElement();
+    }
 
+}

Modified: jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Invoke.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Invoke.java?rev=423479&r1=423478&r2=423479&view=diff
==============================================================================
--- jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Invoke.java (original)
+++ jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Invoke.java Wed Jul 19 07:48:50 2006
@@ -27,7 +27,7 @@
  * &lt;invoke&gt; SCXML element.
  *
  */
-public class Invoke {
+public class Invoke implements PathResolverHolder {
 
     /**
      * The type of target to be invoked.

Added: jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/PathResolverHolder.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/PathResolverHolder.java?rev=423479&view=auto
==============================================================================
--- jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/PathResolverHolder.java (added)
+++ jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/PathResolverHolder.java Wed Jul 19 07:48:50 2006
@@ -0,0 +1,44 @@
+/*
+ *
+ *   Copyright 2006 The Apache Software Foundation.
+ *
+ *  Licensed 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.commons.scxml.model;
+
+import org.apache.commons.scxml.PathResolver;
+
+/**
+ * A <code>PathResolverHolder</code> is an entity that holds a
+ * {@link PathResolver}.
+ *
+ */
+public interface PathResolverHolder {
+
+    /**
+     * Set the {@link PathResolver} to use.
+     *
+     * @param pathResolver The path resolver to use.
+     */
+    void setPathResolver(PathResolver pathResolver);
+
+    /**
+     * Get the {@link PathResolver}.
+     *
+     * @return The path resolver in use.
+     */
+    PathResolver getPathResolver();
+
+}
+

Propchange: jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/PathResolverHolder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/PathResolverHolder.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/AssignTest.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/AssignTest.java?rev=423479&view=auto
==============================================================================
--- jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/AssignTest.java (added)
+++ jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/AssignTest.java Wed Jul 19 07:48:50 2006
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed 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.commons.scxml.model;
+
+import java.net.URL;
+import java.util.Set;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import org.apache.commons.scxml.SCXMLExecutor;
+import org.apache.commons.scxml.SCXMLTestHelper;
+/**
+ * Unit tests for &lt;assign&gt; element, particular the "src" attribute.
+ */
+public class AssignTest extends TestCase {
+    /**
+     * Construct a new instance of AssignTest with
+     * the specified name
+     */
+    public AssignTest(String name) {
+        super(name);
+    }
+
+    public static Test suite() {
+        TestSuite suite = new TestSuite(AssignTest.class);
+        suite.setName("SCXML Model Assign Tests");
+        return suite;
+    }
+
+    // Test data
+    private SCXMLExecutor exec;
+
+    /**
+     * Set up instance variables required by this test case.
+     */
+    public void setUp() {
+        URL assignSample = this.getClass().getClassLoader().
+            getResource("org/apache/commons/scxml/model/assign-test.xml");
+        exec = SCXMLTestHelper.getExecutor(assignSample);
+    }
+
+    /**
+     * Tear down instance variables required by this test case.
+     */
+    public void tearDown() {
+        exec = null;
+    }
+
+    /**
+     * Test the implementation
+     */
+    public void testAssignSrc() {
+        Set currentStates = exec.getCurrentStatus().getStates();
+        assertEquals(1, currentStates.size());
+        assertEquals("assign2", ((State)currentStates.iterator().
+            next()).getId());
+        assertTrue(exec.getCurrentStatus().isFinal());
+    }
+
+     public static void main(String args[]) {
+        TestRunner.run(suite());
+    }
+}
+

Propchange: jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/AssignTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/AssignTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/ModelTestSuite.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/ModelTestSuite.java?rev=423479&r1=423478&r2=423479&view=diff
==============================================================================
--- jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/ModelTestSuite.java (original)
+++ jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/ModelTestSuite.java Wed Jul 19 07:48:50 2006
@@ -49,6 +49,7 @@
         suite.setName("Commons-SCXML Model Tests");
         suite.addTest(ActionsTest.suite());
         suite.addTest(ActionTest.suite());
+        suite.addTest(AssignTest.suite());
         suite.addTest(CustomActionTest.suite());
         suite.addTest(DatamodelTest.suite());
         suite.addTest(HistoryTest.suite());

Added: jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/assign-src.xml
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/assign-src.xml?rev=423479&view=auto
==============================================================================
--- jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/assign-src.xml (added)
+++ jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/assign-src.xml Wed Jul 19 07:48:50 2006
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<!--
+   Copyright 2006 The Apache Software Foundation
+
+   Licensed 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.
+-->
+<!-- Used in test of "src" attribute of assign element -->
+<root xmlns="">
+    <a>10</a>
+</root>

Propchange: jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/assign-src.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/assign-src.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/assign-test.xml
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/assign-test.xml?rev=423479&view=auto
==============================================================================
--- jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/assign-test.xml (added)
+++ jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/assign-test.xml Wed Jul 19 07:48:50 2006
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<!--
+   Copyright 2006 The Apache Software Foundation
+
+   Licensed 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.
+-->
+<!-- Test "src" attribute of assign element -->
+<scxml xmlns="http://www.w3.org/2005/01/SCXML"
+       version="1.0"
+       initialstate="assign1">
+  
+  <state id="assign1" final="true">
+
+    <datamodel>
+        <data name="foo">
+            <root xmlns="">
+                <foo/>
+            </root>
+        </data>
+        <data name="bar">
+            <root xmlns="">
+                <bar>5</bar>
+            </root>
+        </data>
+    </datamodel>
+
+    <onentry>
+        <assign location="Data(foo,'root/foo')" src="assign-src.xml"/>
+    </onentry>
+
+    <transition cond="Data(foo,'root/foo/a') + Data(bar,'root/bar') eq 15"
+                target="assign2" />
+
+  </state>
+
+  <state id="assign2" final="true" />
+
+</scxml>

Propchange: jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/assign-test.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/assign-test.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org