[jbpm-commits] JBoss JBPM SVN: r6401 - in jbpm4/trunk/modules: jpdl/src/test/java/org/jbpm/jpdl/parsing and 1 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Thu Jun 10 12:58:21 EDT 2010
Author: alex.guizar at jboss.com
Date: 2010-06-10 12:58:19 -0400 (Thu, 10 Jun 2010)
New Revision: 6401
Added:
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ArgParsingTest.java
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/CacheParsingTest.java
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/MailParsingTest.java
Modified:
jbpm4/trunk/modules/api/src/main/resources/jpdl-4.4.xsd
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/CustomMailProducerTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/MailTest.java
Log:
JBPM-2715: add cache attribute to wireObjectType
add wireObjectGroup to argType
derive mailType from wireObjectType
Modified: jbpm4/trunk/modules/api/src/main/resources/jpdl-4.4.xsd
===================================================================
--- jbpm4/trunk/modules/api/src/main/resources/jpdl-4.4.xsd 2010-06-10 16:11:57 UTC (rev 6400)
+++ jbpm4/trunk/modules/api/src/main/resources/jpdl-4.4.xsd 2010-06-10 16:58:19 UTC (rev 6401)
@@ -961,6 +961,10 @@
should be automatically wired based on matching the property names and types with the
object names and types</documentation></annotation>
</attribute>
+ <attribute name="cache" type="tns:booleanValueType">
+ <annotation><documentation>Indicates if the user code should be cached
+ </documentation></annotation>
+ </attribute>
</complexType>
<complexType name="argType">
@@ -968,6 +972,7 @@
Each 'arg' element should have exactly one child element
that represents the value of the argument.
</documentation></annotation>
+ <group ref="tns:wireObjectGroup" />
<attribute name="type" type="string">
<annotation><documentation>The java class name representing
the type of the method. This is optional and can be used to
@@ -1364,36 +1369,39 @@
</group>
<complexType name="mailType">
- <sequence>
- <element name="description" minOccurs="0" maxOccurs="unbounded" type="string" />
- <element name="from" type="tns:mailRecipientType" minOccurs="0" />
- <element name="to" type="tns:mailRecipientType" minOccurs="0" />
- <element name="cc" type="tns:mailRecipientType" minOccurs="0" />
- <element name="bcc" type="tns:mailRecipientType" minOccurs="0" />
- <element name="subject" type="string" minOccurs="0" />
- <element name="text" type="string" minOccurs="0" />
- <element name="html" type="string" minOccurs="0" />
- <element name="attachments" minOccurs="0" >
- <complexType>
- <sequence>
- <element name="attachment" maxOccurs="unbounded">
- <complexType>
- <attribute name="url" type="string">
- <annotation><documentation>URL reference to the attachment</documentation></annotation>
- </attribute>
- <attribute name="resource" type="string">
- <annotation><documentation>Name of the attachment resource on the classpath</documentation></annotation>
- </attribute>
- <attribute name="file" type="string">
- <annotation><documentation>File reference to the attachment</documentation></annotation>
- </attribute>
- </complexType>
- </element>
- </sequence>
- </complexType>
- </element>
- </sequence>
- <attribute name="template" type="tns:templateType" />
+ <complexContent>
+ <extension base="tns:wireObjectType">
+ <sequence>
+ <element name="from" type="tns:mailRecipientType" minOccurs="0" />
+ <element name="to" type="tns:mailRecipientType" minOccurs="0" />
+ <element name="cc" type="tns:mailRecipientType" minOccurs="0" />
+ <element name="bcc" type="tns:mailRecipientType" minOccurs="0" />
+ <element name="subject" type="string" minOccurs="0" />
+ <element name="text" type="string" minOccurs="0" />
+ <element name="html" type="string" minOccurs="0" />
+ <element name="attachments" minOccurs="0" >
+ <complexType>
+ <sequence>
+ <element name="attachment" maxOccurs="unbounded">
+ <complexType>
+ <attribute name="url" type="string">
+ <annotation><documentation>URL reference to the attachment</documentation></annotation>
+ </attribute>
+ <attribute name="resource" type="string">
+ <annotation><documentation>Name of the attachment resource on the classpath</documentation></annotation>
+ </attribute>
+ <attribute name="file" type="string">
+ <annotation><documentation>File reference to the attachment</documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+ </sequence>
+ </complexType>
+ </element>
+ </sequence>
+ <attribute name="template" type="tns:templateType" />
+ </extension>
+ </complexContent>
</complexType>
<complexType name="jmsType">
Added: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ArgParsingTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ArgParsingTest.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ArgParsingTest.java 2010-06-10 16:58:19 UTC (rev 6401)
@@ -0,0 +1,57 @@
+package org.jbpm.jpdl.parsing;
+
+import java.util.List;
+
+import org.jbpm.pvm.internal.xml.Problem;
+
+/**
+ * JBPM-2715.
+ * @author Huisheng Xu
+ */
+public class ArgParsingTest extends JpdlParseTestCase {
+
+ public void testArgOneValue() {
+ String xmlString = "<process name='MyProcess' version='1' xmlns='http://jbpm.org/jpdl/4.4'>\n"
+ + " <start name='start'>\n"
+ + " <transition name='myTransition' to='end'>\n"
+ + " <event-listener class='com.comp.MyEventListener'>\n"
+ + " <constructor>\n"
+ + " <arg type='java.lang.String'><string value='hello world'/></arg>\n"
+ + " </constructor>\n"
+ + " </event-listener>\n"
+ + " </transition>\n"
+ + " </start>\n"
+ + " <end name='end'/>\n"
+ + "</process>\n";
+
+ List<Problem> problems = jpdlParser.createParse()
+ .setString(xmlString)
+ .execute()
+ .getProblems();
+ assertEquals(0, problems.size());
+ }
+
+ public void testArgTwoValues() {
+ String xmlString = "<process name='MyProcess' version='1' xmlns='http://jbpm.org/jpdl/4.4'>\n"
+ + " <start name='start'>\n"
+ + " <transition name='myTransition' to='end'>\n"
+ + " <event-listener class='com.comp.MyEventListener'>\n"
+ + " <constructor>\n"
+ + " <arg type='java.lang.String'>\n"
+ + " <string value='hello world'/>\n"
+ + " <string value='goodbye world'/>\n"
+ + " </arg>\n"
+ + " </constructor>\n"
+ + " </event-listener>\n"
+ + " </transition>\n"
+ + " </start>\n"
+ + " <end name='end'/>\n"
+ + "</process>\n";
+
+ List<Problem> problems = jpdlParser.createParse()
+ .setString(xmlString)
+ .execute()
+ .getProblems();
+ assertEquals(1, problems.size());
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ArgParsingTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/CacheParsingTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/CacheParsingTest.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/CacheParsingTest.java 2010-06-10 16:58:19 UTC (rev 6401)
@@ -0,0 +1,46 @@
+package org.jbpm.jpdl.parsing;
+
+import java.util.List;
+
+import org.jbpm.pvm.internal.xml.Problem;
+
+/**
+ * JBPM-2849.
+ * @author Huisheng Xu
+ */
+public class CacheParsingTest extends JpdlParseTestCase {
+
+ public void testCacheDisabled() {
+ String xmlString = "<process name='MyProsess' version='1' xmlns='http://jbpm.org/jpdl/4.4'>\n"
+ + " <start name='start'>\n"
+ + " <transition name='myTransition' to='end'>\n"
+ + " <event-listener class='com.comp.MyEventListener' cache='disabled'/>\n"
+ + " </transition>\n"
+ + " </start>\n"
+ + " <end name='end'/>\n"
+ + "</process>\n";
+
+ List<Problem> problems = jpdlParser.createParse()
+ .setString(xmlString)
+ .execute()
+ .getProblems();
+ assertEquals(0, problems.size());
+ }
+
+ public void testCachePowered() {
+ String xmlString = "<process name='MyProsess' version='1' xmlns='http://jbpm.org/jpdl/4.4'>\n"
+ + " <start name='start'>\n"
+ + " <transition name='myTransition' to='end'>\n"
+ + " <event-listener class='com.comp.MyEventListener' cache='powered'/>\n"
+ + " </transition>\n"
+ + " </start>\n"
+ + " <end name='end'/>\n"
+ + "</process>\n";
+
+ List<Problem> problems = jpdlParser.createParse()
+ .setString(xmlString)
+ .execute()
+ .getProblems();
+ assert !problems.isEmpty();
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/CacheParsingTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/MailParsingTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/MailParsingTest.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/MailParsingTest.java 2010-06-10 16:58:19 UTC (rev 6401)
@@ -0,0 +1,30 @@
+package org.jbpm.jpdl.parsing;
+
+import java.util.List;
+
+import org.jbpm.pvm.internal.xml.Problem;
+
+/**
+ * JBPM-2843.
+ * @author Huisheng Xu
+ */
+public class MailParsingTest extends JpdlParseTestCase {
+
+ public void testMailParse() {
+ String xmlString = "<process name='MyProsess' version='1' xmlns='http://jbpm.org/jpdl/4.4'>"
+ + " <start name='start'>"
+ + " <transition to='mail'/>"
+ + " </start>"
+ + " <mail name='mail' lang='java' class='org.MyMailProducer'>"
+ + " <transition to='end'/>"
+ + " </mail>"
+ + " <end name='end'/>"
+ + "</process>";
+
+ List<Problem> problems = jpdlParser.createParse()
+ .setString(xmlString)
+ .execute()
+ .getProblems();
+ assertEquals(0, problems.size());
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/MailParsingTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/CustomMailProducerTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/CustomMailProducerTest.java 2010-06-10 16:11:57 UTC (rev 6400)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/CustomMailProducerTest.java 2010-06-10 16:58:19 UTC (rev 6401)
@@ -80,7 +80,7 @@
public void testCustomMailProducer() {
// deploy process
- deployJpdlXmlString("<process name='custommail'>"
+ deployJpdlXmlString("<process name='custommail' xmlns='http://jbpm.org/jpdl/4.4'>"
+ " <start>"
+ " <transition to='send mail' />"
+ " </start>"
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/MailTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/MailTest.java 2010-06-10 16:11:57 UTC (rev 6400)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/MailTest.java 2010-06-10 16:58:19 UTC (rev 6401)
@@ -50,7 +50,7 @@
}
public void testMailToPlainAddress() {
- deployJpdlXmlString("<process name='plainaddress'>"
+ deployJpdlXmlString("<process name='plainaddress' xmlns='http://jbpm.org/4.3/jpdl'>"
+ " <start>"
+ " <transition to='mailtestmail' />"
+ " </start>"
More information about the jbpm-commits
mailing list