[jbpm-commits] JBoss JBPM SVN: r1535 - in pvm/trunk/modules/core/src/test: resources/org/jbpm/pvm and 2 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Tue Jul 8 03:45:47 EDT 2008
Author: porcherg
Date: 2008-07-08 03:45:46 -0400 (Tue, 08 Jul 2008)
New Revision: 1535
Added:
pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/internal/
pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/internal/type/
pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/internal/type/environment.cfg.xml
Modified:
pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/type/VariableAutoTypeResolutionTest.java
Log:
fix VariableTypeResoltution test
Modified: pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/type/VariableAutoTypeResolutionTest.java
===================================================================
--- pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/type/VariableAutoTypeResolutionTest.java 2008-07-08 07:26:19 UTC (rev 1534)
+++ pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/type/VariableAutoTypeResolutionTest.java 2008-07-08 07:45:46 UTC (rev 1535)
@@ -29,25 +29,40 @@
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.List;
+import java.util.Map;
-import org.jbpm.pvm.test.base.EnvironmentTestCase;
+import org.jbpm.pvm.activity.ActivityExecution;
+import org.jbpm.pvm.activity.ExternalActivity;
import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.type.Variable;
import org.jbpm.pvm.internal.type.variable.BlobVariable;
import org.jbpm.pvm.internal.type.variable.ClobVariable;
import org.jbpm.pvm.internal.type.variable.DoubleVariable;
import org.jbpm.pvm.internal.type.variable.LongVariable;
import org.jbpm.pvm.internal.type.variable.StringVariable;
import org.jbpm.pvm.model.ProcessFactory;
+import org.jbpm.pvm.test.base.EnvironmentTestCase;
/**
* @author Tom Baeyens
*/
public class VariableAutoTypeResolutionTest extends EnvironmentTestCase
{
-
+ public static class WaitState implements ExternalActivity {
+ private static final long serialVersionUID = 1L;
+ public void execute(ActivityExecution execution) {
+ execution.waitForSignal();
+ }
+ public void signal(ActivityExecution execution, String signalName, Map<String, Object> parameters) {
+ execution.take(signalName);
+ }
+ }
+
+
public void testStringVariable() {
- ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build().done().beginProcessInstance();
+ ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build()
+ .node().initial().behaviour(WaitState.class)
+ .done()
+ .beginProcessInstance();
execution.setVariable("v", "hello");
Variable variable = execution.getVariableObject("v");
@@ -60,7 +75,10 @@
}
public void testLongVariable() {
- ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build().done().beginProcessInstance();
+ ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build()
+ .node().initial().behaviour(WaitState.class)
+ .done()
+ .beginProcessInstance();
execution.setVariable("v", new Long(5));
Variable variable = execution.getVariableObject("v");
@@ -72,7 +90,10 @@
}
public void testDoubleVariable() {
- ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build().done().beginProcessInstance();
+ ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build()
+ .node().initial().behaviour(WaitState.class)
+ .done()
+ .beginProcessInstance();
execution.setVariable("v", new Double(5.5));
Variable variable = execution.getVariableObject("v");
@@ -84,7 +105,10 @@
}
public void testDateVariable() {
- ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build().done().beginProcessInstance();
+ ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build()
+ .node().initial().behaviour(WaitState.class)
+ .done()
+ .beginProcessInstance();
Calendar calendar = new GregorianCalendar();
calendar.set(Calendar.YEAR, 2007);
@@ -106,7 +130,10 @@
}
public void testBooleanVariable() {
- ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build().done().beginProcessInstance();
+ ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build()
+ .node().initial().behaviour(WaitState.class)
+ .done()
+ .beginProcessInstance();
execution.setVariable("affirmative", Boolean.TRUE);
execution.setVariable("negative", Boolean.FALSE);
@@ -125,7 +152,10 @@
}
public void testCharacterVariable() {
- ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build().done().beginProcessInstance();
+ ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build()
+ .node().initial().behaviour(WaitState.class)
+ .done()
+ .beginProcessInstance();
execution.setVariable("v", new Character('c'));
@@ -138,7 +168,10 @@
}
public void testByteVariable() {
- ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build().done().beginProcessInstance();
+ ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build()
+ .node().initial().behaviour(WaitState.class)
+ .done()
+ .beginProcessInstance();
execution.setVariable("v", new Byte((byte)78));
@@ -151,7 +184,10 @@
}
public void testShortVariable() {
- ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build().done().beginProcessInstance();
+ ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build()
+ .node().initial().behaviour(WaitState.class)
+ .done()
+ .beginProcessInstance();
execution.setVariable("v", new Short((short)78));
@@ -164,7 +200,10 @@
}
public void testIntegerVariable() {
- ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build().done().beginProcessInstance();
+ ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build()
+ .node().initial().behaviour(WaitState.class)
+ .done()
+ .beginProcessInstance();
execution.setVariable("v", new Integer(78));
@@ -177,7 +216,10 @@
}
public void testFloatVariable() {
- ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build().done().beginProcessInstance();
+ ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build()
+ .node().initial().behaviour(WaitState.class)
+ .done()
+ .beginProcessInstance();
execution.setVariable("v", new Float(78.65));
@@ -190,7 +232,10 @@
}
public void testBytesVariable() {
- ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build().done().beginProcessInstance();
+ ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build()
+ .node().initial().behaviour(WaitState.class)
+ .done()
+ .beginProcessInstance();
byte[] bytes = generateBytes();
execution.setVariable("v", bytes);
@@ -213,7 +258,10 @@
}
public void testCharsVariable() {
- ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build().done().beginProcessInstance();
+ ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build()
+ .node().initial().behaviour(WaitState.class)
+ .done()
+ .beginProcessInstance();
char[] chars = generateChars();
execution.setVariable("v", chars);
@@ -245,7 +293,10 @@
}
public void testSerializableVariable() {
- ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build().done().beginProcessInstance();
+ ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build()
+ .node().initial().behaviour(WaitState.class)
+ .done()
+ .beginProcessInstance();
TestSerializable testSerializable = new TestSerializable(76);
execution.setVariable("v", testSerializable);
Added: pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/internal/type/environment.cfg.xml
===================================================================
--- pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/internal/type/environment.cfg.xml (rev 0)
+++ pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/internal/type/environment.cfg.xml 2008-07-08 07:45:46 UTC (rev 1535)
@@ -0,0 +1,10 @@
+<contexts>
+
+ <environment-factory>
+ <variable-types resource="org/jbpm/pvm/pvm.types.xml" />
+ </environment-factory>
+
+ <environment>
+ </environment>
+
+</contexts>
Property changes on: pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/internal/type/environment.cfg.xml
___________________________________________________________________
Name: svn:keywords
+ Id
More information about the jbpm-commits
mailing list