[jbpm-commits] JBoss JBPM SVN: r2518 - in jbpm3/trunk: modules/enterprise/jar and 4 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Oct 10 03:55:40 EDT 2008


Author: thomas.diesler at jboss.com
Date: 2008-10-10 03:55:40 -0400 (Fri, 10 Oct 2008)
New Revision: 2518

Modified:
   jbpm3/trunk/modules/enterprise/jar/pom.xml
   jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/enterprise/AppServerConfigurationsTest.java
   jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/enterprise/ContainerProvidedJarsTest.java
   jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/msg/jms/JmsMessageTest.java
   jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/persistence/jta/JtaDbPersistenceTest.java
   jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/scheduler/ejbtimer/EjbSchedulerTest.java
   jbpm3/trunk/pom.xml
Log:
Fix dependency on jbpm-spec-api

Modified: jbpm3/trunk/modules/enterprise/jar/pom.xml
===================================================================
--- jbpm3/trunk/modules/enterprise/jar/pom.xml	2008-10-10 07:54:54 UTC (rev 2517)
+++ jbpm3/trunk/modules/enterprise/jar/pom.xml	2008-10-10 07:55:40 UTC (rev 2518)
@@ -87,10 +87,14 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>org.jbpm.spec</groupId>
+      <groupId>org.jbpm.jbpm4</groupId>
       <artifactId>jbpm-spec-api</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+    </dependency>
   </dependencies>
 
   <!-- Plugins -->

Modified: jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/enterprise/AppServerConfigurationsTest.java
===================================================================
--- jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/enterprise/AppServerConfigurationsTest.java	2008-10-10 07:54:54 UTC (rev 2517)
+++ jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/enterprise/AppServerConfigurationsTest.java	2008-10-10 07:55:40 UTC (rev 2518)
@@ -24,8 +24,8 @@
 import junit.framework.Test;
 
 import org.apache.cactus.ServletTestCase;
-import org.jboss.bpm.test.IntegrationTestSetup;
 import org.jbpm.JbpmConfiguration;
+import org.jbpm.api.test.IntegrationTestSetup;
 import org.jbpm.msg.jms.JmsMessageServiceFactoryImpl;
 import org.jbpm.persistence.jta.JtaDbPersistenceServiceFactory;
 import org.jbpm.scheduler.ejbtimer.EntitySchedulerServiceFactory;

Modified: jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/enterprise/ContainerProvidedJarsTest.java
===================================================================
--- jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/enterprise/ContainerProvidedJarsTest.java	2008-10-10 07:54:54 UTC (rev 2517)
+++ jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/enterprise/ContainerProvidedJarsTest.java	2008-10-10 07:55:40 UTC (rev 2518)
@@ -29,41 +29,45 @@
 
 import javax.management.ObjectName;
 
-import org.jboss.bpm.model.ObjectNameFactory;
-import org.jboss.bpm.test.IntegrationTestCase;
+import junit.framework.TestCase;
 
+import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.test.IntegrationTestHelper;
+
 /**
  * Test that there are jars deployed which should in fact be provided by the container
  * 
  * @author thomas.diesler at jboss.com
  * @since 23-Sep-2008
  */
