[jbpm-commits] JBoss JBPM SVN: r1913 - jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/parallel.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Aug 18 02:56:19 EDT 2008


Author: thomas.diesler at jboss.com
Date: 2008-08-18 02:56:19 -0400 (Mon, 18 Aug 2008)
New Revision: 1913

Removed:
   jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelMergeAPITest.java
   jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelMergeTest.java
   jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelSplitAPITest.java
   jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelSplitTest.java
Log:
Remove stale tests

Deleted: jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelMergeAPITest.java
===================================================================
--- jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelMergeAPITest.java	2008-08-17 21:03:51 UTC (rev 1912)
+++ jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelMergeAPITest.java	2008-08-18 06:56:19 UTC (rev 1913)
@@ -1,56 +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.cts.gateway.parallel;
-
-//$Id$
-
-import java.io.StringWriter;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-
-/**
- * ParallelMergeTest using the API Descriptor
- * 
- * @author thomas.diesler at jboss.com
- * @since 06-Aug-2008
- */
-public class ParallelMergeAPITest extends ParallelMergeTest
-{
-  @Override
-  public Process getProcess()
-  {
-    Process proc = super.getProcess();
-    
-    // Marshall the process to a string
-    StringWriter strwr = new StringWriter();
-    marshallProcess(proc, strwr);
-    String procXML = strwr.toString();
-
-    // Recreate the process from the marshalled process
-    ProcessManager procManager = ProcessManager.locateProcessManager();
-    proc = procManager.createProcess(procXML);
-    
-    return proc;
-  }
-}

Deleted: jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelMergeTest.java
===================================================================
--- jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelMergeTest.java	2008-08-17 21:03:51 UTC (rev 1912)
+++ jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelMergeTest.java	2008-08-18 06:56:19 UTC (rev 1913)
@@ -1,203 +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.cts.gateway.parallel;
-
-// $Id$
-
-import org.jboss.bpm.client.SignalListener;
-import org.jboss.bpm.client.SignalManager;
-import org.jboss.bpm.model.EventBuilder;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.model.Gateway.GatewayType;
-import org.jboss.bpm.model.Signal.SignalType;
-import org.jboss.bpm.runtime.ExecutionContext;
-import org.jboss.bpm.runtime.ExecutionHandler;
-import org.jboss.bpm.runtime.Token;
-import org.jboss.bpm.test.DefaultEngineTestCase;
-
-/**
- * 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 ParallelMergeTest extends DefaultEngineTestCase
-{
-  public void testParallelMerge() throws Exception
-  {
-    Process proc = getProcess();
-    proc.startProcess();
-
-    // Add a signal listener that sends the other start trigger signal
-    SignalManager signalManager = SignalManager.locateSignalManager();
-    Signal startTrigger = new Signal(getName(), SignalType.SYSTEM_START_TRIGGER, "B");
-    signalManager.addSignalListener(getName(), new MergeListener(getName(), startTrigger));
-
-    // Send start trigger signal
-    signalManager.throwSignal(proc.getName(), new Signal(getName(), SignalType.SYSTEM_START_TRIGGER, "A"));
-
-    // Wait for the process to end
-    proc.waitForEnd();
-
-    // Verify the result
-    assertEquals("TaskA:TaskB", TaskC.taskValue);
-  }
-
-  public void testMergeTimeout() throws Exception
-  {
-    Process proc = getProcess();
-    proc.startProcess();
-
-    // Send start trigger signal
-    SignalManager signalManager = SignalManager.locateSignalManager();
-    signalManager.throwSignal(proc.getName(), new Signal(getName(), SignalType.SYSTEM_START_TRIGGER, "A"));
-
-    // Wait for the process to end
-    try
-    {
-      proc.waitForEnd(1000);
-      fail("timeout expected");
-    }
-    catch (RuntimeException rte)
-    {
-      // expected
-    }
-  }
-
-  public void testInvalidToken() throws Exception
-  {
-    Process proc = getProcess();
-    proc.startProcess();
-
-    // Add a signal listener that sends the other start trigger signal
-    SignalManager signalManager = SignalManager.locateSignalManager();
-    Signal startTrigger = new Signal(getName(), SignalType.SYSTEM_START_TRIGGER, "A");
-    signalManager.addSignalListener(getName(), new MergeListener(getName(), startTrigger));
-
-    // Send start trigger signal
-    signalManager.throwSignal(proc.getName(), new Signal(getName(), SignalType.SYSTEM_START_TRIGGER, "A"));
-
-    try
-    {
-      proc.waitForEnd();
-      fail("Expected: Unexpected token from: SequenceFlow[TaskA->Merge]");
-    }
-    catch (RuntimeException rte)
-    {
-      // expected
-    }
-
-    // Restart the process
-    proc.startProcess();
-    
-    // Add a signal listener that sends the other start trigger signal
-    startTrigger = new Signal(getName(), SignalType.SYSTEM_START_TRIGGER, "B");
-    signalManager.addSignalListener(getName(), new MergeListener(getName(), startTrigger));
-
-    // Send start trigger signal
-    signalManager.throwSignal(proc.getName(), new Signal(getName(), SignalType.SYSTEM_START_TRIGGER, "A"));
-
-    // Wait for the process to end
-    proc.waitForEnd();
-
-    // Verify the result
-    assertEquals("TaskA:TaskB", TaskC.taskValue);
-  }
-
-  public Process getProcess()
-  {
-    ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
-    EventBuilder eventBuilder = procBuilder.addProcess(getName()).addStartEvent("StartA");
-    eventBuilder.addSignalTrigger(SignalType.SYSTEM_START_TRIGGER, "A").addSequenceFlow("TaskA");
-    procBuilder.addTask("TaskA").addExecutionHandler(TaskA.class).addSequenceFlow("Merge");
-    eventBuilder = procBuilder.addStartEvent("StartB");
-    eventBuilder.addSignalTrigger(SignalType.SYSTEM_START_TRIGGER, "B").addSequenceFlow("TaskB");
-    procBuilder.addTask("TaskB").addExecutionHandler(TaskB.class).addSequenceFlow("Merge");
-    procBuilder.addGateway("Merge", GatewayType.Parallel).addSequenceFlow("TaskC");
-    procBuilder.addTask("TaskC").addExecutionHandler(TaskC.class).addSequenceFlow("End");
-    procBuilder.addEndEvent("End");
-    Process proc = procBuilder.getProcess();
-    return proc;
-  }
-
-  public static class MergeListener implements SignalListener
-  {
-    private String fromRef;
-    private Signal nextSignal;
-
-    public MergeListener(String fromRef, Signal nextSignal)
-    {
-      this.fromRef = fromRef;
-      this.nextSignal = nextSignal;
-    }
-
-    public void catchSignal(Signal signal)
-    {
-      if (signal.getSignalType() == SignalType.SYSTEM_GATEWAY_ENTER)
-      {
-        if (nextSignal != null)
-        {
-          SignalManager signalManager = SignalManager.locateSignalManager();
-          signalManager.throwSignal(fromRef, nextSignal);
-          nextSignal = null;
-        }
-      }
-    }
-  }
-
-  @SuppressWarnings("serial")
-  public static class TaskA implements ExecutionHandler
-  {
-    public void execute(Token token)
-    {
-      ExecutionContext exContext = token.getExecutionContext();
-      exContext.addAttachment("taskA", "TaskA");
-    }
-  }
-
-  @SuppressWarnings("serial")
-  public static class TaskB implements ExecutionHandler
-  {
-    public void execute(Token token)
-    {
-      ExecutionContext exContext = token.getExecutionContext();
-      exContext.addAttachment("taskB", "TaskB");
-    }
-  }
-
-  @SuppressWarnings("serial")
-  public static class TaskC implements ExecutionHandler
-  {
-    public static Object taskValue;
-
-    public void execute(Token token)
-    {
-      ExecutionContext exContext = token.getExecutionContext();
-      taskValue = exContext.getAttachment("taskA") + ":" + exContext.getAttachment("taskB");
-    }
-  }
-}

Deleted: jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelSplitAPITest.java
===================================================================
--- jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelSplitAPITest.java	2008-08-17 21:03:51 UTC (rev 1912)
+++ jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelSplitAPITest.java	2008-08-18 06:56:19 UTC (rev 1913)
@@ -1,55 +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.cts.gateway.parallel;
-
-// $Id$
-
-import java.io.StringWriter;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * ParallelSplitTest using the API Descriptor
- * 
- * @author thomas.diesler at jboss.com
- * @since 06-Aug-2008
- */
-public class ParallelSplitAPITest extends ParallelSplitTest
-{
-  @Override
-  public Process getProcess()
-  {
-    Process proc = super.getProcess();
-    
-    // Marshall the process to a string
-    StringWriter strwr = new StringWriter();
-    marshallProcess(proc, strwr);
-    String procXML = strwr.toString();
-
-    // Recreate the process from the marshalled process
-    ProcessManager procManager = ProcessManager.locateProcessManager();
-    proc = procManager.createProcess(procXML);
-    
-    return proc;
-  }
-}

