[jbpm-commits] JBoss JBPM SVN: r3472 - in projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test: cts/service and 14 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Fri Dec 19 19:32:15 EST 2008
Author: thomas.diesler at jboss.com
Date: 2008-12-19 19:32:15 -0500 (Fri, 19 Dec 2008)
New Revision: 3472
Added:
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/cts/service/ProcessDefinitionServiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/cts/service/ProcessEngineTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/cts/service/ProcessInstanceServiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/exclusivechoice/
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/exclusivechoice/ExclusiveChoiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/multichoice/
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/multichoice/MultiChoiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/parallelsplit/
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/parallelsplit/ParallelSplitTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/sequence/
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/sequence/SequencePersistenceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/sequence/SequenceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/simplemerge/
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/simplemerge/SimpleMergeTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/synchronization/
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/synchronization/SynchronizationTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/data/
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/data/casedata/
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/data/casedata/CaseDataTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/data/taskdata/
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/data/taskdata/TaskDataTest.java
Removed:
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/cts/processengine/
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/cts/service/process/
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/exclusivechoice/ExclusiveChoiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/multichoice/MultiChoiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/parallelsplit/ParallelSplitTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/sequence/SequencePersistenceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/sequence/SequenceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/simplemerge/SimpleMergeTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/synchronization/SynchronizationTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/data/casedata/CaseDataTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/data/taskdata/TaskDataTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/control/exclusivechoice/
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/control/multichoice/
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/control/parallelsplit/
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/control/sequence/
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/control/simplemerge/
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/control/synchronization/
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/data/casedata/
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/data/taskdata/
Log:
Refactor CTS
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/cts/service/ProcessDefinitionServiceTest.java (from rev 3446, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/cts/service/process/ProcessDefinitionServiceTest.java)
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/cts/service/ProcessDefinitionServiceTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/cts/service/ProcessDefinitionServiceTest.java 2008-12-20 00:32:15 UTC (rev 3472)
@@ -0,0 +1,89 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.test.cts.service;
+
+// $Id$
+
+import java.io.IOException;
+import java.util.Set;
+
+import javax.management.ObjectName;
+
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.api.model.ProcessInstance;
+import org.jboss.bpm.api.service.ProcessDefinitionService;
+import org.jboss.bpm.api.service.ProcessEngine;
+import org.jboss.bpm.api.service.ProcessInstanceService;
+import org.jboss.bpm.api.test.CTSTestCase;
+
+/**
+ * Test the ProcessDefinition
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 24-Sep-2008
+ */
+public abstract class ProcessDefinitionServiceTest extends CTSTestCase
+{
+ public void testBasicProcess() throws Exception
+ {
+ ProcessDefinition procDef = getProcessDefinition();
+
+ ProcessEngine engine = procDef.getProcessEngine();
+ assertNotNull("ProcessEngine not null", engine);
+
+ ProcessDefinitionService procDefService = engine.getService(ProcessDefinitionService.class);
+ assertNotNull("ProcessDefinitionService not null", procDefService);
+
+ Set<ObjectName> procDefs = procDefService.getProcessDefinitions();
+ assertEquals("ProcessDefinition not automatically registered", 0, procDefs.size());
+ }
+
+ public void testNewInstance() throws Exception
+ {
+ ProcessDefinition procDef = getProcessDefinition();
+
+ ProcessEngine engine = procDef.getProcessEngine();
+ ProcessDefinitionService procDefService = engine.getService(ProcessDefinitionService.class);
+ ProcessInstanceService procService = engine.getService(ProcessInstanceService.class);
+
+ ProcessInstance proc = procDef.newInstance();
+ assertNotNull("Process not null", proc);
+ assertNull("Process not automatically registered", procService.getInstance(proc.getKey()));
+ assertNull("ProcessDefinition not automatically registered", procDefService.getProcessDefinition(procDef.getKey()));
+ }
+
+ public void testRegister() throws Exception
+ {
+ ProcessDefinition procDef = getProcessDefinition();
+
+ ProcessEngine engine = procDef.getProcessEngine();
+ ProcessDefinitionService procDefService = engine.getService(ProcessDefinitionService.class);
+
+ procDef = procDefService.registerProcessDefinition(procDef);
+ assertNotNull("Registered ProcessDefinition not null", procDef);
+
+ boolean success = procDefService.unregisterProcessDefinition(procDef.getKey());
+ assertTrue("ProcessDefinition unregistered", success);
+ }
+
+ protected abstract ProcessDefinition getProcessDefinition() throws IOException;
+}
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/cts/service/ProcessEngineTest.java (from rev 3446, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/cts/processengine/ProcessEngineTest.java)
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/cts/service/ProcessEngineTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/cts/service/ProcessEngineTest.java 2008-12-20 00:32:15 UTC (rev 3472)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.test.cts.service;
+
+// $Id$
+
+import org.jboss.bpm.api.config.Configuration;
+import org.jboss.bpm.api.service.ProcessEngine;
+import org.jboss.bpm.api.test.CTSTestCase;
+
+/**
+ * Test the ProcessEngine
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 24-Sep-2008
+ */
+public class ProcessEngineTest extends CTSTestCase
+{
+ public void testDefaultProcessEngine() throws Exception
+ {
+ ProcessEngine engine = Configuration.getProcessEngine();
+ assertNotNull("ProcessEngine not null", engine);
+ }
+}
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/cts/service/ProcessInstanceServiceTest.java (from rev 3446, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/cts/service/process/ProcessInstanceServiceTest.java)
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/cts/service/ProcessInstanceServiceTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/cts/service/ProcessInstanceServiceTest.java 2008-12-20 00:32:15 UTC (rev 3472)
@@ -0,0 +1,93 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.test.cts.service;
+
+// $Id$
+
+import javax.management.ObjectName;
+
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.api.model.ProcessInstance;
+import org.jboss.bpm.api.runtime.Token;
+import org.jboss.bpm.api.service.ProcessDefinitionService;
+import org.jboss.bpm.api.service.ProcessInstanceService;
+import org.jboss.bpm.api.test.CTSTestCase;
+
+/**
+ * Test the ProcessService
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public abstract class ProcessInstanceServiceTest extends CTSTestCase
+{
+ public void testRegisterProcess() throws Exception
+ {
+ ProcessDefinitionService procDefService = getProcessEngine().getService(ProcessDefinitionService.class);
+ ProcessInstanceService procService = getProcessEngine().getService(ProcessInstanceService.class);
+
+ ProcessDefinition procDef = getProcessDefinition();
+ ProcessInstance proc = procDef.newInstance();
+
+ assertNull("ProcessDefinition not registered automatically", procDefService.getProcessDefinition(procDef.getKey()));
+ assertNull("Process not registered automatically", procService.getInstance(proc.getKey()));
+
+ // Register the process
+ proc = procService.registerInstance(proc);
+ assertNotNull("Proc not null", proc);
+ assertNotNull("ProcessDefinition registered", procDefService.getProcessDefinition(procDef.getKey()));
+ assertNotNull("Process registered", procService.getInstance(proc.getKey()));
+
+ // Unregister the process
+ procService.unregisterInstance(proc.getKey());
+ assertNull("Process unregistered", procService.getInstance(proc.getKey()));
+ assertNotNull("ProcessDefinition still registered", procDefService.getProcessDefinition(procDef.getKey()));
+
+ procDefService.unregisterProcessDefinition(procDef.getKey());
+ assertNull("ProcessDefinition unregistered", procDefService.getProcessDefinition(procDef.getKey()));
+ }
+
+ public void testStartProcess() throws Exception
+ {
+ ProcessDefinitionService procDefService = getProcessEngine().getService(ProcessDefinitionService.class);
+ ProcessInstanceService procService = getProcessEngine().getService(ProcessInstanceService.class);
+
+ ProcessDefinition procDef = getProcessDefinition();
+ ProcessInstance proc = procDef.newInstance();
+
+ Token token = proc.startProcess();
+ assertNotNull("Token not null", token);
+
+ ObjectName procID = proc.getKey();
+ assertNotNull("Process registered", procService.getInstance(procID));
+
+ // Unregister the process
+ procService.unregisterInstance(procID);
+ assertNull("Process unregistered", procService.getInstance(procID));
+ assertNotNull("ProcessDefinition still registered", procDefService.getProcessDefinition(procDef.getKey()));
+
+ procDefService.unregisterProcessDefinition(procDef.getKey());
+ assertNull("ProcessDefinition unregistered", procDefService.getProcessDefinition(procDef.getKey()));
+ }
+
+ protected abstract ProcessDefinition getProcessDefinition();
+}
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/exclusivechoice (from rev 3446, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/control/exclusivechoice)
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/exclusivechoice/ExclusiveChoiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/control/exclusivechoice/ExclusiveChoiceTest.java 2008-12-19 16:48:49 UTC (rev 3446)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/exclusivechoice/ExclusiveChoiceTest.java 2008-12-20 00:32:15 UTC (rev 3472)
@@ -1,109 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.test.pattern.control.exclusivechoice;
-
-// $Id$
-
-import java.io.IOException;
-import java.util.List;
-
-import org.jboss.bpm.api.model.Gateway;
-import org.jboss.bpm.api.model.ProcessDefinition;
-import org.jboss.bpm.api.model.Expression.ExpressionLanguage;
-import org.jboss.bpm.api.model.builder.GatewayBuilder;
-import org.jboss.bpm.api.runtime.BasicAttachments;
-import org.jboss.bpm.api.service.ProcessBuilderService;
-import org.jboss.bpm.api.test.CTSTestCase;
-import org.jboss.bpm.incubator.client.ProcessInstanceExt;
-import org.jboss.bpm.incubator.model.Signal;
-import org.jboss.bpm.incubator.model.builder.ProcessBuilderExt;
-
-/**
- * Exclusive data-based gateway that has conditional outgoing sequence flows.
- * Only one of the gates is taken. It is an error if no gate is applicable.
- *
- * @author thomas.diesler at jboss.com
- * @since 06-Aug-2008
- */
-public class ExclusiveChoiceTest extends CTSTestCase
-{
- public void testGateA() throws Exception
- {
- ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstanceExt proc = (ProcessInstanceExt)procDef.newInstance();
-
- BasicAttachments att = new BasicAttachments();
- att.addAttachment("foo", "5");
- proc.startProcessAsync(att);
- proc.waitForEnd();
-
- List<Signal> endSignals = getSignals(Signal.SignalType.SYSTEM_END_EVENT_EXIT);
- assertEquals(1, endSignals.size());
- assertEquals("EndA", endSignals.get(0).getFromRef().getKeyProperty("name"));
- }
-
- public void testGateB() throws Exception
- {
- ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstanceExt proc = (ProcessInstanceExt)procDef.newInstance();
-
- BasicAttachments att = new BasicAttachments();
- att.addAttachment("foo", "15");
- proc.startProcessAsync(att);
- proc.waitForEnd();
-
- List<Signal> endSignals = getSignals(Signal.SignalType.SYSTEM_END_EVENT_EXIT);
- assertEquals(1, endSignals.size());
- assertEquals("EndB", endSignals.get(0).getFromRef().getKeyProperty("name"));
- }
-
- public void testInvalidGate() throws Exception
- {
- ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstanceExt proc = (ProcessInstanceExt)procDef.newInstance();
-
- BasicAttachments att = new BasicAttachments();
- att.addAttachment("foo", "10");
- proc.startProcessAsync(att);
- try
- {
- proc.waitForEnd();
- fail("No gate defined for foo==10");
- }
- catch (RuntimeException rte)
- {
- // expected
- }
- }
-
- public ProcessDefinition getProcessDefinition() throws IOException
- {
- ProcessBuilderService pbService = getProcessEngine().getService(ProcessBuilderService.class);
- ProcessBuilderExt procBuilder = (ProcessBuilderExt)pbService.getProcessBuilder();
- procBuilder.addProcess(getName()).addStartEvent("Start").addSequenceFlow("Split");
- GatewayBuilder gatewayBuilder = procBuilder.addGateway("Split", Gateway.GatewayType.Exclusive);
- gatewayBuilder.addConditionalGate("EndA", ExpressionLanguage.MVEL, "foo < 10");
- gatewayBuilder.addConditionalGate("EndB", ExpressionLanguage.MVEL, "foo > 10");
- procBuilder.addEndEventExt("EndA").addEndEventExt("EndB");
- return procBuilder.getProcessDefinition();
- }
-}
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/exclusivechoice/ExclusiveChoiceTest.java (from rev 3471, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/control/exclusivechoice/ExclusiveChoiceTest.java)
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/exclusivechoice/ExclusiveChoiceTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/exclusivechoice/ExclusiveChoiceTest.java 2008-12-20 00:32:15 UTC (rev 3472)
@@ -0,0 +1,109 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.test.incubator.pattern.control.exclusivechoice;
+
+// $Id$
+
+import java.io.IOException;
+import java.util.List;
+
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.api.model.Signal;
+import org.jboss.bpm.api.runtime.BasicAttachments;
+import org.jboss.bpm.api.test.CTSTestCase;
+import org.jboss.bpm.incubator.client.ProcessInstanceExt;
+import org.jboss.bpm.incubator.model.Gateway;
+import org.jboss.bpm.incubator.model.Expression.ExpressionLanguage;
+import org.jboss.bpm.incubator.model.builder.GatewayBuilder;
+import org.jboss.bpm.incubator.model.builder.ProcessBuilderExt;
+import org.jboss.bpm.incubator.service.ProcessBuilderService;
+
+/**
+ * Exclusive data-based gateway that has conditional outgoing sequence flows.
+ * Only one of the gates is taken. It is an error if no gate is applicable.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 06-Aug-2008
+ */
+public class ExclusiveChoiceTest extends CTSTestCase
+{
+ public void testGateA() throws Exception
+ {
+ ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
+ ProcessInstanceExt proc = (ProcessInstanceExt)procDef.newInstance();
+
+ BasicAttachments att = new BasicAttachments();
+ att.addAttachment("foo", "5");
+ proc.startProcessAsync(att);
+ proc.waitForEnd();
+
+ List<Signal> endSignals = getSignals(Signal.SignalType.SYSTEM_END_EVENT_EXIT);
+ assertEquals(1, endSignals.size());
+ assertEquals("EndA", endSignals.get(0).getFromRef().getKeyProperty("name"));
+ }
+
+ public void testGateB() throws Exception
+ {
+ ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
+ ProcessInstanceExt proc = (ProcessInstanceExt)procDef.newInstance();
+
+ BasicAttachments att = new BasicAttachments();
+ att.addAttachment("foo", "15");
+ proc.startProcessAsync(att);
+ proc.waitForEnd();
+
+ List<Signal> endSignals = getSignals(Signal.SignalType.SYSTEM_END_EVENT_EXIT);
+ assertEquals(1, endSignals.size());
+ assertEquals("EndB", endSignals.get(0).getFromRef().getKeyProperty("name"));
+ }
+
+ public void testInvalidGate() throws Exception
+ {
+ ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
+ ProcessInstanceExt proc = (ProcessInstanceExt)procDef.newInstance();
+
+ BasicAttachments att = new BasicAttachments();
+ att.addAttachment("foo", "10");
+ proc.startProcessAsync(att);
+ try
+ {
+ proc.waitForEnd();
+ fail("No gate defined for foo==10");
+ }
+ catch (RuntimeException rte)
+ {
+ // expected
+ }
+ }
+
+ public ProcessDefinition getProcessDefinition() throws IOException
+ {
+ ProcessBuilderService pbService = getProcessEngine().getService(ProcessBuilderService.class);
+ ProcessBuilderExt procBuilder = (ProcessBuilderExt)pbService.getProcessBuilder();
+ procBuilder.addProcess(getName()).addStartEvent("Start").addSequenceFlow("Split");
+ GatewayBuilder gatewayBuilder = procBuilder.addGateway("Split", Gateway.GatewayType.Exclusive);
+ gatewayBuilder.addConditionalGate("EndA", ExpressionLanguage.MVEL, "foo < 10");
+ gatewayBuilder.addConditionalGate("EndB", ExpressionLanguage.MVEL, "foo > 10");
+ procBuilder.addEndEventExt("EndA").addEndEventExt("EndB");
+ return procBuilder.getProcessDefinition();
+ }
+}
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/multichoice (from rev 3446, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/control/multichoice)
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/multichoice/MultiChoiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/control/multichoice/MultiChoiceTest.java 2008-12-19 16:48:49 UTC (rev 3446)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/multichoice/MultiChoiceTest.java 2008-12-20 00:32:15 UTC (rev 3472)
@@ -1,89 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.test.pattern.control.multichoice;
-
-// $Id$
-
-import java.io.IOException;
-import java.util.List;
-
-import org.jboss.bpm.api.model.Gateway;
-import org.jboss.bpm.api.model.ProcessDefinition;
-import org.jboss.bpm.api.model.Expression.ExpressionLanguage;
-import org.jboss.bpm.api.model.builder.GatewayBuilder;
-import org.jboss.bpm.api.runtime.BasicAttachments;
-import org.jboss.bpm.api.service.ProcessBuilderService;
-import org.jboss.bpm.api.test.CTSTestCase;
-import org.jboss.bpm.incubator.client.ProcessInstanceExt;
-import org.jboss.bpm.incubator.model.Signal;
-import org.jboss.bpm.incubator.model.builder.ProcessBuilderExt;
-
-/**
- * Inclusive gateway that has conditional outgoing sequence flows.
- * One or more of them can be taken.
- *
- * @author thomas.diesler at jboss.com
- * @since 06-Aug-2008
- */
-public class MultiChoiceTest extends CTSTestCase
-{
- public void testGateA() throws Exception
- {
- ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstanceExt proc = (ProcessInstanceExt)procDef.newInstance();
-
- BasicAttachments att = new BasicAttachments();
- att.addAttachment("foo", "5");
- proc.startProcessAsync(att);
- proc.waitForEnd();
-
- List<Signal> endSignals = getSignals(Signal.SignalType.SYSTEM_END_EVENT_EXIT);
- assertEquals(2, endSignals.size());
- }
-
- public void testGateB() throws Exception
- {
- ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstanceExt proc = (ProcessInstanceExt)procDef.newInstance();
-
- BasicAttachments att = new BasicAttachments();
- att.addAttachment("foo", "15");
- proc.startProcessAsync(att);
- proc.waitForEnd();
-
- List<Signal> endSignals = getSignals(Signal.SignalType.SYSTEM_END_EVENT_EXIT);
- assertEquals(1, endSignals.size());
- assertEquals("EndB", endSignals.get(0).getFromRef().getKeyProperty("name"));
- }
-
- public ProcessDefinition getProcessDefinition() throws IOException
- {
- ProcessBuilderService pbService = getProcessEngine().getService(ProcessBuilderService.class);
- ProcessBuilderExt procBuilder = (ProcessBuilderExt)pbService.getProcessBuilder();
- procBuilder.addProcess("MultiChoiceTest").addStartEvent("Start").addSequenceFlow("Split");
- GatewayBuilder gatewayBuilder = procBuilder.addGateway("Split", Gateway.GatewayType.Inclusive);
- gatewayBuilder.addConditionalGate("EndA", ExpressionLanguage.MVEL, "foo < 10");
- gatewayBuilder.addConditionalGate("EndB", ExpressionLanguage.MVEL, "foo < 20");
- procBuilder.addEndEventExt("EndA").addEndEventExt("EndB");
- return procBuilder.getProcessDefinition();
- }
-}
\ No newline at end of file
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/multichoice/MultiChoiceTest.java (from rev 3471, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/control/multichoice/MultiChoiceTest.java)
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/multichoice/MultiChoiceTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/multichoice/MultiChoiceTest.java 2008-12-20 00:32:15 UTC (rev 3472)
@@ -0,0 +1,89 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.test.incubator.pattern.control.multichoice;
+
+// $Id$
+
+import java.io.IOException;
+import java.util.List;
+
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.api.model.Signal;
+import org.jboss.bpm.api.runtime.BasicAttachments;
+import org.jboss.bpm.api.test.CTSTestCase;
+import org.jboss.bpm.incubator.client.ProcessInstanceExt;
+import org.jboss.bpm.incubator.model.Gateway;
+import org.jboss.bpm.incubator.model.Expression.ExpressionLanguage;
+import org.jboss.bpm.incubator.model.builder.GatewayBuilder;
+import org.jboss.bpm.incubator.model.builder.ProcessBuilderExt;
+import org.jboss.bpm.incubator.service.ProcessBuilderService;
+
+/**
+ * Inclusive gateway that has conditional outgoing sequence flows.
+ * One or more of them can be taken.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 06-Aug-2008
+ */
+public class MultiChoiceTest extends CTSTestCase
+{
+ public void testGateA() throws Exception
+ {
+ ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
+ ProcessInstanceExt proc = (ProcessInstanceExt)procDef.newInstance();
+
+ BasicAttachments att = new BasicAttachments();
+ att.addAttachment("foo", "5");
+ proc.startProcessAsync(att);
+ proc.waitForEnd();
+
+ List<Signal> endSignals = getSignals(Signal.SignalType.SYSTEM_END_EVENT_EXIT);
+ assertEquals(2, endSignals.size());
+ }
+
+ public void testGateB() throws Exception
+ {
+ ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
+ ProcessInstanceExt proc = (ProcessInstanceExt)procDef.newInstance();
+
+ BasicAttachments att = new BasicAttachments();
+ att.addAttachment("foo", "15");
+ proc.startProcessAsync(att);
+ proc.waitForEnd();
+
+ List<Signal> endSignals = getSignals(Signal.SignalType.SYSTEM_END_EVENT_EXIT);
+ assertEquals(1, endSignals.size());
+ assertEquals("EndB", endSignals.get(0).getFromRef().getKeyProperty("name"));
+ }
+
+ public ProcessDefinition getProcessDefinition() throws IOException
+ {
+ ProcessBuilderService pbService = getProcessEngine().getService(ProcessBuilderService.class);
+ ProcessBuilderExt procBuilder = (ProcessBuilderExt)pbService.getProcessBuilder();
+ procBuilder.addProcess("MultiChoiceTest").addStartEvent("Start").addSequenceFlow("Split");
+ GatewayBuilder gatewayBuilder = procBuilder.addGateway("Split", Gateway.GatewayType.Inclusive);
+ gatewayBuilder.addConditionalGate("EndA", ExpressionLanguage.MVEL, "foo < 10");
+ gatewayBuilder.addConditionalGate("EndB", ExpressionLanguage.MVEL, "foo < 20");
+ procBuilder.addEndEventExt("EndA").addEndEventExt("EndB");
+ return procBuilder.getProcessDefinition();
+ }
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/parallelsplit (from rev 3446, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/control/parallelsplit)
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/parallelsplit/ParallelSplitTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/control/parallelsplit/ParallelSplitTest.java 2008-12-19 16:48:49 UTC (rev 3446)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/parallelsplit/ParallelSplitTest.java 2008-12-20 00:32:15 UTC (rev 3472)
@@ -1,75 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.test.pattern.control.parallelsplit;
-
-// $Id$
-
-import java.io.IOException;
-import java.util.List;
-
-import javax.management.ObjectName;
-
-import org.jboss.bpm.api.model.Gateway;
-import org.jboss.bpm.api.model.ProcessDefinition;
-import org.jboss.bpm.api.service.ProcessBuilderService;
-import org.jboss.bpm.api.test.CTSTestCase;
-import org.jboss.bpm.incubator.client.ProcessInstanceExt;
-import org.jboss.bpm.incubator.model.Signal;
-import org.jboss.bpm.incubator.model.Signal.SignalType;
-import org.jboss.bpm.incubator.model.builder.ProcessBuilderExt;
-
-/**
- * Parallel gateway that has uncontrolled outgoing sequence flows.
- * All of them are taken, which leads to parallel paths of execution.
- *
- * @author thomas.diesler at jboss.com
- * @since 06-Aug-2008
- */
-public class ParallelSplitTest extends CTSTestCase
-{
- public void testParallelSplit() throws Exception
- {
- ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstanceExt proc = (ProcessInstanceExt)procDef.newInstance();
-
- proc.startProcessAsync();
- proc.waitForEnd();
-
- // Validate received signals
- List<Signal> signals = getSignals(SignalType.SYSTEM_END_EVENT_ENTER);
- assertEquals(2, signals.size());
- ObjectName fromRef0 = signals.get(0).getFromRef();
- ObjectName fromRef1 = signals.get(1).getFromRef();
- String fromRefs = fromRef0.getKeyProperty("name") + fromRef1.getKeyProperty("name");
- assertTrue("Unexpected from refs: " + fromRefs, fromRefs.contains("EndA"));
- assertTrue("Unexpected from refs: " + fromRefs, fromRefs.contains("EndB"));
- }
-
- public ProcessDefinition getProcessDefinition() throws IOException
- {
- ProcessBuilderService pbService = getProcessEngine().getService(ProcessBuilderService.class);
- ProcessBuilderExt procBuilder = (ProcessBuilderExt)pbService.getProcessBuilder();
- procBuilder.addProcess(getName()).addStartEvent("Start").addSequenceFlow("Split").addGateway("Split", Gateway.GatewayType.Parallel).
- addSequenceFlow("EndA").addSequenceFlow("EndB").addEndEvent("EndA").addEndEvent("EndB");
- return procBuilder.getProcessDefinition();
- }
-}
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/parallelsplit/ParallelSplitTest.java (from rev 3471, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/control/parallelsplit/ParallelSplitTest.java)
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/parallelsplit/ParallelSplitTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/parallelsplit/ParallelSplitTest.java 2008-12-20 00:32:15 UTC (rev 3472)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.test.incubator.pattern.control.parallelsplit;
+
+// $Id$
+
+import java.io.IOException;
+import java.util.List;
+
+import javax.management.ObjectName;
+
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.api.model.Signal;
+import org.jboss.bpm.api.model.Signal.SignalType;
+import org.jboss.bpm.api.test.CTSTestCase;
+import org.jboss.bpm.incubator.client.ProcessInstanceExt;
+import org.jboss.bpm.incubator.model.Gateway;
+import org.jboss.bpm.incubator.model.builder.ProcessBuilderExt;
+import org.jboss.bpm.incubator.service.ProcessBuilderService;
+
+/**
+ * Parallel gateway that has uncontrolled outgoing sequence flows.
+ * All of them are taken, which leads to parallel paths of execution.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 06-Aug-2008
+ */
+public class ParallelSplitTest extends CTSTestCase
+{
+ public void testParallelSplit() throws Exception
+ {
+ ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
+ ProcessInstanceExt proc = (ProcessInstanceExt)procDef.newInstance();
+
+ proc.startProcessAsync();
+ proc.waitForEnd();
+
+ // Validate received signals
+ List<Signal> signals = getSignals(SignalType.SYSTEM_END_EVENT_ENTER);
+ assertEquals(2, signals.size());
+ ObjectName fromRef0 = signals.get(0).getFromRef();
+ ObjectName fromRef1 = signals.get(1).getFromRef();
+ String fromRefs = fromRef0.getKeyProperty("name") + fromRef1.getKeyProperty("name");
+ assertTrue("Unexpected from refs: " + fromRefs, fromRefs.contains("EndA"));
+ assertTrue("Unexpected from refs: " + fromRefs, fromRefs.contains("EndB"));
+ }
+
+ public ProcessDefinition getProcessDefinition() throws IOException
+ {
+ ProcessBuilderService pbService = getProcessEngine().getService(ProcessBuilderService.class);
+ ProcessBuilderExt procBuilder = (ProcessBuilderExt)pbService.getProcessBuilder();
+ procBuilder.addProcess(getName()).addStartEvent("Start").addSequenceFlow("Split").addGateway("Split", Gateway.GatewayType.Parallel).
+ addSequenceFlow("EndA").addSequenceFlow("EndB").addEndEvent("EndA").addEndEvent("EndB");
+ return procBuilder.getProcessDefinition();
+ }
+}
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/sequence (from rev 3446, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/control/sequence)
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/sequence/SequencePersistenceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/control/sequence/SequencePersistenceTest.java 2008-12-19 16:48:49 UTC (rev 3446)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/sequence/SequencePersistenceTest.java 2008-12-20 00:32:15 UTC (rev 3472)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.test.pattern.control.sequence;
-
-// $Id$
-
-import java.io.IOException;
-
-import javax.management.ObjectName;
-
-import org.jboss.bpm.api.model.ProcessDefinition;
-import org.jboss.bpm.incubator.service.PersistenceService;
-
-/**
- * Test the basic execution sequence
- *
- * @author thomas.diesler at jboss.com
- * @since 03-Jul-2008
- */
-public class SequencePersistenceTest extends SequenceTest
-{
- public ProcessDefinition getProcessDefinition() throws IOException
- {
- ProcessDefinition procDef = super.getProcessDefinition();
-
- // Save the process definition
- PersistenceService service = getProcessEngine().getService(PersistenceService.class);
- ObjectName procDefID = service.saveProcessDefinition(procDef);
-
- // Reload the process defintion
- return service.loadProcessDefinition(procDefID);
- }
-}
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/sequence/SequencePersistenceTest.java (from rev 3471, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/control/sequence/SequencePersistenceTest.java)
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/sequence/SequencePersistenceTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/sequence/SequencePersistenceTest.java 2008-12-20 00:32:15 UTC (rev 3472)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.test.incubator.pattern.control.sequence;
+
+// $Id$
+
+import java.io.IOException;
+
+import javax.management.ObjectName;
+
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.incubator.service.PersistenceService;
+
+/**
+ * Test the basic execution sequence
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 03-Jul-2008
+ */
+public class SequencePersistenceTest extends SequenceTest
+{
+ public ProcessDefinition getProcessDefinition() throws IOException
+ {
+ ProcessDefinition procDef = super.getProcessDefinition();
+
+ // Save the process definition
+ PersistenceService service = getProcessEngine().getService(PersistenceService.class);
+ ObjectName procDefID = service.saveProcessDefinition(procDef);
+
+ // Reload the process defintion
+ return service.loadProcessDefinition(procDefID);
+ }
+}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/sequence/SequenceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/control/sequence/SequenceTest.java 2008-12-19 16:48:49 UTC (rev 3446)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/sequence/SequenceTest.java 2008-12-20 00:32:15 UTC (rev 3472)
@@ -1,75 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.test.pattern.control.sequence;
-
-// $Id$
-
-import java.io.IOException;
-import java.util.List;
-
-import org.jboss.bpm.api.model.ProcessDefinition;
-import org.jboss.bpm.api.service.ProcessBuilderService;
-import org.jboss.bpm.api.test.CTSTestCase;
-import org.jboss.bpm.incubator.client.ProcessInstanceExt;
-import org.jboss.bpm.incubator.model.Signal;
-import org.jboss.bpm.incubator.model.Signal.SignalType;
-import org.jboss.bpm.incubator.model.builder.ProcessBuilderExt;
-
-/**
- * Test the basic execution sequence
- *
- * @author thomas.diesler at jboss.com
- * @since 03-Jul-2008
- */
-public class SequenceTest extends CTSTestCase
-{
- public void testSequence() throws Exception
- {
- ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-
- ProcessInstanceExt proc = (ProcessInstanceExt)procDef.newInstance();
-
- // Start the Process
- proc.startProcessAsync();
- proc.waitForEnd();
-
- // Validate received signals
- List<Signal> signals = getSignals();
- assertEquals(SignalType.SYSTEM_PROCESS_ENTER, signals.get(0).getSignalType());
- assertEquals(SignalType.SYSTEM_START_EVENT_ENTER, signals.get(1).getSignalType());
- assertEquals(SignalType.SYSTEM_START_EVENT_EXIT, signals.get(2).getSignalType());
- assertEquals(SignalType.SYSTEM_TASK_ENTER, signals.get(3).getSignalType());
- assertEquals(SignalType.SYSTEM_TASK_EXIT, signals.get(4).getSignalType());
- assertEquals(SignalType.SYSTEM_END_EVENT_ENTER, signals.get(5).getSignalType());
- assertEquals(SignalType.SYSTEM_END_EVENT_EXIT, signals.get(6).getSignalType());
- assertEquals(SignalType.SYSTEM_PROCESS_EXIT, signals.get(7).getSignalType());
- }
-
- public ProcessDefinition getProcessDefinition() throws IOException
- {
- ProcessBuilderService pbService = getProcessEngine().getService(ProcessBuilderService.class);
- ProcessBuilderExt procBuilder = (ProcessBuilderExt)pbService.getProcessBuilder();
- procBuilder.addProcess("Proc").addStartEvent("Start").addSequenceFlow("Task");
- procBuilder.addTaskExt("Task").addSequenceFlow("End").addEndEvent("End");
- return procBuilder.getProcessDefinition();
- }
-}
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/sequence/SequenceTest.java (from rev 3471, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/control/sequence/SequenceTest.java)
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/sequence/SequenceTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/sequence/SequenceTest.java 2008-12-20 00:32:15 UTC (rev 3472)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.test.incubator.pattern.control.sequence;
+
+// $Id$
+
+import java.io.IOException;
+import java.util.List;
+
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.api.model.Signal;
+import org.jboss.bpm.api.model.Signal.SignalType;
+import org.jboss.bpm.api.test.CTSTestCase;
+import org.jboss.bpm.incubator.client.ProcessInstanceExt;
+import org.jboss.bpm.incubator.model.builder.ProcessBuilderExt;
+import org.jboss.bpm.incubator.service.ProcessBuilderService;
+
+/**
+ * Test the basic execution sequence
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 03-Jul-2008
+ */
+public class SequenceTest extends CTSTestCase
+{
+ public void testSequence() throws Exception
+ {
+ ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
+
+ ProcessInstanceExt proc = (ProcessInstanceExt)procDef.newInstance();
+
+ // Start the Process
+ proc.startProcessAsync();
+ proc.waitForEnd();
+
+ // Validate received signals
+ List<Signal> signals = getSignals();
+ assertEquals(SignalType.SYSTEM_PROCESS_ENTER, signals.get(0).getSignalType());
+ assertEquals(SignalType.SYSTEM_START_EVENT_ENTER, signals.get(1).getSignalType());
+ assertEquals(SignalType.SYSTEM_START_EVENT_EXIT, signals.get(2).getSignalType());
+ assertEquals(SignalType.SYSTEM_TASK_ENTER, signals.get(3).getSignalType());
+ assertEquals(SignalType.SYSTEM_TASK_EXIT, signals.get(4).getSignalType());
+ assertEquals(SignalType.SYSTEM_END_EVENT_ENTER, signals.get(5).getSignalType());
+ assertEquals(SignalType.SYSTEM_END_EVENT_EXIT, signals.get(6).getSignalType());
+ assertEquals(SignalType.SYSTEM_PROCESS_EXIT, signals.get(7).getSignalType());
+ }
+
+ public ProcessDefinition getProcessDefinition() throws IOException
+ {
+ ProcessBuilderService pbService = getProcessEngine().getService(ProcessBuilderService.class);
+ ProcessBuilderExt procBuilder = (ProcessBuilderExt)pbService.getProcessBuilder();
+ procBuilder.addProcess("Proc").addStartEvent("Start").addSequenceFlow("Task");
+ procBuilder.addTaskExt("Task").addSequenceFlow("End").addEndEvent("End");
+ return procBuilder.getProcessDefinition();
+ }
+}
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/simplemerge (from rev 3446, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/control/simplemerge)
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/simplemerge/SimpleMergeTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/control/simplemerge/SimpleMergeTest.java 2008-12-19 16:48:49 UTC (rev 3446)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/simplemerge/SimpleMergeTest.java 2008-12-20 00:32:15 UTC (rev 3472)
@@ -1,73 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.test.pattern.control.simplemerge;
-
-// $Id$
-
-import java.io.IOException;
-import java.util.List;
-
-import org.jboss.bpm.api.model.ProcessDefinition;
-import org.jboss.bpm.api.model.Gateway.GatewayType;
-import org.jboss.bpm.api.service.ProcessBuilderService;
-import org.jboss.bpm.api.test.CTSTestCase;
-import org.jboss.bpm.incubator.client.ProcessInstanceExt;
-import org.jboss.bpm.incubator.model.Signal;
-import org.jboss.bpm.incubator.model.builder.ProcessBuilderExt;
-
-/**
- * Inclusive gateway that has multiple incoming sequence flows. All tokens arriving from incoming sequence flows
- * proceeds unconditionally along the outgoing sequence flow. The inclusive join is stateless.
- *
- * @author thomas.diesler at jboss.com
- * @since 06-Aug-2008
- */
-public class SimpleMergeTest extends CTSTestCase
-{
- public void testSimpleMerge() throws Exception
- {
- ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstanceExt proc = (ProcessInstanceExt)procDef.newInstance();
-
- // Start the process
- proc.startProcessAsync();
-
- // Wait for the process to end
- proc.waitForEnd(5000);
-
- List<Signal> endSignals = getSignals(Signal.SignalType.SYSTEM_END_EVENT_EXIT);
- assertEquals("Two end signals expected", 2, endSignals.size());
- }
-
- public ProcessDefinition getProcessDefinition() throws IOException
- {
- ProcessBuilderService pbService = getProcessEngine().getService(ProcessBuilderService.class);
- ProcessBuilderExt procBuilder = (ProcessBuilderExt)pbService.getProcessBuilder();
- procBuilder.addProcess("ParallelGatewayMerge").addStartEvent("Start").addSequenceFlow("Split");
- procBuilder.addGateway("Split", GatewayType.Inclusive).addSequenceFlow("TaskA").addSequenceFlow("TaskB");
- procBuilder.addTaskExt("TaskA").addSequenceFlow("Merge");
- procBuilder.addTaskExt("TaskB").addSequenceFlow("Merge");
- procBuilder.addGateway("Merge", GatewayType.Inclusive).addSequenceFlow("End");
- procBuilder.addEndEvent("End");
- return procBuilder.getProcessDefinition();
- }
-}
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/simplemerge/SimpleMergeTest.java (from rev 3471, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/control/simplemerge/SimpleMergeTest.java)
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/simplemerge/SimpleMergeTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/simplemerge/SimpleMergeTest.java 2008-12-20 00:32:15 UTC (rev 3472)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.test.incubator.pattern.control.simplemerge;
+
+// $Id$
+
+import java.io.IOException;
+import java.util.List;
+
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.api.model.Signal;
+import org.jboss.bpm.api.test.CTSTestCase;
+import org.jboss.bpm.incubator.client.ProcessInstanceExt;
+import org.jboss.bpm.incubator.model.Gateway.GatewayType;
+import org.jboss.bpm.incubator.model.builder.ProcessBuilderExt;
+import org.jboss.bpm.incubator.service.ProcessBuilderService;
+
+/**
+ * Inclusive gateway that has multiple incoming sequence flows. All tokens arriving from incoming sequence flows
+ * proceeds unconditionally along the outgoing sequence flow. The inclusive join is stateless.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 06-Aug-2008
+ */
+public class SimpleMergeTest extends CTSTestCase
+{
+ public void testSimpleMerge() throws Exception
+ {
+ ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
+ ProcessInstanceExt proc = (ProcessInstanceExt)procDef.newInstance();
+
+ // Start the process
+ proc.startProcessAsync();
+
+ // Wait for the process to end
+ proc.waitForEnd(5000);
+
+ List<Signal> endSignals = getSignals(Signal.SignalType.SYSTEM_END_EVENT_EXIT);
+ assertEquals("Two end signals expected", 2, endSignals.size());
+ }
+
+ public ProcessDefinition getProcessDefinition() throws IOException
+ {
+ ProcessBuilderService pbService = getProcessEngine().getService(ProcessBuilderService.class);
+ ProcessBuilderExt procBuilder = (ProcessBuilderExt)pbService.getProcessBuilder();
+ procBuilder.addProcess("ParallelGatewayMerge").addStartEvent("Start").addSequenceFlow("Split");
+ procBuilder.addGateway("Split", GatewayType.Inclusive).addSequenceFlow("TaskA").addSequenceFlow("TaskB");
+ procBuilder.addTaskExt("TaskA").addSequenceFlow("Merge");
+ procBuilder.addTaskExt("TaskB").addSequenceFlow("Merge");
+ procBuilder.addGateway("Merge", GatewayType.Inclusive).addSequenceFlow("End");
+ procBuilder.addEndEvent("End");
+ return procBuilder.getProcessDefinition();
+ }
+}
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/synchronization (from rev 3446, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/control/synchronization)
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/synchronization/SynchronizationTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/control/synchronization/SynchronizationTest.java 2008-12-19 16:48:49 UTC (rev 3446)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/synchronization/SynchronizationTest.java 2008-12-20 00:32:15 UTC (rev 3472)
@@ -1,81 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.test.pattern.control.synchronization;
-
-// $Id$
-
-import java.io.IOException;
-
-import org.jboss.bpm.api.model.ProcessDefinition;
-import org.jboss.bpm.api.model.Event.EventDetailType;
-import org.jboss.bpm.api.model.Expression.ExpressionLanguage;
-import org.jboss.bpm.api.model.Gateway.GatewayType;
-import org.jboss.bpm.api.service.ProcessBuilderService;
-import org.jboss.bpm.api.test.CTSTestCase;
-import org.jboss.bpm.incubator.client.ProcessInstanceExt;
-import org.jboss.bpm.incubator.model.Message;
-import org.jboss.bpm.incubator.model.Assignment.AssignTime;
-import org.jboss.bpm.incubator.model.builder.MessageBuilder;
-import org.jboss.bpm.incubator.model.builder.ProcessBuilderExt;
-
-/**
- * Parallel gateway that that has multiple incoming sequence flows. Each token arriving from an incoming sequence flow
- * is stored in the gateway until a token has arrived from each incoming sequence flow. The tokens are merged together
- * and leave the gateway as a one.
- *
- * @author thomas.diesler at jboss.com
- * @since 06-Aug-2008
- */
-public class SynchronizationTest extends CTSTestCase
-{
- public void testParallelMerge() throws Exception
- {
- ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstanceExt proc = (ProcessInstanceExt)procDef.newInstance();
-
- // Start the process
- proc.startProcessAsync();
-
- // Wait for the process to end
- proc.waitForEnd();
-
- // Verify the result
- Message endMessage = getMessages().get(0);
- assertEquals("TaskA", endMessage.getProperty("taskValueA").getValue());
- assertEquals("TaskB", endMessage.getProperty("taskValueB").getValue());
- }
-
- public ProcessDefinition getProcessDefinition() throws IOException
- {
- ProcessBuilderService pbService = getProcessEngine().getService(ProcessBuilderService.class);
- ProcessBuilderExt procBuilder = (ProcessBuilderExt)pbService.getProcessBuilder();
- procBuilder.addProcess("ParallelGatewayMerge").addStartEvent("Start").addSequenceFlow("Split");
- procBuilder.addGateway("Split", GatewayType.Parallel).addSequenceFlow("TaskA").addSequenceFlow("TaskB");
- procBuilder.addTaskExt("TaskA").addNodeAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "'TaskA'", "taskValueA").addSequenceFlow("Merge");
- procBuilder.addTaskExt("TaskB").addNodeAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "'TaskB'", "taskValueB").addSequenceFlow("Merge");
- procBuilder.addGateway("Merge", GatewayType.Parallel).addSequenceFlow("End");
- procBuilder.addEndEventExt("End", EventDetailType.Message).addMessageRef("EndMessage");
- MessageBuilder msgBuilder = procBuilder.addProcessMessage("EndMessage");
- msgBuilder.addToRef(getTestID()).addProperty("taskValueA", null, true).addProperty("taskValueB", null, true);
- return procBuilder.getProcessDefinition();
- }
-}
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/synchronization/SynchronizationTest.java (from rev 3471, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/control/synchronization/SynchronizationTest.java)
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/synchronization/SynchronizationTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/control/synchronization/SynchronizationTest.java 2008-12-20 00:32:15 UTC (rev 3472)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.test.incubator.pattern.control.synchronization;
+
+// $Id$
+
+import java.io.IOException;
+
+import org.jboss.bpm.api.model.Message;
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.api.model.builder.MessageBuilder;
+import org.jboss.bpm.api.test.CTSTestCase;
+import org.jboss.bpm.incubator.client.ProcessInstanceExt;
+import org.jboss.bpm.incubator.model.Assignment.AssignTime;
+import org.jboss.bpm.incubator.model.Event.EventDetailType;
+import org.jboss.bpm.incubator.model.Expression.ExpressionLanguage;
+import org.jboss.bpm.incubator.model.Gateway.GatewayType;
+import org.jboss.bpm.incubator.model.builder.ProcessBuilderExt;
+import org.jboss.bpm.incubator.service.ProcessBuilderService;
+
+/**
+ * Parallel gateway that that has multiple incoming sequence flows. Each token arriving from an incoming sequence flow
+ * is stored in the gateway until a token has arrived from each incoming sequence flow. The tokens are merged together
+ * and leave the gateway as a one.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 06-Aug-2008
+ */
+public class SynchronizationTest extends CTSTestCase
+{
+ public void testParallelMerge() throws Exception
+ {
+ ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
+ ProcessInstanceExt proc = (ProcessInstanceExt)procDef.newInstance();
+
+ // Start the process
+ proc.startProcessAsync();
+
+ // Wait for the process to end
+ proc.waitForEnd();
+
+ // Verify the result
+ Message endMessage = getMessages().get(0);
+ assertEquals("TaskA", endMessage.getProperty("taskValueA").getValue());
+ assertEquals("TaskB", endMessage.getProperty("taskValueB").getValue());
+ }
+
+ public ProcessDefinition getProcessDefinition() throws IOException
+ {
+ ProcessBuilderService pbService = getProcessEngine().getService(ProcessBuilderService.class);
+ ProcessBuilderExt procBuilder = (ProcessBuilderExt)pbService.getProcessBuilder();
+ procBuilder.addProcess("ParallelGatewayMerge").addStartEvent("Start").addSequenceFlow("Split");
+ procBuilder.addGateway("Split", GatewayType.Parallel).addSequenceFlow("TaskA").addSequenceFlow("TaskB");
+ procBuilder.addTaskExt("TaskA").addNodeAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "'TaskA'", "taskValueA").addSequenceFlow("Merge");
+ procBuilder.addTaskExt("TaskB").addNodeAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "'TaskB'", "taskValueB").addSequenceFlow("Merge");
+ procBuilder.addGateway("Merge", GatewayType.Parallel).addSequenceFlow("End");
+ procBuilder.addEndEventExt("End", EventDetailType.Message).addMessageRef("EndMessage");
+ MessageBuilder msgBuilder = procBuilder.addProcessMessage("EndMessage");
+ msgBuilder.addToRef(getTestID()).addProperty("taskValueA", null, true).addProperty("taskValueB", null, true);
+ return procBuilder.getProcessDefinition();
+ }
+}
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/data/casedata (from rev 3446, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/data/casedata)
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/data/casedata/CaseDataTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/data/casedata/CaseDataTest.java 2008-12-19 16:48:49 UTC (rev 3446)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/data/casedata/CaseDataTest.java 2008-12-20 00:32:15 UTC (rev 3472)
@@ -1,76 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.test.pattern.data.casedata;
-
-// $Id$
-
-import java.io.IOException;
-
-import org.jboss.bpm.api.model.ProcessDefinition;
-import org.jboss.bpm.api.model.Event.EventDetailType;
-import org.jboss.bpm.api.model.Expression.ExpressionLanguage;
-import org.jboss.bpm.api.service.ProcessBuilderService;
-import org.jboss.bpm.api.test.CTSTestCase;
-import org.jboss.bpm.incubator.client.ProcessInstanceExt;
-import org.jboss.bpm.incubator.model.Message;
-import org.jboss.bpm.incubator.model.Assignment.AssignTime;
-import org.jboss.bpm.incubator.model.builder.MessageBuilder;
-import org.jboss.bpm.incubator.model.builder.ProcessBuilderExt;
-
-/**
- * Data elements are supported which are specific to a process instance or case. They can be accessed by all components
- * of the process during the execution of the case.
- *
- * https://jira.jboss.org/jira/browse/JBPM-1519
- *
- * @author thomas.diesler at jboss.com
- * @since 15-Aug-2008
- */
-public class CaseDataTest extends CTSTestCase
-{
- public void testCaseProperties() throws Exception
- {
- ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstanceExt proc = (ProcessInstanceExt)procDef.newInstance();
-
- proc.startProcessAsync();
- proc.waitForEnd();
-
- Message endMessage = getMessages().get(0);
- assertNotNull("EndMessage expected", endMessage);
- assertEquals("bar", endMessage.getProperty("propValue").getValue());
- }
-
- protected ProcessDefinition getProcessDefinition() throws IOException
- {
- ProcessBuilderService pbService = getProcessEngine().getService(ProcessBuilderService.class);
- ProcessBuilderExt procBuilder = (ProcessBuilderExt)pbService.getProcessBuilder();
- procBuilder.addProcess("CaseData");
- procBuilder.addProcessAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "CaseData_foo", "propValue");
- procBuilder.addProcessProperty("foo", "bar").addStartEvent("Start").addSequenceFlow("TaskA");
- procBuilder.addTaskExt("TaskA").addSequenceFlow("End");
- procBuilder.addEndEventExt("End", EventDetailType.Message).addMessageRef("EndMessage");
- MessageBuilder msgBuilder = procBuilder.addProcessMessage("EndMessage");
- msgBuilder.addToRef(getTestID()).addProperty("propValue", null, true);
- return procBuilder.getProcessDefinition();
- }
-}
\ No newline at end of file
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/data/casedata/CaseDataTest.java (from rev 3471, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/data/casedata/CaseDataTest.java)
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/data/casedata/CaseDataTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/data/casedata/CaseDataTest.java 2008-12-20 00:32:15 UTC (rev 3472)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.test.incubator.pattern.data.casedata;
+
+// $Id$
+
+import java.io.IOException;
+
+import org.jboss.bpm.api.model.Message;
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.api.model.builder.MessageBuilder;
+import org.jboss.bpm.api.test.CTSTestCase;
+import org.jboss.bpm.incubator.client.ProcessInstanceExt;
+import org.jboss.bpm.incubator.model.Assignment.AssignTime;
+import org.jboss.bpm.incubator.model.Event.EventDetailType;
+import org.jboss.bpm.incubator.model.Expression.ExpressionLanguage;
+import org.jboss.bpm.incubator.model.builder.ProcessBuilderExt;
+import org.jboss.bpm.incubator.service.ProcessBuilderService;
+
+/**
+ * Data elements are supported which are specific to a process instance or case. They can be accessed by all components
+ * of the process during the execution of the case.
+ *
+ * https://jira.jboss.org/jira/browse/JBPM-1519
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 15-Aug-2008
+ */
+public class CaseDataTest extends CTSTestCase
+{
+ public void testCaseProperties() throws Exception
+ {
+ ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
+ ProcessInstanceExt proc = (ProcessInstanceExt)procDef.newInstance();
+
+ proc.startProcessAsync();
+ proc.waitForEnd();
+
+ Message endMessage = getMessages().get(0);
+ assertNotNull("EndMessage expected", endMessage);
+ assertEquals("bar", endMessage.getProperty("propValue").getValue());
+ }
+
+ protected ProcessDefinition getProcessDefinition() throws IOException
+ {
+ ProcessBuilderService pbService = getProcessEngine().getService(ProcessBuilderService.class);
+ ProcessBuilderExt procBuilder = (ProcessBuilderExt)pbService.getProcessBuilder();
+ procBuilder.addProcess("CaseData");
+ procBuilder.addProcessAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "CaseData_foo", "propValue");
+ procBuilder.addProcessProperty("foo", "bar").addStartEvent("Start").addSequenceFlow("TaskA");
+ procBuilder.addTaskExt("TaskA").addSequenceFlow("End");
+ procBuilder.addEndEventExt("End", EventDetailType.Message).addMessageRef("EndMessage");
+ MessageBuilder msgBuilder = procBuilder.addProcessMessage("EndMessage");
+ msgBuilder.addToRef(getTestID()).addProperty("propValue", null, true);
+ return procBuilder.getProcessDefinition();
+ }
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/data/taskdata (from rev 3446, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/data/taskdata)
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/data/taskdata/TaskDataTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/data/taskdata/TaskDataTest.java 2008-12-19 16:48:49 UTC (rev 3446)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/data/taskdata/TaskDataTest.java 2008-12-20 00:32:15 UTC (rev 3472)
@@ -1,77 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.test.pattern.data.taskdata;
-
-// $Id$
-
-import java.io.IOException;
-
-import org.jboss.bpm.api.model.ProcessDefinition;
-import org.jboss.bpm.api.model.Event.EventDetailType;
-import org.jboss.bpm.api.model.Expression.ExpressionLanguage;
-import org.jboss.bpm.api.service.ProcessBuilderService;
-import org.jboss.bpm.api.test.CTSTestCase;
-import org.jboss.bpm.incubator.client.ProcessInstanceExt;
-import org.jboss.bpm.incubator.model.Message;
-import org.jboss.bpm.incubator.model.Assignment.AssignTime;
-import org.jboss.bpm.incubator.model.builder.MessageBuilder;
-import org.jboss.bpm.incubator.model.builder.ProcessBuilderExt;
-import org.jboss.bpm.incubator.model.builder.TaskBuilder;
-
-/**
- * Data elements can be defined by tasks which are accessible only within the context of individual execution instances
- * of that task.
- *
- * https://jira.jboss.org/jira/browse/JBPM-1515
- *
- * @author thomas.diesler at jboss.com
- * @since 15-Aug-2008
- */
-public class TaskDataTest extends CTSTestCase
-{
- public void testTaskDataRead() throws Exception
- {
- ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstanceExt proc = (ProcessInstanceExt)procDef.newInstance();
-
- proc.startProcessAsync();
- proc.waitForEnd();
-
- Message endMessage = getMessages().get(0);
- assertNotNull("EndMessage expected", endMessage);
- assertEquals("bar", endMessage.getProperty("foo").getValue());
- }
-
- protected ProcessDefinition getProcessDefinition() throws IOException
- {
- ProcessBuilderService pbService = getProcessEngine().getService(ProcessBuilderService.class);
- ProcessBuilderExt procBuilder = (ProcessBuilderExt)pbService.getProcessBuilder();
- procBuilder.addProcess("TaskData").addStartEvent("Start").addSequenceFlow("TaskA");
- TaskBuilder taskBuilder = procBuilder.addTaskExt("TaskA");
- taskBuilder.addNodeProperty("foo", "bar").addSequenceFlow("End");
- taskBuilder.addNodeAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "TaskData_TaskA_foo", "foo");
- procBuilder.addEndEventExt("End", EventDetailType.Message).addMessageRef("EndMessage");
- MessageBuilder msgBuilder = procBuilder.addProcessMessage("EndMessage");
- msgBuilder.addToRef(getTestID()).addProperty("foo", null, true);
- return procBuilder.getProcessDefinition();
- }
-}
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/data/taskdata/TaskDataTest.java (from rev 3471, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/pattern/data/taskdata/TaskDataTest.java)
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/data/taskdata/TaskDataTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/pattern/data/taskdata/TaskDataTest.java 2008-12-20 00:32:15 UTC (rev 3472)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.test.incubator.pattern.data.taskdata;
+
+// $Id$
+
+import java.io.IOException;
+
+import org.jboss.bpm.api.model.Message;
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.api.model.builder.MessageBuilder;
+import org.jboss.bpm.api.test.CTSTestCase;
+import org.jboss.bpm.incubator.client.ProcessInstanceExt;
+import org.jboss.bpm.incubator.model.Assignment.AssignTime;
+import org.jboss.bpm.incubator.model.Event.EventDetailType;
+import org.jboss.bpm.incubator.model.Expression.ExpressionLanguage;
+import org.jboss.bpm.incubator.model.builder.ProcessBuilderExt;
+import org.jboss.bpm.incubator.model.builder.TaskBuilder;
+import org.jboss.bpm.incubator.service.ProcessBuilderService;
+
+/**
+ * Data elements can be defined by tasks which are accessible only within the context of individual execution instances
+ * of that task.
+ *
+ * https://jira.jboss.org/jira/browse/JBPM-1515
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 15-Aug-2008
+ */
+public class TaskDataTest extends CTSTestCase
+{
+ public void testTaskDataRead() throws Exception
+ {
+ ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
+ ProcessInstanceExt proc = (ProcessInstanceExt)procDef.newInstance();
+
+ proc.startProcessAsync();
+ proc.waitForEnd();
+
+ Message endMessage = getMessages().get(0);
+ assertNotNull("EndMessage expected", endMessage);
+ assertEquals("bar", endMessage.getProperty("foo").getValue());
+ }
+
+ protected ProcessDefinition getProcessDefinition() throws IOException
+ {
+ ProcessBuilderService pbService = getProcessEngine().getService(ProcessBuilderService.class);
+ ProcessBuilderExt procBuilder = (ProcessBuilderExt)pbService.getProcessBuilder();
+ procBuilder.addProcess("TaskData").addStartEvent("Start").addSequenceFlow("TaskA");
+ TaskBuilder taskBuilder = procBuilder.addTaskExt("TaskA");
+ taskBuilder.addNodeProperty("foo", "bar").addSequenceFlow("End");
+ taskBuilder.addNodeAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "TaskData_TaskA_foo", "foo");
+ procBuilder.addEndEventExt("End", EventDetailType.Message).addMessageRef("EndMessage");
+ MessageBuilder msgBuilder = procBuilder.addProcessMessage("EndMessage");
+ msgBuilder.addToRef(getTestID()).addProperty("foo", null, true);
+ return procBuilder.getProcessDefinition();
+ }
+}
More information about the jbpm-commits
mailing list