-public class ContainerProvidedJarsTest extends IntegrationTestCase
+public class ContainerProvidedJarsTest extends TestCase
 {
+  IntegrationTestHelper delegate = new IntegrationTestHelper();
+  
   public void testDependencies() throws Exception
   {
     String targetContainer = null;
-    if (isTargetJBoss422())
+    if (delegate.isTargetJBoss422())
     {
       targetContainer = "jboss422";
     }
-    else if (isTargetJBoss423())
+    else if (delegate.isTargetJBoss423())
     {
       targetContainer = "jboss423";
     }
-    else if (isTargetJBoss500())
+    else if (delegate.isTargetJBoss500())
     {
       targetContainer = "jboss500";
     }
     assertNotNull("System property 'target.container' not null", targetContainer);
     assertTrue("Supported target.container: " + targetContainer, "jboss422,jboss423,jboss500".indexOf(targetContainer) >= 0);
 
-    File jbossJars = getResourceFile(targetContainer + "-dependencies.txt");
+    File jbossJars = delegate.getResourceFile(targetContainer + "-dependencies.txt");
     assertTrue("JBoss jar fixture exists: " + jbossJars, jbossJars.exists());
 
     // Read the JBoss ServerHomeDir
     ObjectName oname = ObjectNameFactory.create("jboss.system:type=ServerConfig");
-    File serverHomeDir = (File)getServer().getAttribute(oname, "ServerHomeDir");
+    File serverHomeDir = (File)delegate.getServer().getAttribute(oname, "ServerHomeDir");
     if (serverHomeDir == null)
       throw new IllegalStateException("Cannot obtain jboss home dir");
 

Modified: jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/msg/jms/JmsMessageTest.java
===================================================================
--- jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/msg/jms/JmsMessageTest.java	2008-10-10 07:54:54 UTC (rev 2517)
+++ jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/msg/jms/JmsMessageTest.java	2008-10-10 07:55:40 UTC (rev 2518)
@@ -31,10 +31,9 @@
 import org.apache.cactus.ServletTestCase;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
-import org.jboss.bpm.test.IntegrationTestSetup;
 import org.jbpm.EventCallback;
 import org.jbpm.JbpmContext;
+import org.jbpm.api.test.IntegrationTestSetup;
 import org.jbpm.command.Command;
 import org.jbpm.command.DeployProcessCommand;
 import org.jbpm.command.StartProcessInstanceCommand;

Modified: jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/persistence/jta/JtaDbPersistenceTest.java
===================================================================
--- jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/persistence/jta/JtaDbPersistenceTest.java	2008-10-10 07:54:54 UTC (rev 2517)
+++ jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/persistence/jta/JtaDbPersistenceTest.java	2008-10-10 07:55:40 UTC (rev 2518)
@@ -29,13 +29,14 @@
 import junit.framework.Test;
 
 import org.apache.cactus.ServletTestCase;
-import org.jboss.bpm.test.IntegrationTestSetup;
 import org.jbpm.JbpmConfiguration;
 import org.jbpm.JbpmContext;
+import org.jbpm.api.test.IntegrationTestSetup;
 import org.jbpm.graph.def.ProcessDefinition;
 import org.jbpm.graph.exe.ProcessInstance;
 
-public class JtaDbPersistenceTest extends ServletTestCase {
+public class JtaDbPersistenceTest extends ServletTestCase
+{
 
   private JbpmConfiguration jbpmConfiguration;
   private UserTransaction tx;
@@ -43,32 +44,38 @@
 
   private static long definitionId;
 
-  public static Test suite() throws Exception {
-     return new IntegrationTestSetup(JtaDbPersistenceTest.class, "enterprise-test.war");
+  public static Test suite() throws Exception
+  {
+    return new IntegrationTestSetup(JtaDbPersistenceTest.class, "enterprise-test.war");
   }
-  
-  protected void setUp() throws Exception {
+
+  protected void setUp() throws Exception
+  {
     jbpmConfiguration = JbpmConfiguration.getInstance();
   }
 
-  public void testUserTx() throws Exception {
+  public void testUserTx() throws Exception
+  {
     tx = getUserTransaction();
     testServiceTx();
   }
 
-  public void testUserTxRollback() throws Exception {
+  public void testUserTxRollback() throws Exception
+  {
     tx = getUserTransaction();
     testServiceTxRollback();
   }
 
-  public void testServiceTx() throws Exception {
+  public void testServiceTx() throws Exception
+  {
     long definitionId = deployProcess();
     long instanceId = launchProcess(definitionId);
     signal(instanceId);
     assertTrue(hasEnded(instanceId));
   }
 
-  public void testServiceTxRollback() throws Exception {
+  public void testServiceTxRollback() throws Exception
+  {
     rollback = true;
     long definitionId = deployProcess();
     long instanceId = launchProcess(definitionId);
@@ -76,134 +83,170 @@
     assertFalse(hasEnded(instanceId));
   }
 
-  private long deployProcess() throws Exception {
-    if (definitionId == 0) {
-      try {
-        if (tx != null) tx.begin();
+  private long deployProcess() throws Exception
+  {
+    if (definitionId == 0)
+    {
+      try
+      {
+        if (tx != null)
+          tx.begin();
         JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
-        try {
+        try
+        {
           assertEquals(tx == null, isTxCreatedByService(jbpmContext));
-          ProcessDefinition definition = ProcessDefinition.parseXmlString("<process-definition name='tx'>"
-              + "  <start-state name='start'>"
-              + "    <transition to='midway' />"
-              + "  </start-state>"
-              + "  <state name='midway'>"
-              + "    <transition to='end' />"
-              + "  </state>"
-              + "  <end-state name='end' />"
-              + "</process-definition>");
+          ProcessDefinition definition = ProcessDefinition.parseXmlString("<process-definition name='tx'>" + "  <start-state name='start'>"
+              + "    <transition to='midway' />" + "  </start-state>" + "  <state name='midway'>" + "    <transition to='end' />" + "  </state>"
+              + "  <end-state name='end' />" + "</process-definition>");
           jbpmContext.deployProcessDefinition(definition);
           definitionId = definition.getId();
         }
-        catch (RuntimeException e) {
-          if (tx == null) jbpmContext.setRollbackOnly();
+        catch (RuntimeException e)
+        {
+          if (tx == null)
+            jbpmContext.setRollbackOnly();
           throw e;
         }
-        finally {
+        finally
+        {
           jbpmContext.close();
         }
-        if (tx != null) tx.commit();
+        if (tx != null)
+          tx.commit();
       }
-      catch (Exception e) {
-        if (tx != null) tx.rollback();
+      catch (Exception e)
+      {
+        if (tx != null)
+          tx.rollback();
         throw e;
       }
     }
     return definitionId;
   }
 
-  private long launchProcess(long definitionId) throws Exception {
-    try {
-      if (tx != null) tx.begin();
+  private long launchProcess(long definitionId) throws Exception
+  {
+    try
+    {
+      if (tx != null)
+        tx.begin();
       JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
       ProcessInstance instance;
-      try {
+      try
+      {
         assertEquals(tx == null, isTxCreatedByService(jbpmContext));
-        ProcessDefinition definition = jbpmContext.getGraphSession().loadProcessDefinition(
-            definitionId);
+        ProcessDefinition definition = jbpmContext.getGraphSession().loadProcessDefinition(definitionId);
         instance = new ProcessInstance(definition);
         instance.signal();
         jbpmContext.save(instance);
       }
-      catch (RuntimeException e) {
-        if (tx == null) jbpmContext.setRollbackOnly();
+      catch (RuntimeException e)
+      {
+        if (tx == null)
+          jbpmContext.setRollbackOnly();
         throw e;
       }
-      finally {
+      finally
+      {
         jbpmContext.close();
       }
-      if (tx != null) tx.commit();
+      if (tx != null)
+        tx.commit();
       return instance.getId();
     }
-    catch (Exception e) {
-      if (tx != null) tx.rollback();
+    catch (Exception e)
+    {
+      if (tx != null)
+        tx.rollback();
       throw e;
     }
   }
 
-  private void signal(long instanceId) throws Exception {
-    try {
-      if (tx != null) tx.begin();
+  private void signal(long instanceId) throws Exception
+  {
+    try
+    {
+      if (tx != null)
+        tx.begin();
       JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
-      try {
+      try
+      {
         assertEquals(tx == null, isTxCreatedByService(jbpmContext));
         ProcessInstance instance = jbpmContext.loadProcessInstanceForUpdate(instanceId);
         instance.signal();
-        if (rollback && tx == null) jbpmContext.setRollbackOnly();
+        if (rollback && tx == null)
+          jbpmContext.setRollbackOnly();
       }
-      catch (RuntimeException e) {
-        if (tx == null) jbpmContext.setRollbackOnly();
+      catch (RuntimeException e)
+      {
+        if (tx == null)
+          jbpmContext.setRollbackOnly();
         throw e;
       }
-      finally {
+      finally
+      {
         jbpmContext.close();
       }
-      if (tx != null) {
-        if (rollback) 
+      if (tx != null)
+      {
+        if (rollback)
           tx.rollback();
         else
           tx.commit();
       }
     }
-    catch (Exception e) {
-      if (tx != null) tx.rollback();
+    catch (Exception e)
+    {
+      if (tx != null)
+        tx.rollback();
       throw e;
     }
   }
 
-  private boolean hasEnded(long instanceId) throws Exception {
-    try {
-      if (tx != null) tx.begin();
+  private boolean hasEnded(long instanceId) throws Exception
+  {
+    try
+    {
+      if (tx != null)
+        tx.begin();
       JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
       ProcessInstance instance;
-      try {
+      try
+      {
         assertEquals(tx == null, isTxCreatedByService(jbpmContext));
         instance = jbpmContext.loadProcessInstanceForUpdate(instanceId);
       }
-      catch (RuntimeException e) {
-        if (tx == null) jbpmContext.setRollbackOnly();
+      catch (RuntimeException e)
+      {
+        if (tx == null)
+          jbpmContext.setRollbackOnly();
         throw e;
       }
-      finally {
+      finally
+      {
         jbpmContext.close();
       }
-      if (tx != null) tx.commit();
+      if (tx != null)
+        tx.commit();
       return instance.hasEnded();
     }
-    catch (Exception e) {
-      if (tx != null) tx.rollback();
+    catch (Exception e)
+    {
+      if (tx != null)
+        tx.rollback();
       throw e;
     }
   }
 
-  private boolean isTxCreatedByService(JbpmContext jbpmContext) {
-    JtaDbPersistenceService persistenceService = (JtaDbPersistenceService) jbpmContext.getServices()
-        .getPersistenceService();
+  private boolean isTxCreatedByService(JbpmContext jbpmContext)
+  {
+    JtaDbPersistenceService persistenceService = (JtaDbPersistenceService)jbpmContext.getServices().getPersistenceService();
     return persistenceService.isJtaTxCreated();
   }
 
-  private static UserTransaction getUserTransaction() throws NamingException {
+  private static UserTransaction getUserTransaction() throws NamingException
+  {
     Context initial = new InitialContext();
-    return (UserTransaction) initial.lookup("java:comp/UserTransaction");
+    return (UserTransaction)initial.lookup("java:comp/UserTransaction");
   }
 }

Modified: jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/scheduler/ejbtimer/EjbSchedulerTest.java
===================================================================
--- jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/scheduler/ejbtimer/EjbSchedulerTest.java	2008-10-10 07:54:54 UTC (rev 2517)
+++ jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/scheduler/ejbtimer/EjbSchedulerTest.java	2008-10-10 07:55:40 UTC (rev 2518)
@@ -31,10 +31,9 @@
 import org.apache.cactus.ServletTestCase;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
-import org.jboss.bpm.test.IntegrationTestSetup;
 import org.jbpm.EventCallback;
 import org.jbpm.JbpmContext;
+import org.jbpm.api.test.IntegrationTestSetup;
 import org.jbpm.command.Command;
 import org.jbpm.command.DeployProcessCommand;
 import org.jbpm.command.StartProcessInstanceCommand;
@@ -47,9 +46,11 @@
 
 /**
  * Exercises for the {@linkplain EntitySchedulerService EJB scheduler service}.
+ * 
  * @author Alejandro Guizar
  */
-public class EjbSchedulerTest extends ServletTestCase {
+public class EjbSchedulerTest extends ServletTestCase
+{
 
   private LocalCommandService commandService;
 
@@ -57,17 +58,22 @@
 
   private static final Log log = LogFactory.getLog(EjbSchedulerTest.class);
 
-  public static Test suite() throws Exception {
+  public static Test suite() throws Exception
+  {
     return new IntegrationTestSetup(EjbSchedulerTest.class, "enterprise-test.war");
   }
 
-  protected void setUp() throws Exception {
-    if (commandServiceHome == null) {
+  protected void setUp() throws Exception
+  {
+    if (commandServiceHome == null)
+    {
       Context initialContext = new InitialContext();
-      try {
-        commandServiceHome = (LocalCommandServiceHome) initialContext.lookup("java:comp/env/ejb/CommandServiceBean");
+      try
+      {
+        commandServiceHome = (LocalCommandServiceHome)initialContext.lookup("java:comp/env/ejb/CommandServiceBean");
       }
-      finally {
+      finally
+      {
         initialContext.close();
       }
     }
@@ -75,65 +81,42 @@
     log.info("### " + getName() + " started ###");
   }
 
-  protected void tearDown() throws Exception {
+  protected void tearDown() throws Exception
+  {
     log.info("### " + getName() + " done ###");
     commandService = null;
   }
 
-  public void testScheduleFuture() throws Exception {
-    deployProcess("<process-definition name='future'>"
-        + "  <event type='process-end'>"
-        + "    <action expression='#{eventCallback.processEnd}'/>"
-        + "  </event>"
-        + "  <start-state name='start'>"
-        + "    <transition to='a' />"
-        + "  </start-state>"
-        + "  <state name='a'>"
-        + "    <timer duedate='1 second' transition='timeout' />"
-        + "    <transition name='timeout' to='end' />"
-        + "  </state>"
-        + "  <end-state name='end' />"
+  public void testScheduleFuture() throws Exception
+  {
+    deployProcess("<process-definition name='future'>" + "  <event type='process-end'>" + "    <action expression='#{eventCallback.processEnd}'/>" + "  </event>"
+        + "  <start-state name='start'>" + "    <transition to='a' />" + "  </start-state>" + "  <state name='a'>"
+        + "    <timer duedate='1 second' transition='timeout' />" + "    <transition name='timeout' to='end' />" + "  </state>" + "  <end-state name='end' />"
         + "</process-definition>");
     long processId = launchProcess("future").getId();
     EventCallback.waitForEvent(Event.EVENTTYPE_PROCESS_END);
     assertTrue(isProcessFinished(processId));
   }
 
-  public void testSchedulePast() throws Exception {
-    deployProcess("<process-definition name='past'>"
-        + "  <event type='process-end'>"
-        + "    <action expression='#{eventCallback.processEnd}'/>"
-        + "  </event>"
-        + "  <start-state name='start'>"
-        + "    <transition to='a' />"
-        + "  </start-state>"
-        + "  <state name='a'>"
-        + "    <timer duedate='-1 second' transition='timeout' />"
-        + "    <transition name='timeout' to='end' />"
-        + "  </state>"
-        + "  <end-state name='end' />"
+  public void testSchedulePast() throws Exception
+  {
+    deployProcess("<process-definition name='past'>" + "  <event type='process-end'>" + "    <action expression='#{eventCallback.processEnd}'/>" + "  </event>"
+        + "  <start-state name='start'>" + "    <transition to='a' />" + "  </start-state>" + "  <state name='a'>"
+        + "    <timer duedate='-1 second' transition='timeout' />" + "    <transition name='timeout' to='end' />" + "  </state>" + "  <end-state name='end' />"
         + "</process-definition>");
     long processId = launchProcess("past").getId();
     EventCallback.waitForEvent(Event.EVENTTYPE_PROCESS_END);
     assertTrue(isProcessFinished(processId));
   }
 
-  public void testScheduleRepeat() throws Exception {
-    deployProcess("<process-definition name='repeat'>"
-        + "  <event type='timer'>"
-        + "    <action expression='#{eventCallback.timer}'/>"
-        + "  </event>"
-        + "  <start-state name='start'>"
-        + "    <transition to='a' />"
-        + "  </start-state>"
-        + "  <state name='a'>"
-        + "    <timer duedate='1 second' repeat='1 second' />"
-        + "    <transition to='end' />"
-        + "  </state>"
-        + "  <end-state name='end' />"
-        + "</process-definition>");
+  public void testScheduleRepeat() throws Exception
+  {
+    deployProcess("<process-definition name='repeat'>" + "  <event type='timer'>" + "    <action expression='#{eventCallback.timer}'/>" + "  </event>"
+        + "  <start-state name='start'>" + "    <transition to='a' />" + "  </start-state>" + "  <state name='a'>"
+        + "    <timer duedate='1 second' repeat='1 second' />" + "    <transition to='end' />" + "  </state>" + "  <end-state name='end' />" + "</process-definition>");
     long processId = launchProcess("repeat").getId();
-    for (int i = 0; i < 3; i++) {
+    for (int i = 0; i < 3; i++)
+    {
       EventCallback.waitForEvent(Event.EVENTTYPE_TIMER);
       assertEquals("a", getProcessState(processId));
     }
@@ -141,20 +124,11 @@
     assertTrue(isProcessFinished(processId));
   }
 
-  public void testCancel() throws Exception {
-    deployProcess("<process-definition name='cancel'>"
-        + "  <event type='timer'>"
-        + "    <action expression='#{eventCallback.timer}'/>"
-        + "  </event>"
-        + "  <start-state name='start'>"
-        + "    <transition to='a' />"
-        + "  </start-state>"
-        + "  <state name='a'>"
-        + "    <timer duedate='1 second' repeat='1 second' />"
-        + "    <transition to='end' />"
-        + "  </state>"
-        + "  <end-state name='end' />"
-        + "</process-definition>");
+  public void testCancel() throws Exception
+  {
+    deployProcess("<process-definition name='cancel'>" + "  <event type='timer'>" + "    <action expression='#{eventCallback.timer}'/>" + "  </event>"
+        + "  <start-state name='start'>" + "    <transition to='a' />" + "  </start-state>" + "  <state name='a'>"
+        + "    <timer duedate='1 second' repeat='1 second' />" + "    <transition to='end' />" + "  </state>" + "  <end-state name='end' />" + "</process-definition>");
     ProcessInstance process = launchProcess("cancel");
     long processId = process.getId();
     // first expiration
@@ -170,42 +144,20 @@
     assertTrue(isProcessFinished(processId));
   }
 
-  public void testScheduleSequence() throws Exception {
-    deployProcess("<process-definition name='sequence'>"
-        + "  <event type='process-end'>"
-        + "    <action expression='#{eventCallback.processEnd}'/>"
-        + "  </event>"
-        + "  <event type='timer'>"
-        + "    <action expression='#{eventCallback.timer}'/>"
-        + "  </event>"
-        + "  <start-state>"
-        + "    <transition to='a' />"
-        + "  </start-state>"
-        + "  <state name='a'>"
-        + "    <timer duedate='500 milliseconds' transition='timeout' />"
-        + "    <transition name='timeout' to='b' />"
-        + "  </state>"
-        + "  <state name='b'>"
-        + "    <timer duedate='500 milliseconds' transition='timeout' />"
-        + "    <transition name='timeout' to='c' />"
-        + "  </state>"
-        + "  <state name='c'>"
-        + "    <timer duedate='500 milliseconds' transition='timeout' />"
-        + "    <transition name='timeout' to='d' />"
-        + "  </state>"
-        + "  <state name='d'>"
-        + "    <timer duedate='500 milliseconds' transition='timeout' />"
-        + "    <transition name='timeout' to='e' />"
-        + "  </state>"
-        + "  <state name='e'>"
-        + "    <timer duedate='500 milliseconds' transition='timeout' />"
-        + "    <transition name='timeout' to='end' />"
-        + "  </state>"
-        + "  <end-state name='end' />"
-        + "</process-definition>");
+  public void testScheduleSequence() throws Exception
+  {
+    deployProcess("<process-definition name='sequence'>" + "  <event type='process-end'>" + "    <action expression='#{eventCallback.processEnd}'/>" + "  </event>"
+        + "  <event type='timer'>" + "    <action expression='#{eventCallback.timer}'/>" + "  </event>" + "  <start-state>" + "    <transition to='a' />"
+        + "  </start-state>" + "  <state name='a'>" + "    <timer duedate='500 milliseconds' transition='timeout' />" + "    <transition name='timeout' to='b' />"
+        + "  </state>" + "  <state name='b'>" + "    <timer duedate='500 milliseconds' transition='timeout' />" + "    <transition name='timeout' to='c' />"
+        + "  </state>" + "  <state name='c'>" + "    <timer duedate='500 milliseconds' transition='timeout' />" + "    <transition name='timeout' to='d' />"
+        + "  </state>" + "  <state name='d'>" + "    <timer duedate='500 milliseconds' transition='timeout' />" + "    <transition name='timeout' to='e' />"
+        + "  </state>" + "  <state name='e'>" + "    <timer duedate='500 milliseconds' transition='timeout' />" + "    <transition name='timeout' to='end' />"
+        + "  </state>" + "  <end-state name='end' />" + "</process-definition>");
     long processId = launchProcess("sequence").getId();
     char state = 'b';
-    for (int i = 0; i < 4; i++) {
+    for (int i = 0; i < 4; i++)
+    {
       EventCallback.waitForEvent(Event.EVENTTYPE_TIMER);
       assertEquals(Character.toString(state++), getProcessState(processId));
     }
@@ -213,95 +165,84 @@
     assertTrue(isProcessFinished(processId));
   }
 
-  public void testScheduleFork() throws InterruptedException {
-    deployProcess("<process-definition name='fork'>"
-        + "  <event type='process-end'>"
-        + "    <action expression='#{eventCallback.processEnd}'/>"
-        + "  </event>"
-        + "  <start-state>"
-        + "    <transition to='f' />"
-        + "  </start-state>"
-        + "  <fork name='f'>"
-        + "    <transition name='a' to='a' />"
-        + "    <transition name='b' to='b' />"
-        + "    <transition name='c' to='c' />"
-        + "    <transition name='d' to='d' />"
-        + "    <transition name='e' to='e' />"
-        + "  </fork>"
-        + "  <state name='a'>"
-        + "    <timer duedate='0.25 seconds' transition='timeout' />"
-        + "    <transition name='timeout' to='j' />"
-        + "  </state>"
-        + "  <state name='b'>"
-        + "    <timer duedate='0.5 seconds' transition='timeout' />"
-        + "    <transition name='timeout' to='j' />"
-        + "  </state>"
-        + "  <state name='c'>"
-        + "    <timer duedate='0.75 seconds' transition='timeout' />"
-        + "    <transition name='timeout' to='j' />"
-        + "  </state>"
-        + "  <state name='d'>"
-        + "    <timer duedate='1 second' transition='timeout' />"
-        + "    <transition name='timeout' to='j' />"
-        + "  </state>"
-        + "  <state name='e'>"
-        + "    <timer duedate='1.25 second' transition='timeout' />"
-        + "    <transition name='timeout' to='j' />"
-        + "  </state>"
-        + "  <join name='j'>"
-        + "    <transition to='end' />"
-        + "  </join>"
-        + "  <end-state name='end' />"
-        + "</process-definition>");
+  public void testScheduleFork() throws InterruptedException
+  {
+    deployProcess("<process-definition name='fork'>" + "  <event type='process-end'>" + "    <action expression='#{eventCallback.processEnd}'/>" + "  </event>"
+        + "  <start-state>" + "    <transition to='f' />" + "  </start-state>" + "  <fork name='f'>" + "    <transition name='a' to='a' />"
+        + "    <transition name='b' to='b' />" + "    <transition name='c' to='c' />" + "    <transition name='d' to='d' />" + "    <transition name='e' to='e' />"
+        + "  </fork>" + "  <state name='a'>" + "    <timer duedate='0.25 seconds' transition='timeout' />" + "    <transition name='timeout' to='j' />" + "  </state>"
+        + "  <state name='b'>" + "    <timer duedate='0.5 seconds' transition='timeout' />" + "    <transition name='timeout' to='j' />" + "  </state>"
+        + "  <state name='c'>" + "    <timer duedate='0.75 seconds' transition='timeout' />" + "    <transition name='timeout' to='j' />" + "  </state>"
+        + "  <state name='d'>" + "    <timer duedate='1 second' transition='timeout' />" + "    <transition name='timeout' to='j' />" + "  </state>"
+        + "  <state name='e'>" + "    <timer duedate='1.25 second' transition='timeout' />" + "    <transition name='timeout' to='j' />" + "  </state>"
+        + "  <join name='j'>" + "    <transition to='end' />" + "  </join>" + "  <end-state name='end' />" + "</process-definition>");
     long processId = launchProcess("fork").getId();
     EventCallback.waitForEvent(Event.EVENTTYPE_PROCESS_END);
     assertTrue(isProcessFinished(processId));
   }
 
-  private ProcessDefinition deployProcess(String xml) {
-    return (ProcessDefinition) commandService.execute(new DeployProcessCommand(xml));
+  private ProcessDefinition deployProcess(String xml)
+  {
+    return (ProcessDefinition)commandService.execute(new DeployProcessCommand(xml));
   }
 
-  private ProcessInstance launchProcess(String processName) {
+  private ProcessInstance launchProcess(String processName)
+  {
     StartProcessInstanceCommand command = new StartProcessInstanceCommand();
     command.setProcessName(processName);
     command.setVariables(Collections.singletonMap("eventCallback", new EventCallback()));
-    return (ProcessInstance) commandService.execute(command);
+    return (ProcessInstance)commandService.execute(command);
   }
 
-  private void signalProcess(final long processId) {
-    commandService.execute(new Command() {
+  private void signalProcess(final long processId)
+  {
+    commandService.execute(new Command()
+    {
       private static final long serialVersionUID = 1L;
-      public Object execute(JbpmContext jbpmContext) throws Exception {
+
+      public Object execute(JbpmContext jbpmContext) throws Exception
+      {
         jbpmContext.loadProcessInstanceForUpdate(processId).signal();
         return null;
       }
     });
   }
 
-  private String getProcessState(final long processId) {
-    return (String) commandService.execute(new Command() {
+  private String getProcessState(final long processId)
+  {
+    return (String)commandService.execute(new Command()
+    {
       private static final long serialVersionUID = 1L;
-      public Object execute(JbpmContext jbpmContext) throws Exception {
+
+      public Object execute(JbpmContext jbpmContext) throws Exception
+      {
         return jbpmContext.loadProcessInstance(processId).getRootToken().getNode().getName();
       }
     });
   }
 
-  private boolean isProcessFinished(final long processId) {
-    Boolean isFinished = (Boolean) commandService.execute(new Command() {
+  private boolean isProcessFinished(final long processId)
+  {
+    Boolean isFinished = (Boolean)commandService.execute(new Command()
+    {
       private static final long serialVersionUID = 1L;
-      public Object execute(JbpmContext jbpmContext) throws Exception {
+
+      public Object execute(JbpmContext jbpmContext) throws Exception
+      {
         return jbpmContext.loadProcessInstance(processId).hasEnded();
       }
     });
     return isFinished.booleanValue();
   }
 
-  private void cancelTimer(final String timerName, final long tokenId) {
-    commandService.execute(new Command() {
+  private void cancelTimer(final String timerName, final long tokenId)
+  {
+    commandService.execute(new Command()
+    {
       private static final long serialVersionUID = 1L;
-      public Object execute(JbpmContext jbpmContext) throws Exception {
+
+      public Object execute(JbpmContext jbpmContext) throws Exception
+      {
         Token token = jbpmContext.loadToken(tokenId);
         jbpmContext.getServices().getSchedulerService().deleteTimersByName(timerName, token);
         return null;

Modified: jbpm3/trunk/pom.xml
===================================================================
--- jbpm3/trunk/pom.xml	2008-10-10 07:54:54 UTC (rev 2517)
+++ jbpm3/trunk/pom.xml	2008-10-10 07:55:40 UTC (rev 2518)
@@ -75,7 +75,7 @@
     <oscache.version>2.4</oscache.version>
     <poi.version>3.0.2-FINAL</poi.version>
     <richfaces.ui.version>3.2.1.GA</richfaces.ui.version>
-    <slf4j.version>1.5.2</slf4j.version>
+    <slf4j.version>1.5.3</slf4j.version>
     <sun.facelets.version>1.1.14</sun.facelets.version>
 
     <!-- Database Driver Versions  -->
@@ -89,17 +89,11 @@
     <dependencies>
       <!-- jBPM Dependencies -->
       <dependency>
-        <groupId>org.jbpm.spec</groupId>
+        <groupId>org.jbpm.jbpm4</groupId>
         <artifactId>jbpm-spec-api</artifactId>
         <version>${jbpm.api.version}</version>
       </dependency>
       <dependency>
-        <groupId>org.jbpm.spec</groupId>
-        <artifactId>jbpm-spec-cts</artifactId>
-        <version>${jbpm.api.version}</version>
-        <type>zip</type>
-      </dependency>
-      <dependency>
         <groupId>org.jbpm</groupId>
         <artifactId>jbpm-jpdl-designer</artifactId>
         <version>${jboss.jbpm.designer.version}</version>




More information about the jbpm-commits mailing list