Deleted: jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelSplitTest.java
===================================================================
--- jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelSplitTest.java	2008-08-17 21:03:51 UTC (rev 1912)
+++ jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelSplitTest.java	2008-08-18 06:56:19 UTC (rev 1913)
@@ -1,66 +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.cts.gateway.parallel;
-
-// $Id$
-
-import java.util.List;
-
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.model.Gateway.GatewayType;
-import org.jboss.bpm.model.Signal.SignalType;
-import org.jboss.bpm.test.DefaultEngineTestCase;
-
-/**
- * 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 DefaultEngineTestCase
-{
-  public void testParallelSplit() throws Exception 
-  {
-    Process proc = getProcess();
-    proc.startProcess();
-    proc.waitForEnd();
-    
-    // Validate received signals
-    List<Signal> signals = getSignals(SignalType.SYSTEM_END_EVENT_ENTER);
-    assertEquals(2, signals.size());
-    String fromRefs = signals.get(0).getFromRef() + signals.get(1).getFromRef();
-    assertTrue("Unexpected from refs: " + fromRefs, fromRefs.contains("EndA"));
-    assertTrue("Unexpected from refs: " + fromRefs, fromRefs.contains("EndB"));
-  }
-
-  public Process getProcess()
-  {
-    ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
-    Process proc = procBuilder.addProcess(getName()).addStartEvent("Start").addSequenceFlow("Split").addGateway("Split", GatewayType.Parallel).
-    addSequenceFlow("EndA").addSequenceFlow("EndB").addEndEvent("EndA").addEndEvent("EndB").getProcess();
-    return proc;
-  }
-}




More information about the jbpm-commits mailing list