commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wolfgang Frech (JIRA)" <j...@apache.org>
Subject [jira] Created: (SCXML-37) state with src attribute must not have children
Date Mon, 12 Feb 2007 14:57:05 GMT
state with src attribute must not have children
-----------------------------------------------

                 Key: SCXML-37
                 URL: https://issues.apache.org/jira/browse/SCXML-37
             Project: Commons SCXML
          Issue Type: Bug
    Affects Versions: 0.6
         Environment: Win XP, JDK 1.5  Eclipse 3.2, JUnit 4, details on request
            Reporter: Wolfgang Frech
            Priority: Minor


The Digester accepts an SCXML model with a state that has both a src attribute (and its contents
defined in an external file), and an additional onentry child.
According to the WD-SCXML section 3.2.1, "If [the src attribute] is present, no children are
allowed."

Test case to demonstrate the actual behavior follows

JUnit test method
----
	@Test
	public void externalStateWithChildren() throws FileNotFoundException,
			IOException, SAXException, ModelException {
		final URL definition = getClass().getClassLoader().getResource(
				"externalStateWithChild-main.scxml");
		SCXML scxml = SCXMLDigester.digest(definition, new SimpleErrorHandler());
		// expected/correct: digesting should throw exception
		// according to WD-SCXML 3.2.1 "If [the src attribute] is present, no
		// children are allowed."
		// actual/incorrect
		assertNotNull(scxml);
	}
----

main scxml
----
<?xml version="1.0"?>
<scxml
  xmlns="http://www.w3.org/2005/07/scxml"
  version="1.0"
  initialstate="external">
  <state
    id="external"
    src="externalStateWithChild-external.scxml">
    <onentry>
      <log
        expr="'This onentry child should not be accepted according to WD-SCXML 3.2.1 Description'"
/>
    </onentry>
  </state>
----

external scxml
----
?xml version="1.0"?>
<scxml
  xmlns="http://www.w3.org/2005/07/scxml"
  version="1.0"
  initialstate="start">
  <state id="start" /> 
</scxml>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message