JBoss JBPM SVN: r2479 - jbpm3/trunk/modules/gwt-console/war.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-10-06 04:22:39 -0400 (Mon, 06 Oct 2008)
New Revision: 2479
Modified:
jbpm3/trunk/modules/gwt-console/war/pom.xml
Log:
Fix compile time dependencies
Modified: jbpm3/trunk/modules/gwt-console/war/pom.xml
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/pom.xml 2008-10-04 14:22:42 UTC (rev 2478)
+++ jbpm3/trunk/modules/gwt-console/war/pom.xml 2008-10-06 08:22:39 UTC (rev 2479)
@@ -24,12 +24,6 @@
</dependency>
<dependency>
- <groupId>org.jbpm.jbpm3</groupId>
- <artifactId>gwt-console-server</artifactId>
- <version>${version}</version>
- </dependency>
-
- <dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>${gwt.version}</version>
@@ -64,8 +58,19 @@
<groupId>com.google.gwt</groupId>
<artifactId>gchart</artifactId>
</dependency>
- </dependencies>
+<dependency>
+ <groupId>javax.xml.stream</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>1.0-2</version>
+</dependency>
+ <dependency>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ <version>1.1</version>
+</dependency>
+
+</dependencies>
<!-- Plugins -->
<build>
<plugins>
17 years, 7 months
JBoss JBPM SVN: r2478 - in projects/spec/trunk/modules: cts/src/test/java/org/jbpm/test/cts/startevent and 2 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-10-04 10:22:42 -0400 (Sat, 04 Oct 2008)
New Revision: 2478
Modified:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Event.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/startevent/StartEventSignalTest.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EndEventImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessDefinitionImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessStructureImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StartEventImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessDefinitionServiceImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java
Log:
Signal StartEvent creates new process instance
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Event.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Event.java 2008-10-04 12:59:53 UTC (rev 2477)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Event.java 2008-10-04 14:22:42 UTC (rev 2478)
@@ -55,6 +55,11 @@
EventType getEventType();
/**
+ * Get the detail type fopr this event
+ */
+ EventDetailType getDetailType();
+
+ /**
* Get the associated signal ref
*/
Signal getSignalRef();
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/startevent/StartEventSignalTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/startevent/StartEventSignalTest.java 2008-10-04 12:59:53 UTC (rev 2477)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/startevent/StartEventSignalTest.java 2008-10-04 14:22:42 UTC (rev 2478)
@@ -24,8 +24,10 @@
// $Id$
import java.io.IOException;
-import java.util.List;
+import java.util.Set;
+import javax.management.ObjectName;
+
import org.jbpm.api.client.SignalListener;
import org.jbpm.api.model.Message;
import org.jbpm.api.model.Process;
@@ -40,6 +42,8 @@
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.model.builder.ProcessBuilderService;
import org.jbpm.api.model.builder.TaskBuilder;
+import org.jbpm.api.service.ProcessDefinitionService;
+import org.jbpm.api.service.ProcessService;
import org.jbpm.api.service.SignalService;
import org.jbpm.api.test.CTSTestCase;
@@ -54,81 +58,38 @@
public void testStart() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+
+ // You need to register the process definition to activate the start trigger
+ ProcessDefinitionService procDefService = ProcessDefinitionService.locateProcessDefinitionService();
+ procDefService.registerProcessDefinition(procDef);
- proc.startProcess();
-
- // Send start trigger signal
- SignalService sigService = SignalService.locateSignalService();
- sigService.throwSignal(new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "A"));
-
- // Wait for the process to end
- proc.waitForEnd();
-
- // Verify the result
- Message endMessage = getMessages().get(0);
- assertEquals("TaskA", endMessage.getProperty("taskValue").getValue());
- }
-
- public void testRestart() throws Exception
- {
- ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
Process proc = procDef.newInstance();
-
- // Start the process and send start trigger signal
- proc.startProcess();
- SignalService sigService = SignalService.locateSignalService();
- sigService.throwSignal(new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "A"));
-
- // Wait for the process to end
- proc.waitForEnd();
-
try
{
proc.startProcess();
- fail("Cannot start process in state: Completed");
+ fail("Cannot obtain StartEvent.None to start the process explicitly");
}
catch (IllegalStateException ex)
{
// expected
}
- // Verify the result
- List<Message> messages = getMessages();
- assertEquals(1, messages.size());
- assertEquals("TaskA", messages.get(0).getProperty("taskValue").getValue());
- }
+ // Send start trigger signal
+ SignalService sigService = SignalService.locateSignalService();
+ sigService.throwSignal(new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "A"));
- public void testRestartBeforeEnd() throws Exception
- {
- ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
-
- // Add a signal listener that sends the other start trigger signal
- TaskListener sigListener = new TaskListener(new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "A"));
- SignalService sigManager = SignalService.locateSignalService();
- sigManager.addSignalListener(sigListener);
-
- try
- {
- // Start the process and send start trigger signal
- proc.startProcess();
-
- // This signal should be ignored
- sigManager.throwSignal(new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "A"));
-
- // Wait for the process to end
+ // Get the just started process
+ ProcessService procService = ProcessService.locateProcessService();
+ Set<ObjectName> procIDs = procService.getProcesses("StartEventSignal", null);
+ proc = procService.getProcess(procIDs.iterator().next());
+
+ // Wait for the process to end
+ if (proc != null)
proc.waitForEnd();
- }
- finally
- {
- sigManager.removeSignalListener(sigListener);
- }
// Verify the result
- List<Message> messages = getMessages();
- assertEquals(1, messages.size());
- assertEquals("TaskA", messages.get(0).getProperty("taskValue").getValue());
+ Message endMessage = getMessages().get(0);
+ assertEquals("TaskA", endMessage.getProperty("taskValue").getValue());
}
public ProcessDefinition getProcessDefinition() throws IOException
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EndEventImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EndEventImpl.java 2008-10-04 12:59:53 UTC (rev 2477)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EndEventImpl.java 2008-10-04 14:22:42 UTC (rev 2478)
@@ -193,9 +193,4 @@
tokenExecutor.destroy(token);
}
}
-
- public String toString()
- {
- return "EndEvent[" + getName() + "]";
- }
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java 2008-10-04 12:59:53 UTC (rev 2477)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java 2008-10-04 14:22:42 UTC (rev 2478)
@@ -96,6 +96,12 @@
}
@Override
+ public EventDetailType getDetailType()
+ {
+ return detailType;
+ }
+
+ @Override
public Message getMessageRef()
{
return messageRef;
@@ -215,4 +221,9 @@
procDefImpl.initializeMessageRef(messageRef);
}
}
+
+ public String toString()
+ {
+ return getEventType() + "Event[" + getName() + "," + getDetailType() + "]";
+ }
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessDefinitionImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessDefinitionImpl.java 2008-10-04 12:59:53 UTC (rev 2477)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessDefinitionImpl.java 2008-10-04 14:22:42 UTC (rev 2478)
@@ -63,22 +63,7 @@
public ProcessDefinitionImpl(ProcessEngine engine, ProcessStructureImpl procStruct)
{
super(engine, procStruct);
-
- // Save the raw process structure
- try
- {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.writeObject(procStruct);
- rawProcStruct = baos.toByteArray();
- }
- catch (IOException ex)
- {
- throw new IllegalStateException("Cannot serialize process structure", ex);
- }
-
- // Call the create life cycle
- procStruct.create(this);
+ create(this);
}
// Persistence ctor
@@ -147,6 +132,48 @@
}
}
+ @Override
+ protected void create(ProcessDefinition procDef)
+ {
+ super.create(procDef);
+
+ // Save the raw process structure
+ try
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ oos.writeObject(procStruct);
+ rawProcStruct = baos.toByteArray();
+ }
+ catch (IOException ex)
+ {
+ throw new IllegalStateException("Cannot serialize process structure", ex);
+ }
+
+ procStruct.create(this);
+ }
+
+ @Override
+ public void register(ProcessDefinition procDef)
+ {
+ super.register(procDef);
+ procStruct.register(procDef);
+ }
+
+ @Override
+ public void unregister(ProcessDefinition procDef)
+ {
+ super.unregister(procDef);
+ procStruct.unregister(procDef);
+ }
+
+ @Override
+ protected void destroy(ProcessDefinition procDef)
+ {
+ super.destroy(procDef);
+ procStruct.destroy(procDef);
+ }
+
public String toString()
{
return "ProcessDefinition[" + getName() + "]";
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java 2008-10-04 12:59:53 UTC (rev 2477)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java 2008-10-04 14:22:42 UTC (rev 2478)
@@ -37,6 +37,7 @@
import org.jbpm.api.model.builder.ObjectNameFactory;
import org.jbpm.api.runtime.Attachments;
import org.jbpm.api.service.ExecutionService;
+import org.jbpm.api.service.ProcessService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -67,7 +68,7 @@
{
super(engine, procStruct);
this.procDef = procDef;
- procStruct.create(this);
+ create(this);
}
// Persistence ctor
@@ -126,8 +127,18 @@
{
ProcessEngine engine = getProcessEngine();
ExecutionService exService = engine.getService(ExecutionService.class);
- exService.startProcess(this, att);
- return getKey();
+ try
+ {
+ exService.startProcess(this, att);
+ return getKey();
+ }
+ catch (RuntimeException rte)
+ {
+ // A process that cannot be started id unregistered automatically
+ ProcessService procService = getProcessEngine().getService(ProcessService.class);
+ procService.unregisterProcess(getKey());
+ throw rte;
+ }
}
public ProcessStatus waitForEnd()
@@ -153,6 +164,13 @@
}
@Override
+ protected void create(Process proc)
+ {
+ super.create(proc);
+ procStruct.create(proc);
+ }
+
+ @Override
public void register(Process proc)
{
super.register(proc);
@@ -166,6 +184,13 @@
procStruct.unregister(proc);
}
+ @Override
+ protected void destroy(Process proc)
+ {
+ super.destroy(proc);
+ procStruct.destroy(proc);
+ }
+
public String toString()
{
return "Process[" + getName() + ",status=" + getProcessStatus() + "]";
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessStructureImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessStructureImpl.java 2008-10-04 12:59:53 UTC (rev 2477)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessStructureImpl.java 2008-10-04 14:22:42 UTC (rev 2478)
@@ -268,10 +268,42 @@
}
@Override
+ protected void register(ProcessDefinition procDef)
+ {
+ super.register(procDef);
+ for (Node node : getNodes())
+ {
+ NodeImpl nodeImpl = (NodeImpl)node;
+ nodeImpl.register(procDef);
+ }
+ }
+
+ @Override
+ protected void unregister(ProcessDefinition procDef)
+ {
+ super.unregister(procDef);
+ for (Node node : getNodes())
+ {
+ NodeImpl nodeImpl = (NodeImpl)node;
+ nodeImpl.unregister(procDef);
+ }
+ }
+
+ @Override
+ protected void destroy(ProcessDefinition procDef)
+ {
+ super.destroy(procDef);
+ for (Node node : getNodes())
+ {
+ NodeImpl nodeImpl = (NodeImpl)node;
+ nodeImpl.destroy(procDef);
+ }
+ }
+
+ @Override
protected void create(Process proc)
{
super.create(proc);
-
for (Node node : getNodes())
{
NodeImpl nodeImpl = (NodeImpl)node;
@@ -279,6 +311,39 @@
}
}
+ @Override
+ protected void register(Process proc)
+ {
+ super.register(proc);
+ for (Node node : getNodes())
+ {
+ NodeImpl nodeImpl = (NodeImpl)node;
+ nodeImpl.register(proc);
+ }
+ }
+
+ @Override
+ protected void unregister(Process proc)
+ {
+ super.unregister(proc);
+ for (Node node : getNodes())
+ {
+ NodeImpl nodeImpl = (NodeImpl)node;
+ nodeImpl.unregister(proc);
+ }
+ }
+
+ @Override
+ protected void destroy(Process proc)
+ {
+ super.destroy(proc);
+ for (Node node : getNodes())
+ {
+ NodeImpl nodeImpl = (NodeImpl)node;
+ nodeImpl.destroy(proc);
+ }
+ }
+
public String toString()
{
return "ProcessStructure[" + getName() + "]";
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StartEventImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StartEventImpl.java 2008-10-04 12:59:53 UTC (rev 2477)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StartEventImpl.java 2008-10-04 14:22:42 UTC (rev 2478)
@@ -33,6 +33,7 @@
import org.jbpm.api.client.SignalListener;
import org.jbpm.api.model.Node;
import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.model.Signal;
@@ -147,10 +148,10 @@
}
@Override
- protected void create(Process proc)
+ protected void register(final ProcessDefinition procDef)
{
- super.create(proc);
-
+ super.register(procDef);
+
final ProcessEngine engine = getProcessEngine();
final SignalService sigService = engine.getService(SignalService.class);
@@ -160,7 +161,7 @@
if (startListener == null)
{
final Signal startSignal = getSignalRef();
- final StartEvent start = this;
+ final String startEventName = getName();
startListener = new SignalListener()
{
public boolean acceptSignal(Signal signal)
@@ -182,14 +183,20 @@
{
log.debug("Start process from signal: " + signal);
sigService.removeSignalListener(startListener);
+
+ // There MAY be multiple Start Events for a given Process level. Each Start Event is an independent event.
+ // That is, a Process Instance SHALL be generated when the Start Event is triggered.
+ Process proc = procDef.newInstance();
+ StartEvent startEvent = proc.getNode(StartEvent.class, startEventName);
ExecutionService execService = engine.getService(ExecutionService.class);
- execService.startProcess(getProcess(), start, null);
+ execService.startProcess(proc, startEvent, null);
}
public String toString()
{
- return start + "." + startSignal;
+ StartEvent startEvent = procDef.getNode(StartEvent.class, startEventName);
+ return startEvent + "." + startSignal;
}
};
@@ -198,9 +205,4 @@
}
}
}
-
- public String toString()
- {
- return "StartEvent[" + getName() + "]";
- }
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java 2008-10-04 12:59:53 UTC (rev 2477)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java 2008-10-04 14:22:42 UTC (rev 2478)
@@ -24,6 +24,7 @@
// $Id$
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import javax.management.ObjectName;
@@ -78,35 +79,35 @@
{
super.setProcessEngine(engine);
}
-
+
@Override
public void startProcess(Process proc, Attachments att)
{
- // Prepare the process for start
- startProcessPrepare(proc);
-
// Get the None Start Event if there is one and start the initial flow
StartEvent start = getNoneStartEvent(proc);
- if (start != null)
+ if (start == null)
{
- if (proc.getProcessStatus() == ProcessStatus.Active)
- throw new IllegalStateException("Cannot start an already active process");
-
- startProcessInternal(proc, start, att);
+ List<StartEvent> startEvents = proc.getNodes(StartEvent.class);
+ throw new IllegalStateException("Cannot obtain StartEvent.None to start the process explicitly: " + startEvents);
}
+
+ if (proc.getProcessStatus() == ProcessStatus.Active)
+ throw new IllegalStateException("Cannot start an already active process");
+
+ startProcessInternal(proc, start, att);
}
@Override
public void startProcess(Process proc, StartEvent start, Attachments att)
{
- // Prepare the process for start
- startProcessPrepare(proc);
-
startProcessInternal(proc, start, att);
}
private synchronized void startProcessInternal(Process proc, StartEvent start, Attachments att)
{
+ // Prepare the process to start
+ startProcessPrepare(proc);
+
@SuppressWarnings("serial")
class InitialFlow extends SequenceFlowImpl
{
@@ -116,20 +117,20 @@
setTargetRef(start);
}
}
-
+
RuntimeProcess rtProc = getRuntimeProcess(proc, false);
- boolean startProcessThread = (rtProc == null);
+ boolean startProcessThread = (rtProc == null);
// Create initial Token
TokenImpl initialToken = new TokenImpl(att);
InitialFlow initialFlow = new InitialFlow(start);
initialToken.setFlow(initialFlow);
-
- // Register the initial Token
+
+ // Register the initial Token
rtProc = getRuntimeProcess(proc, true);
TokenExecutor tokenExecutor = rtProc.getTokenExecutor();
tokenExecutor.create(initialToken, initialFlow);
-
+
// Start a new process thread
if (startProcessThread)
{
@@ -150,10 +151,10 @@
}
}
}
-
+
// Do the start time assignments
startTimeAssignments(proc, initialToken);
-
+
// Start the initial token
tokenExecutor.start(initialToken);
}
@@ -189,7 +190,7 @@
}
}
}
-
+
public ProcessStatus waitForEnd(Process proc)
{
return waitForEndInternal(proc, 0);
@@ -208,7 +209,7 @@
private ProcessStatus waitForEndInternal(Process proc, long timeout)
{
ProcessImpl procImpl = (ProcessImpl)proc;
-
+
ProcessStatus status = proc.getProcessStatus();
if (status == ProcessStatus.None)
throw new IllegalStateException("Cannot wait for process in state: " + status);
@@ -234,14 +235,14 @@
break;
}
}
-
+
// Start waiting to get notified
long waitTimeout = forever ? 0 : until - now;
proc.wait(waitTimeout);
}
now = System.currentTimeMillis();
}
-
+
// Throw timeout exception if it took too long
if (isProcessTerminated(proc) == false)
{
@@ -266,17 +267,16 @@
procService.unregisterProcess(proc.getKey());
}
-
status = proc.getProcessStatus();
return status;
}
-
+
private boolean isProcessTerminated(Process proc)
{
ProcessStatus status = proc.getProcessStatus();
return status == ProcessStatus.Cancelled || status == ProcessStatus.Completed || status == ProcessStatus.Aborted;
}
-
+
private StartEvent getNoneStartEvent(Process proc)
{
StartEvent start = null;
@@ -327,7 +327,7 @@
ProcessEngine engine = getProcessEngine();
SignalService sigService = engine.getService(SignalService.class);
-
+
ObjectName procID = proc.getKey();
String procName = proc.getName();
try
@@ -340,7 +340,7 @@
// Notify that the process is now Active
proc.notifyAll();
}
-
+
synchronized (rtProc)
{
// Wait until there are no more runnable tokens
@@ -355,9 +355,9 @@
log.error("Process interrupted", ex);
}
}
-
+
log.debug("End execution thread [proc=" + procName + ",status=" + proc.getProcessStatus() + "]");
-
+
if (proc.getProcessStatus() == ProcessStatus.Active)
procImpl.setProcessStatus(ProcessStatus.Completed);
}
@@ -371,7 +371,7 @@
ProcessService procService = engine.getService(ProcessService.class);
procService.unregisterProcess(procID);
runtimeProcesses.remove(procID);
-
+
// Notify that the process has now ended
proc.notifyAll();
}
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessDefinitionServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessDefinitionServiceImpl.java 2008-10-04 12:59:53 UTC (rev 2477)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessDefinitionServiceImpl.java 2008-10-04 14:22:42 UTC (rev 2478)
@@ -23,8 +23,12 @@
// $Id$
+import javax.management.ObjectName;
+
import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.service.ProcessDefinitionService;
+import org.jbpm.ri.model.ProcessDefinitionImpl;
/**
* The ProcessDefinitionService is the entry point to create, find and otherwise manage process definitions.
@@ -39,4 +43,23 @@
{
super.setProcessEngine(engine);
}
+
+ @Override
+ public ObjectName registerProcessDefinition(ProcessDefinition procDef)
+ {
+ ObjectName procDefID = super.registerProcessDefinition(procDef);
+ ProcessDefinitionImpl procDefImpl = (ProcessDefinitionImpl)procDef;
+ procDefImpl.register(procDef);
+ return procDefID;
+ }
+
+ @Override
+ public boolean unregisterProcessDefinition(ObjectName procDefID)
+ {
+ ProcessDefinitionImpl procDefImpl = (ProcessDefinitionImpl)getProcessDefinition(procDefID);
+ if (procDefImpl != null)
+ procDefImpl.unregister(procDefImpl);
+
+ return super.unregisterProcessDefinition(procDefID);
+ }
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java 2008-10-04 12:59:53 UTC (rev 2477)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java 2008-10-04 14:22:42 UTC (rev 2478)
@@ -61,7 +61,9 @@
public boolean unregisterProcess(ObjectName procID)
{
ProcessImpl procImpl = (ProcessImpl)getProcess(procID);
- procImpl.unregister(procImpl);
+ if (procImpl != null)
+ procImpl.unregister(procImpl);
+
return super.unregisterProcess(procID);
}
}
\ No newline at end of file
17 years, 7 months
JBoss JBPM SVN: r2477 - in projects/spec/trunk/modules: cts/src/test/java/org/jbpm/test/cts/service/persistence and 1 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-10-04 08:59:53 -0400 (Sat, 04 Oct 2008)
New Revision: 2477
Modified:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Assignment.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Expression.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Participant.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceServiceTest.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/AssignmentImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ParticipantImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/SendTaskImpl.java
Log:
All pass
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Assignment.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Assignment.java 2008-10-04 12:30:21 UTC (rev 2476)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Assignment.java 2008-10-04 12:59:53 UTC (rev 2477)
@@ -21,6 +21,8 @@
*/
package org.jbpm.api.model;
+import java.io.Serializable;
+
//$Id$
/**
@@ -30,7 +32,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface Assignment
+public interface Assignment extends Serializable
{
public enum AssignTime
{
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Expression.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Expression.java 2008-10-04 12:30:21 UTC (rev 2476)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Expression.java 2008-10-04 12:59:53 UTC (rev 2477)
@@ -21,6 +21,8 @@
*/
package org.jbpm.api.model;
+import java.io.Serializable;
+
//$Id$
/**
@@ -30,7 +32,7 @@
* @author thomas.diesler(a)jboss.com
* @since 21-Jul-2008
*/
-public interface Expression
+public interface Expression extends Serializable
{
enum ExpressionLanguage
{
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Participant.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Participant.java 2008-10-04 12:30:21 UTC (rev 2476)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Participant.java 2008-10-04 12:59:53 UTC (rev 2477)
@@ -23,17 +23,17 @@
//$Id$
+import java.io.Serializable;
+
import javax.management.ObjectName;
-
-
/**
* A Participant, which is used in the definition of attributes for a Pool, {@link Message}, and WebService
*
* @author thomas.diesler(a)jboss.com
* @since 21-Jul-2008
*/
-public interface Participant
+public interface Participant extends Serializable
{
/**
* The name of this participant
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceServiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceServiceTest.java 2008-10-04 12:30:21 UTC (rev 2476)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceServiceTest.java 2008-10-04 12:59:53 UTC (rev 2477)
@@ -32,6 +32,7 @@
import org.jbpm.api.model.StartEvent;
import org.jbpm.api.model.Task;
import org.jbpm.api.service.PersistenceService;
+import org.jbpm.api.service.ProcessDefinitionService;
import org.jbpm.api.test.CTSTestCase;
import org.jbpm.test.cts.service.process.ProcessCatalog;
@@ -85,12 +86,15 @@
*/
public void testProcess() throws Exception
{
+ ProcessDefinitionService procDefService = ProcessDefinitionService.locateProcessDefinitionService();
PersistenceService service = PersistenceService.locatePersistenceService();
+ // Register (save) the process definition, which is not done implicitly by saveProcess
ProcessDefinition procDef = unregisterOnTearDown(ProcessCatalog.getDefaultProcess());
+ procDefService.registerProcessDefinition(procDef);
+
+ // Create and save the Process
Process proc = procDef.newInstance();
-
- // Save the Process
service.saveProcess(proc);
// Load the process
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/AssignmentImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/AssignmentImpl.java 2008-10-04 12:30:21 UTC (rev 2476)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/AssignmentImpl.java 2008-10-04 12:59:53 UTC (rev 2477)
@@ -41,6 +41,8 @@
@Entity(name = "Assignment")
public class AssignmentImpl implements Assignment
{
+ private static final long serialVersionUID = 1L;
+
@Enumerated(EnumType.STRING)
private AssignTime assignTime;
@Embedded
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java 2008-10-04 12:30:21 UTC (rev 2476)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java 2008-10-04 12:59:53 UTC (rev 2477)
@@ -35,6 +35,7 @@
import org.jbpm.api.model.Event;
import org.jbpm.api.model.Message;
import org.jbpm.api.model.Node;
+import org.jbpm.api.model.Process;
import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.Signal;
@@ -202,4 +203,16 @@
procDefImpl.initializeMessageRef(messageRef);
}
}
+
+ @Override
+ protected void create(Process proc)
+ {
+ super.create(proc);
+
+ if (messageRef != null)
+ {
+ ProcessDefinitionImpl procDefImpl = (ProcessDefinitionImpl)proc.getProcessDefinition();
+ procDefImpl.initializeMessageRef(messageRef);
+ }
+ }
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ParticipantImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ParticipantImpl.java 2008-10-04 12:30:21 UTC (rev 2476)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ParticipantImpl.java 2008-10-04 12:59:53 UTC (rev 2477)
@@ -42,6 +42,8 @@
@Entity(name = "Participant")
public class ParticipantImpl implements Participant
{
+ private static final long serialVersionUID = 1L;
+
@Id @GeneratedValue
@SuppressWarnings("unused")
private int id;
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java 2008-10-04 12:30:21 UTC (rev 2476)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java 2008-10-04 12:59:53 UTC (rev 2477)
@@ -34,6 +34,7 @@
import org.jbpm.api.client.MessageListener;
import org.jbpm.api.model.Message;
import org.jbpm.api.model.Node;
+import org.jbpm.api.model.Process;
import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.runtime.ExecutionContext;
@@ -209,4 +210,13 @@
ProcessDefinitionImpl procDefImpl = (ProcessDefinitionImpl)procDef;
procDefImpl.initializeMessageRef(messageRef);
}
+
+ @Override
+ protected void create(Process proc)
+ {
+ super.create(proc);
+
+ ProcessDefinitionImpl procDefImpl = (ProcessDefinitionImpl)proc.getProcessDefinition();
+ procDefImpl.initializeMessageRef(messageRef);
+ }
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/SendTaskImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/SendTaskImpl.java 2008-10-04 12:30:21 UTC (rev 2476)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/SendTaskImpl.java 2008-10-04 12:59:53 UTC (rev 2477)
@@ -29,6 +29,7 @@
import org.jbpm.api.InvalidProcessException;
import org.jbpm.api.model.Message;
import org.jbpm.api.model.Node;
+import org.jbpm.api.model.Process;
import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.runtime.ExecutionHandler;
@@ -115,4 +116,13 @@
if (messageRef.getToRef() == null)
throw new IllegalArgumentException("Message target cannot be null for: " + this);
}
+
+ @Override
+ protected void create(Process proc)
+ {
+ super.create(proc);
+
+ ProcessDefinitionImpl procDefImpl = (ProcessDefinitionImpl)proc.getProcessDefinition();
+ procDefImpl.initializeMessageRef(messageRef);
+ }
}
\ No newline at end of file
17 years, 7 months
JBoss JBPM SVN: r2476 - in projects/spec/trunk/modules: cts/src/test/java/org/jbpm/test/cts/service/process and 2 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-10-04 08:30:21 -0400 (Sat, 04 Oct 2008)
New Revision: 2476
Added:
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessDefinitionServiceTest.java
Removed:
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessDefinitionTest.java
Modified:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessDefinitionService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessServiceTest.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StructureDelegateImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java
Log:
SequenceTest - pass
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessDefinitionService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessDefinitionService.java 2008-10-04 10:07:07 UTC (rev 2475)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessDefinitionService.java 2008-10-04 12:30:21 UTC (rev 2476)
@@ -86,7 +86,7 @@
*/
public ObjectName registerProcessDefinition(ProcessDefinition procDef)
{
- if (getProcessDefinitionByName(procDef.getName()) != null)
+ if (getProcessDefinition(procDef.getKey()) != null)
throw new IllegalStateException("Process definition already registered: " + procDef);
log.debug("registerProcessDefinition: " + procDef);
@@ -136,23 +136,6 @@
}
/**
- * Get a ProcessDefinition for a given name
- */
- public ProcessDefinition getProcessDefinitionByName(String name)
- {
- ProcessDefinition procDef = null;
- for (ProcessDefinition auxDef : procDefs.values())
- {
- if (auxDef.getName().equals(name))
- {
- procDef = auxDef;
- break;
- }
- }
- return procDef;
- }
-
- /**
* Get the set of registered ProcessDefinition names
*/
public Set<ObjectName> getProcessDefinitions()
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java 2008-10-04 10:07:07 UTC (rev 2475)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java 2008-10-04 12:30:21 UTC (rev 2476)
@@ -33,6 +33,7 @@
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.Process.ProcessStatus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -72,6 +73,21 @@
{
log.debug("registerProcess: " + proc);
+ if (getProcess(proc.getKey()) != null)
+ throw new IllegalStateException("Process already registered: " + proc);
+
+ ProcessStatus procStatus = proc.getProcessStatus();
+ ProcessDefinition procDef = proc.getProcessDefinition();
+ ProcessEngine engine = getProcessEngine();
+
+ if (procStatus != ProcessStatus.None)
+ throw new IllegalStateException("Cannot register process in state: " + procStatus);
+
+ // Register the process definition if needed
+ ProcessDefinitionService procDefService = engine.getService(ProcessDefinitionService.class);
+ if (procDefService.getProcessDefinition(procDef.getKey()) == null)
+ procDefService.registerProcessDefinition(procDef);
+
// Save the process through the PersistenceService
PersistenceService dbService = getProcessEngine().getService(PersistenceService.class);
ObjectName procID = dbService.saveProcess(proc);
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessDefinitionServiceTest.java (from rev 2470, projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessDefinitionTest.java)
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessDefinitionServiceTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessDefinitionServiceTest.java 2008-10-04 12:30:21 UTC (rev 2476)
@@ -0,0 +1,64 @@
+/*
+ * 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.jbpm.test.cts.service.process;
+
+// $Id$
+
+import java.util.Set;
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.service.ProcessDefinitionService;
+import org.jbpm.api.service.ProcessService;
+import org.jbpm.api.test.CTSTestCase;
+
+/**
+ * Test the ProcessDefinition
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Sep-2008
+ */
+public class ProcessDefinitionServiceTest extends CTSTestCase
+{
+ public void testBasicProcess() throws Exception
+ {
+ ProcessDefinition procDef = ProcessCatalog.getDefaultProcess();
+ ProcessCatalog.validateDefaultProcess(procDef);
+
+ ProcessEngine engine = procDef.getProcessEngine();
+ assertNotNull("Process engine not null", engine);
+
+ ProcessDefinitionService procDefService = engine.getService(ProcessDefinitionService.class);
+ ProcessService procService = engine.getService(ProcessService.class);
+
+ Set<ObjectName> procDefs = procDefService.getProcessDefinitions();
+ assertEquals("ProcessDefinition not automatically registered", 0, procDefs.size());
+
+ Process proc = procDef.newInstance();
+ assertNotNull("Process not null", proc);
+ assertNull("Process not automatically registered", procService.getProcess(proc.getKey()));
+ assertNull("ProcessDefinition not automatically registered", procDefService.getProcessDefinition(procDef.getKey()));
+ }
+}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessDefinitionTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessDefinitionTest.java 2008-10-04 10:07:07 UTC (rev 2475)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessDefinitionTest.java 2008-10-04 12:30:21 UTC (rev 2476)
@@ -1,72 +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.jbpm.test.cts.service.process;
-
-// $Id$
-
-import java.util.Set;
-
-import javax.management.ObjectName;
-
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Process;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.service.ProcessDefinitionService;
-import org.jbpm.api.service.ProcessService;
-import org.jbpm.api.test.CTSTestCase;
-
-/**
- * Test the ProcessDefinition
- *
- * @author thomas.diesler(a)jboss.com
- * @since 24-Sep-2008
- */
-public class ProcessDefinitionTest extends CTSTestCase
-{
- public void testBasicProcess() throws Exception
- {
- ProcessDefinition procDef = ProcessCatalog.getDefaultProcess();
- ProcessCatalog.validateDefaultProcess(procDef);
-
- ProcessEngine engine = procDef.getProcessEngine();
- assertNotNull("Process engine not null", engine);
-
- ProcessDefinitionService procDefService = engine.getService(ProcessDefinitionService.class);
- ProcessService procService = engine.getService(ProcessService.class);
-
- Set<ObjectName> procDefs = procDefService.getProcessDefinitions();
- assertEquals("ProcessDefinition not automatically registered", 0, procDefs.size());
-
- try
- {
- Process proc = procDef.newInstance();
- assertNotNull("Process not null", proc);
-
- assertNotNull("Process registered", procService.getProcess(proc.getKey()));
- assertNotNull("ProcessDefinition registered", procDefService.getProcessDefinition(procDef.getKey()));
- }
- finally
- {
- procDefService.unregisterProcessDefinition(procDef.getKey());
- }
- }
-}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessServiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessServiceTest.java 2008-10-04 10:07:07 UTC (rev 2475)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessServiceTest.java 2008-10-04 12:30:21 UTC (rev 2476)
@@ -23,6 +23,8 @@
// $Id$
+import javax.management.ObjectName;
+
import org.jbpm.api.client.SignalListener;
import org.jbpm.api.model.Process;
import org.jbpm.api.model.ProcessDefinition;
@@ -30,6 +32,7 @@
import org.jbpm.api.model.Signal.SignalType;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.service.ProcessDefinitionService;
import org.jbpm.api.service.ProcessService;
import org.jbpm.api.service.SignalService;
import org.jbpm.api.test.CTSTestCase;
@@ -42,11 +45,39 @@
*/
public class ProcessServiceTest extends CTSTestCase
{
+ public void testRegisterProcess() throws Exception
+ {
+ ProcessDefinitionService procDefService = ProcessDefinitionService.locateProcessDefinitionService();
+ ProcessService procService = ProcessService.locateProcessService();
+
+ ProcessDefinition procDef = getProcessDefinition();
+ Process proc = procDef.newInstance();
+
+ assertNull("ProcessDefinition not registered automatically", procDefService.getProcessDefinition(procDef.getKey()));
+ assertNull("Process not registered automatically", procService.getProcess(proc.getKey()));
+
+ // Register the process
+ ObjectName procID = procService.registerProcess(proc);
+ assertEquals("Proc ID equals", proc.getKey(), procID);
+ assertNotNull("ProcessDefinition registered", procDefService.getProcessDefinition(procDef.getKey()));
+ assertNotNull("Process registered", procService.getProcess(proc.getKey()));
+
+ // Unregister the process
+ procService.unregisterProcess(procID);
+ assertNull("Process unregistered", procService.getProcess(procID));
+ assertNotNull("ProcessDefinition still registered", procDefService.getProcessDefinition(procDef.getKey()));
+
+ procDefService.unregisterProcessDefinition(procDef.getKey());
+ assertNull("ProcessDefinition unregistered", procDefService.getProcessDefinition(procDef.getKey()));
+ }
+
public void testStartProcess() throws Exception
{
- ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
+ final ProcessDefinitionService procDefService = ProcessDefinitionService.locateProcessDefinitionService();
+ final ProcessService procService = ProcessService.locateProcessService();
+
+ final ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
final Process proc = procDef.newInstance();
- final ProcessService procService = ProcessService.locateProcessService();
assertNull("Process not registered automatically", procService.getProcess(proc.getKey()));
SignalListener sigListener = new SignalListener()
@@ -58,6 +89,7 @@
public void catchSignal(Signal signal)
{
+ assertNotNull(procDefService.getProcessDefinition(procDef.getKey()));
assertNotNull(procService.getProcess(proc.getKey()));
}
};
@@ -66,7 +98,7 @@
try
{
- // Start the process, which automatically adds it to the registery
+ // Start the process, which automatically adds it to the registry
proc.startProcess();
proc.waitForEnd();
}
@@ -81,7 +113,7 @@
private ProcessDefinition getProcessDefinition()
{
ProcessBuilder builder = ProcessBuilderService.locateProcessBuilder();
- builder.addProcess(getName()).addStartEvent("Start").addSequenceFlow("taskA");
- return builder.addTask("taskA").addSequenceFlow("end").addEndEvent("end").getProcessDefinition();
+ builder.addProcess(getName()).addStartEvent("Start").addSequenceFlow("Task");
+ return builder.addTask("Task").addSequenceFlow("End").addEndEvent("End").getProcessDefinition();
}
}
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java 2008-10-04 10:07:07 UTC (rev 2475)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java 2008-10-04 12:30:21 UTC (rev 2476)
@@ -24,11 +24,9 @@
//$Id$
import javax.management.ObjectName;
-import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
-import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;
@@ -52,19 +50,19 @@
public class ProcessImpl extends StructureDelegateImpl implements Process
{
private static final long serialVersionUID = 1L;
-
+
// provide logging
final static Logger log = LoggerFactory.getLogger(ProcessImpl.class);
@Enumerated(EnumType.STRING)
private ProcessStatus status = ProcessStatus.None;
-
- @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER, targetEntity = ProcessDefinitionImpl.class)
+
+ @ManyToOne(targetEntity = ProcessDefinitionImpl.class)
private ProcessDefinition procDef;
-
- @Transient
- private transient RuntimeException runtimeException;
+ @Transient
+ private transient RuntimeException runtimeException;
+
public ProcessImpl(ProcessEngine engine, ProcessDefinitionImpl procDef, ProcessStructureImpl procStruct)
{
super(engine, procStruct);
@@ -154,6 +152,20 @@
return exService.waitForEnd(this, timeout);
}
+ @Override
+ public void register(Process proc)
+ {
+ super.register(proc);
+ procStruct.register(proc);
+ }
+
+ @Override
+ public void unregister(Process proc)
+ {
+ super.unregister(proc);
+ procStruct.unregister(proc);
+ }
+
public String toString()
{
return "Process[" + getName() + ",status=" + getProcessStatus() + "]";
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StructureDelegateImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StructureDelegateImpl.java 2008-10-04 10:07:07 UTC (rev 2475)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StructureDelegateImpl.java 2008-10-04 12:30:21 UTC (rev 2476)
@@ -55,9 +55,9 @@
final static Logger log = LoggerFactory.getLogger(StructureDelegateImpl.class);
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER, targetEntity = ProcessStructureImpl.class)
- protected ProcessStructure procStruct;
+ protected ProcessStructureImpl procStruct;
- public StructureDelegateImpl(ProcessEngine engine, ProcessStructure procStruct)
+ public StructureDelegateImpl(ProcessEngine engine, ProcessStructureImpl procStruct)
{
super(engine);
this.procStruct = procStruct;
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java 2008-10-04 10:07:07 UTC (rev 2475)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java 2008-10-04 12:30:21 UTC (rev 2476)
@@ -160,9 +160,9 @@
private void startProcessPrepare(Process proc)
{
- // Reset the process if already terminated
+ // Veriy the process state
ProcessStatus procStatus = proc.getProcessStatus();
- if (procStatus != ProcessStatus.Ready)
+ if (procStatus != ProcessStatus.None && procStatus != ProcessStatus.Ready)
throw new IllegalStateException("Cannot start process in state: " + procStatus);
// Register the process if needed
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java 2008-10-04 10:07:07 UTC (rev 2475)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java 2008-10-04 12:30:21 UTC (rev 2476)
@@ -23,8 +23,13 @@
// $Id$
+import javax.management.ObjectName;
+
import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.Process.ProcessStatus;
import org.jbpm.api.service.ProcessService;
+import org.jbpm.ri.model.ProcessImpl;
/**
* The ProcessService is the entry point to create, find and otherwise manage processes.
@@ -39,4 +44,24 @@
{
super.setProcessEngine(engine);
}
+
+ @Override
+ public ObjectName registerProcess(Process proc)
+ {
+ ObjectName procID = super.registerProcess(proc);
+
+ ProcessImpl procImpl = (ProcessImpl)proc;
+ procImpl.register(proc);
+
+ procImpl.setProcessStatus(ProcessStatus.Ready);
+ return procID;
+ }
+
+ @Override
+ public boolean unregisterProcess(ObjectName procID)
+ {
+ ProcessImpl procImpl = (ProcessImpl)getProcess(procID);
+ procImpl.unregister(procImpl);
+ return super.unregisterProcess(procID);
+ }
}
\ No newline at end of file
17 years, 7 months
JBoss JBPM SVN: r2475 - jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-10-04 06:07:07 -0400 (Sat, 04 Oct 2008)
New Revision: 2475
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/BusinessCalendar.java
Log:
fixed null pointer problem
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/BusinessCalendar.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/BusinessCalendar.java 2008-10-03 12:13:06 UTC (rev 2474)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/BusinessCalendar.java 2008-10-04 10:07:07 UTC (rev 2475)
@@ -155,11 +155,12 @@
if (! isHoliday(date)) {
Day day = findDay(date);
DayPart[] dayParts = day.getDayParts();
- for (int i=0; ((i < dayParts.length)
- && (dayPart==null)); i++) {
- DayPart candidate = dayParts[i];
- if (candidate.includes(date)) {
- dayPart = candidate;
+ if (dayParts!=null) {
+ for (int i=0; ((i < dayParts.length) && (dayPart==null)); i++) {
+ DayPart candidate = dayParts[i];
+ if (candidate.includes(date)) {
+ dayPart = candidate;
+ }
}
}
}
17 years, 7 months
JBoss JBPM SVN: r2474 - in jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model: op and 1 other directory.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-10-03 08:13:06 -0400 (Fri, 03 Oct 2008)
New Revision: 2474
Added:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java
Removed:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/IncomingExecutionEvent.java
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToParentNode.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/SignalMessage.java
Log:
rolled back renaming of Signal operation
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2008-10-03 11:18:34 UTC (rev 2473)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2008-10-03 12:13:06 UTC (rev 2474)
@@ -49,7 +49,7 @@
import org.jbpm.pvm.internal.model.op.MoveToChildNode;
import org.jbpm.pvm.internal.model.op.MoveToParentNode;
import org.jbpm.pvm.internal.model.op.ProceedToDestination;
-import org.jbpm.pvm.internal.model.op.IncomingExecutionEvent;
+import org.jbpm.pvm.internal.model.op.Signal;
import org.jbpm.pvm.internal.model.op.TakeTransition;
import org.jbpm.pvm.internal.type.Converter;
import org.jbpm.pvm.internal.type.Type;
@@ -378,7 +378,7 @@
public void signal(String signal, Map<String, Object> parameters) {
checkLock();
if (node!=null) {
- performAtomicOperation(new IncomingExecutionEvent(signal, parameters, node));
+ performAtomicOperation(new Signal(signal, parameters, node));
} else if (transition!=null) {
performAtomicOperation(ExecutionImpl.PROCEED_TO_DESTINATION);
} else {
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/IncomingExecutionEvent.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/IncomingExecutionEvent.java 2008-10-03 11:18:34 UTC (rev 2473)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/IncomingExecutionEvent.java 2008-10-03 12:13:06 UTC (rev 2474)
@@ -1,87 +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.jbpm.pvm.internal.model.op;
-
-import java.util.Map;
-
-import org.jbpm.pvm.PvmException;
-import org.jbpm.pvm.activity.ExternalActivity;
-import org.jbpm.pvm.internal.job.MessageImpl;
-import org.jbpm.pvm.internal.log.Log;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.NodeImpl;
-import org.jbpm.pvm.internal.model.ExecutionImpl.Propagation;
-
-/**
- * @author Tom Baeyens
- */
-public class IncomingExecutionEvent implements AtomicOperation {
-
- private static final Log log = Log.getLog(IncomingExecutionEvent.class.getName());
-
- String signalName;
- Map<String, Object> parameters;
- NodeImpl node;
-
- public IncomingExecutionEvent(String signalName, Map<String, Object> parameters, NodeImpl node) {
- this.signalName = signalName;
- this.parameters = parameters;
- this.node = node;
- }
-
- public boolean isAsync(ExecutionImpl execution) {
- return execution.getNode().isSignalAsync();
- }
-
- public void perform(ExecutionImpl execution) {
- if (execution.getName()!=null) {
- log.debug(execution.toString()+" signals "+node);
- } else {
- log.debug("signalling "+node+", signal="+signalName);
- }
-
- ExternalActivity externalActivity = (ExternalActivity) node.getBehaviour();
-
- try {
- execution.setPropagation(Propagation.UNSPECIFIED);
- externalActivity.signal(execution, signalName, parameters);
-
- } catch (RuntimeException e) {
- throw e;
-
- } catch (Exception e) {
- throw new PvmException("couldn't signal "+node+": "+e.getMessage(), e);
- }
-
- if (execution.getPropagation() == Propagation.UNSPECIFIED) {
- execution.proceed();
- }
- }
-
- public String toString() {
- return "signal(node)";
- }
-
- public MessageImpl<?> createAsyncMessage(ExecutionImpl execution) {
- return new SignalMessage(execution, signalName, node);
- }
-}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToParentNode.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToParentNode.java 2008-10-03 11:18:34 UTC (rev 2473)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToParentNode.java 2008-10-03 12:13:06 UTC (rev 2474)
@@ -39,7 +39,7 @@
// (so that the call to moveTo updates the previous node)
propagatingExecution.setNode(node);
propagatingExecution.moveTo(parentNode);
- propagatingExecution.performAtomicOperation(new IncomingExecutionEvent(null, null, parentNode));
+ propagatingExecution.performAtomicOperation(new Signal(null, null, parentNode));
}
public MessageImpl<?> createAsyncMessage(ExecutionImpl execution) {
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java (from rev 2471, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/IncomingExecutionEvent.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java 2008-10-03 12:13:06 UTC (rev 2474)
@@ -0,0 +1,87 @@
+/*
+ * 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.jbpm.pvm.internal.model.op;
+
+import java.util.Map;
+
+import org.jbpm.pvm.PvmException;
+import org.jbpm.pvm.activity.ExternalActivity;
+import org.jbpm.pvm.internal.job.MessageImpl;
+import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ExecutionImpl.Propagation;
+
+/**
+ * @author Tom Baeyens
+ */
+public class Signal implements AtomicOperation {
+
+ private static final Log log = Log.getLog(Signal.class.getName());
+
+ String signalName;
+ Map<String, Object> parameters;
+ NodeImpl node;
+
+ public Signal(String signalName, Map<String, Object> parameters, NodeImpl node) {
+ this.signalName = signalName;
+ this.parameters = parameters;
+ this.node = node;
+ }
+
+ public boolean isAsync(ExecutionImpl execution) {
+ return execution.getNode().isSignalAsync();
+ }
+
+ public void perform(ExecutionImpl execution) {
+ if (execution.getName()!=null) {
+ log.debug(execution.toString()+" signals "+node);
+ } else {
+ log.debug("signalling "+node+", signal="+signalName);
+ }
+
+ ExternalActivity externalActivity = (ExternalActivity) node.getBehaviour();
+
+ try {
+ execution.setPropagation(Propagation.UNSPECIFIED);
+ externalActivity.signal(execution, signalName, parameters);
+
+ } catch (RuntimeException e) {
+ throw e;
+
+ } catch (Exception e) {
+ throw new PvmException("couldn't signal "+node+": "+e.getMessage(), e);
+ }
+
+ if (execution.getPropagation() == Propagation.UNSPECIFIED) {
+ execution.proceed();
+ }
+ }
+
+ public String toString() {
+ return "signal(node)";
+ }
+
+ public MessageImpl<?> createAsyncMessage(ExecutionImpl execution) {
+ return new SignalMessage(execution, signalName, node);
+ }
+}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/SignalMessage.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/SignalMessage.java 2008-10-03 11:18:34 UTC (rev 2473)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/SignalMessage.java 2008-10-03 12:13:06 UTC (rev 2474)
@@ -49,8 +49,8 @@
public Object execute(Environment environment) throws Exception {
unlockExecution();
- IncomingExecutionEvent incomingExecutionEvent = new IncomingExecutionEvent(signalName, null, node);
- execution.performAtomicOperationSync(incomingExecutionEvent);
+ Signal signal = new Signal(signalName, null, node);
+ execution.performAtomicOperationSync(signal);
JobDbSession jobDbSession = environment.get(JobDbSession.class);
jobDbSession.delete(this);
17 years, 7 months
JBoss JBPM SVN: r2473 - in projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri: model/builder and 1 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-10-03 07:18:34 -0400 (Fri, 03 Oct 2008)
New Revision: 2473
Modified:
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/AbstractElementImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessDefinitionImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessStructureImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/SendTaskImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StartEventImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/PersistenceServiceImpl.java
Log:
Cleanup node lifecycle
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/AbstractElementImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/AbstractElementImpl.java 2008-10-03 10:51:32 UTC (rev 2472)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/AbstractElementImpl.java 2008-10-03 11:18:34 UTC (rev 2473)
@@ -33,6 +33,8 @@
import org.jbpm.api.InvalidProcessException;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.AbstractElement;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessDefinition;
/**
* The parrent of all Elements
@@ -80,4 +82,44 @@
{
return ProcessEngine.getProcessEngine(engineName);
}
+
+ protected void create(ProcessDefinition procDef)
+ {
+ // nothing to do
+ }
+
+ protected void register(ProcessDefinition procDef)
+ {
+ // nothing to do
+ }
+
+ protected void unregister(ProcessDefinition procDef)
+ {
+ // nothing to do
+ }
+
+ protected void destroy(ProcessDefinition procDef)
+ {
+ // nothing to do
+ }
+
+ protected void create(Process proc)
+ {
+ // nothing to do
+ }
+
+ protected void register(Process proc)
+ {
+ // nothing to do
+ }
+
+ protected void unregister(Process proc)
+ {
+ // nothing to do
+ }
+
+ protected void destroy(Process proc)
+ {
+ // nothing to do
+ }
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java 2008-10-03 10:51:32 UTC (rev 2472)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java 2008-10-03 11:18:34 UTC (rev 2473)
@@ -35,6 +35,7 @@
import org.jbpm.api.model.Event;
import org.jbpm.api.model.Message;
import org.jbpm.api.model.Node;
+import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.Signal;
import org.jbpm.api.model.builder.ObjectNameFactory;
@@ -181,9 +182,9 @@
}
@Override
- protected void initialize(ProcessStructure procStruct)
+ protected void create(ProcessDefinition procDef)
{
- super.initialize(procStruct);
+ super.create(procDef);
if (detailType == EventDetailType.Signal && signalRef == null)
throw new InvalidProcessException("Event with detail type 'Signal' must have a signalRef");
@@ -197,8 +198,8 @@
if (messageRef != null)
{
- ProcessStructureImpl procStructImpl = (ProcessStructureImpl)procStruct;
- procStructImpl.initializeMessageRef(messageRef);
+ ProcessDefinitionImpl procDefImpl = (ProcessDefinitionImpl)procDef;
+ procDefImpl.initializeMessageRef(messageRef);
}
}
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java 2008-10-03 10:51:32 UTC (rev 2472)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java 2008-10-03 11:18:34 UTC (rev 2473)
@@ -137,25 +137,15 @@
@Override
public ProcessDefinition getProcessDefinition()
{
- return procDef;
+ return (proc != null ? proc.getProcessDefinition() : procDef);
}
- void setProcessDefinition(ProcessDefinition procDef)
- {
- this.procDef = procDef;
- }
-
@Override
public Process getProcess()
{
return proc;
}
- void setProcess(Process process)
- {
- this.proc = process;
- }
-
public int getNodeIndex()
{
return nodeIndex;
@@ -358,8 +348,24 @@
return handler;
}
- protected void initialize(ProcessStructure procStruct)
+ @Override
+ protected void create(ProcessDefinition procDef)
{
+ super.create(procDef);
+ this.procDef = procDef;
+ checkAndInitializeStructure(procStruct);
+ }
+
+ @Override
+ protected void create(Process proc)
+ {
+ super.create(proc);
+ this.proc = proc;
+ checkAndInitializeStructure(procStruct);
+ }
+
+ private void checkAndInitializeStructure(ProcessStructure procStruct)
+ {
// Check required name
if (name == null)
throw new InvalidProcessException("Name is required for: " + this);
@@ -411,11 +417,6 @@
if (outFlow == null && (this instanceof EndEvent == false))
throw new InvalidProcessException("Dead end node: " + this);
}
-
- protected void instantiate(Process proc)
- {
- // noting to do
- }
private void initFlow(SequenceFlowImpl flow)
{
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessDefinitionImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessDefinitionImpl.java 2008-10-03 10:51:32 UTC (rev 2472)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessDefinitionImpl.java 2008-10-03 11:18:34 UTC (rev 2473)
@@ -23,19 +23,23 @@
//$Id$
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
import javax.management.ObjectName;
import javax.persistence.Entity;
+import javax.persistence.Lob;
import javax.persistence.Transient;
import org.jbpm.api.Constants;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Node;
import org.jbpm.api.model.Process;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.Property;
import org.jbpm.api.model.builder.ObjectNameFactory;
-import org.jbpm.api.service.ProcessDefinitionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -53,33 +57,52 @@
// provide logging
final static Logger log = LoggerFactory.getLogger(ProcessDefinitionImpl.class);
- public ProcessDefinitionImpl(ProcessEngine engine, ProcessStructure procStruct)
+ @Lob
+ private byte[] rawProcStruct;
+
+ public ProcessDefinitionImpl(ProcessEngine engine, ProcessStructureImpl procStruct)
{
super(engine, procStruct);
- for (Node node : procStruct.getNodes())
+
+ // Save the raw process structure
+ try
{
- NodeImpl nodeImpl = (NodeImpl)node;
- nodeImpl.setProcessDefinition(this);
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ oos.writeObject(procStruct);
+ rawProcStruct = baos.toByteArray();
}
+ catch (IOException ex)
+ {
+ throw new IllegalStateException("Cannot serialize process structure", ex);
+ }
+
+ // Call the create life cycle
+ procStruct.create(this);
}
-
+
// Persistence ctor
protected ProcessDefinitionImpl()
{
}
-
+
@Override
public Process newInstance()
{
- // Register the process definition if needed
- ProcessDefinitionService procDefService = getProcessEngine().getService(ProcessDefinitionService.class);
- if (procDefService.getProcessDefinitionByName(getName()) == null)
- procDefService.registerProcessDefinition(this);
-
- ProcessStructureImpl procStructImpl = (ProcessStructureImpl)procStruct;
- ProcessStructure newProcStruct = procStructImpl.newInstance();
- ProcessImpl procImpl = new ProcessImpl(getProcessEngine(), this, newProcStruct);
-
+ // Create a copy of the process structure from raw data
+ ProcessStructureImpl procStructCopy;
+ try
+ {
+ ByteArrayInputStream bais = new ByteArrayInputStream(rawProcStruct);
+ ObjectInputStream ois = new ObjectInputStream(bais);
+ procStructCopy = (ProcessStructureImpl)ois.readObject();
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalStateException("Cannot deserialize process", ex);
+ }
+
+ ProcessImpl procImpl = new ProcessImpl(getProcessEngine(), this, procStructCopy);
return procImpl;
}
@@ -105,6 +128,25 @@
throw new IllegalStateException("Cannot add remove a property to a process definition");
}
+ public void initializeMessageRef(MessageImpl msgRef)
+ {
+ String msgName = msgRef.getName();
+ MessageImpl procMsg = (MessageImpl)getMessage(msgName);
+ if (procMsg == null)
+ throw new IllegalStateException("Cannot obtain process message: " + msgName);
+
+ if (msgRef.getFromRef() == null && procMsg.getFromRef() != null)
+ msgRef.setFromRef(procMsg.getFromRef());
+ if (msgRef.getToRef() == null && procMsg.getToRef() != null)
+ msgRef.setToRef(procMsg.getToRef());
+
+ for (String propName : procMsg.getPropertyNames())
+ {
+ Property prop = procMsg.getProperty(propName);
+ msgRef.addProperty(prop);
+ }
+ }
+
public String toString()
{
return "ProcessDefinition[" + getName() + "]";
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java 2008-10-03 10:51:32 UTC (rev 2472)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java 2008-10-03 11:18:34 UTC (rev 2473)
@@ -24,18 +24,18 @@
//$Id$
import javax.management.ObjectName;
+import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
+import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;
import org.jbpm.api.Constants;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Node;
import org.jbpm.api.model.Process;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.builder.ObjectNameFactory;
import org.jbpm.api.runtime.Attachments;
import org.jbpm.api.service.ExecutionService;
@@ -59,24 +59,17 @@
@Enumerated(EnumType.STRING)
private ProcessStatus status = ProcessStatus.None;
- @ManyToOne(targetEntity = ProcessDefinitionImpl.class)
+ @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER, targetEntity = ProcessDefinitionImpl.class)
private ProcessDefinition procDef;
@Transient
private transient RuntimeException runtimeException;
- public ProcessImpl(ProcessEngine engine, ProcessDefinition procDef, ProcessStructure procStruct)
+ public ProcessImpl(ProcessEngine engine, ProcessDefinitionImpl procDef, ProcessStructureImpl procStruct)
{
super(engine, procStruct);
-
this.procDef = procDef;
-
- for (Node node : procStruct.getNodes())
- {
- NodeImpl nodeImpl = (NodeImpl)node;
- nodeImpl.setProcessDefinition(procDef);
- nodeImpl.setProcess(this);
- }
+ procStruct.create(this);
}
// Persistence ctor
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessStructureImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessStructureImpl.java 2008-10-03 10:51:32 UTC (rev 2472)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessStructureImpl.java 2008-10-03 11:18:34 UTC (rev 2473)
@@ -23,11 +23,6 @@
//$Id$
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
@@ -39,7 +34,6 @@
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
-import javax.persistence.Lob;
import javax.persistence.OneToMany;
import javax.persistence.Transient;
@@ -51,8 +45,9 @@
import org.jbpm.api.model.EndEvent;
import org.jbpm.api.model.Message;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.Property;
import org.jbpm.api.model.StartEvent;
import org.jbpm.api.model.builder.ObjectNameFactory;
@@ -88,15 +83,12 @@
@Transient
private List<Assignment> assignments = new ArrayList<Assignment>();
-
- @Lob
- private byte[] rawProc;
-
+
public ProcessStructureImpl(ProcessEngine engine, String name)
{
super(engine);
this.name = name;
-
+
if (name == null)
throw new InvalidProcessException("Process name cannot be null");
}
@@ -105,22 +97,6 @@
protected ProcessStructureImpl()
{
}
-
- public ProcessStructureImpl newInstance()
- {
- ProcessStructureImpl procCopy;
- try
- {
- ByteArrayInputStream bais = new ByteArrayInputStream(rawProc);
- ObjectInputStream ois = new ObjectInputStream(bais);
- procCopy = (ProcessStructureImpl)ois.readObject();
- }
- catch (Exception ex)
- {
- throw new IllegalStateException("Cannot deserialize process", ex);
- }
- return procCopy;
- }
@Override
@Transient
@@ -269,8 +245,11 @@
this.assignments.add(assignment);
}
- public void initialize(ProcessStructure procStruct)
+ @Override
+ public void create(ProcessDefinition procDef)
{
+ super.create(procDef);
+
// Check required name
if (name == null)
throw new InvalidProcessException("Name is required for: " + this);
@@ -281,58 +260,25 @@
if (getNodes(EndEvent.class).size() == 0)
throw new InvalidProcessException("Process does not have end events");
- // Initialize the nodes
for (Node node : getNodes())
{
NodeImpl nodeImpl = (NodeImpl)node;
- nodeImpl.initialize(procStruct);
+ nodeImpl.create(procDef);
}
-
- // Save the initalized raw data
- if (rawProc == null)
- {
- try
- {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.writeObject(this);
- rawProc = baos.toByteArray();
- }
- catch (IOException ex)
- {
- throw new IllegalStateException("Cannot serialize process structure", ex);
- }
- }
}
- public void instantiate(Process proc)
+ @Override
+ protected void create(Process proc)
{
- for (Node node : nodes)
+ super.create(proc);
+
+ for (Node node : getNodes())
{
NodeImpl nodeImpl = (NodeImpl)node;
- nodeImpl.instantiate(proc);
+ nodeImpl.create(proc);
}
}
- public void initializeMessageRef(MessageImpl msgRef)
- {
- String msgName = msgRef.getName();
- MessageImpl procMsg = (MessageImpl)getMessage(msgName);
- if (procMsg == null)
- throw new IllegalStateException("Cannot obtain process message: " + msgName);
-
- if (msgRef.getFromRef() == null && procMsg.getFromRef() != null)
- msgRef.setFromRef(procMsg.getFromRef());
- if (msgRef.getToRef() == null && procMsg.getToRef() != null)
- msgRef.setToRef(procMsg.getToRef());
-
- for (String propName : procMsg.getPropertyNames())
- {
- Property prop = procMsg.getProperty(propName);
- msgRef.addProperty(prop);
- }
- }
-
public String toString()
{
return "ProcessStructure[" + getName() + "]";
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java 2008-10-03 10:51:32 UTC (rev 2472)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java 2008-10-03 11:18:34 UTC (rev 2473)
@@ -34,6 +34,7 @@
import org.jbpm.api.client.MessageListener;
import org.jbpm.api.model.Message;
import org.jbpm.api.model.Node;
+import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.runtime.ExecutionContext;
import org.jbpm.api.runtime.ExecutionHandler;
@@ -198,14 +199,14 @@
}
@Override
- protected void initialize(ProcessStructure procStruct)
+ protected void create(ProcessDefinition procDef)
{
- super.initialize(procStruct);
+ super.create(procDef);
if (messageRef == null)
throw new InvalidProcessException("A message for the message ref attribute MUST be entered");
- ProcessStructureImpl procDefImpl = (ProcessStructureImpl)procStruct;
+ ProcessDefinitionImpl procDefImpl = (ProcessDefinitionImpl)procDef;
procDefImpl.initializeMessageRef(messageRef);
}
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/SendTaskImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/SendTaskImpl.java 2008-10-03 10:51:32 UTC (rev 2472)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/SendTaskImpl.java 2008-10-03 11:18:34 UTC (rev 2473)
@@ -29,6 +29,7 @@
import org.jbpm.api.InvalidProcessException;
import org.jbpm.api.model.Message;
import org.jbpm.api.model.Node;
+import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.runtime.ExecutionHandler;
import org.jbpm.api.runtime.Token;
@@ -101,14 +102,14 @@
}
@Override
- protected void initialize(ProcessStructure procStruct)
+ protected void create(ProcessDefinition procDef)
{
- super.initialize(procStruct);
+ super.create(procDef);
if (messageRef == null)
throw new InvalidProcessException("A message for the message ref attribute MUST be entered");
- ProcessStructureImpl procDefImpl = (ProcessStructureImpl)procStruct;
+ ProcessDefinitionImpl procDefImpl = (ProcessDefinitionImpl)procDef;
procDefImpl.initializeMessageRef(messageRef);
if (messageRef.getToRef() == null)
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StartEventImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StartEventImpl.java 2008-10-03 10:51:32 UTC (rev 2472)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StartEventImpl.java 2008-10-03 11:18:34 UTC (rev 2473)
@@ -147,9 +147,9 @@
}
@Override
- protected void instantiate(Process proc)
+ protected void create(Process proc)
{
- super.instantiate(proc);
+ super.create(proc);
final ProcessEngine engine = getProcessEngine();
final SignalService sigService = engine.getService(SignalService.class);
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java 2008-10-03 10:51:32 UTC (rev 2472)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java 2008-10-03 11:18:34 UTC (rev 2473)
@@ -91,10 +91,7 @@
public ProcessDefinition getProcessDefinition()
{
ProcessStructureImpl procStruct = getProcessStructure();
- procStruct.initialize(procStruct);
-
- ProcessDefinitionImpl procImpl = new ProcessDefinitionImpl(engine, procStruct);
- return procImpl;
+ return new ProcessDefinitionImpl(engine, procStruct);
}
public ProcessBuilder addSequenceFlow(String targetName)
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/PersistenceServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/PersistenceServiceImpl.java 2008-10-03 10:51:32 UTC (rev 2472)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/PersistenceServiceImpl.java 2008-10-03 11:18:34 UTC (rev 2473)
@@ -85,7 +85,7 @@
Transaction tx = session.beginTransaction();
try
{
- session.save(procDef);
+ session.saveOrUpdate(procDef);
tx.commit();
}
finally
@@ -146,7 +146,7 @@
Transaction tx = session.beginTransaction();
try
{
- session.save(proc);
+ session.saveOrUpdate(proc);
tx.commit();
}
finally
17 years, 7 months
JBoss JBPM SVN: r2472 - jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-10-03 06:51:32 -0400 (Fri, 03 Oct 2008)
New Revision: 2472
Added:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TimerSessionBinding.java
Log:
[JBPM-1758] Cleanup excluded PVM test
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TimerSessionBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TimerSessionBinding.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TimerSessionBinding.java 2008-10-03 10:51:32 UTC (rev 2472)
@@ -0,0 +1,70 @@
+/*
+ * 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.jbpm.pvm.internal.wire.binding;
+
+import org.jbpm.pvm.internal.jobexecutor.JobDbSession;
+import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
+import org.jbpm.pvm.internal.jobexecutor.JobExecutorTimerSession;
+import org.jbpm.pvm.internal.util.XmlUtil;
+import org.jbpm.pvm.internal.wire.descriptor.ContextTypeRefDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.EnvironmentTypeRefDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.TransactionRefDescriptor;
+import org.jbpm.pvm.internal.xml.Parse;
+import org.jbpm.pvm.internal.xml.Parser;
+import org.jbpm.pvm.session.TimerSession;
+import org.w3c.dom.Element;
+
+/** parses a descriptor for creating a {@link TimerSession}.
+ *
+ * See schema docs for more details.
+ *
+ * @author Tom Baeyens, Pascal Verdage
+ */
+public class TimerSessionBinding extends WireDescriptorBinding {
+
+ public TimerSessionBinding() {
+ super("timer-session");
+ }
+
+ public Object parse(Element element, Parse parse, Parser parser) {
+ ObjectDescriptor objectDescriptor = new ObjectDescriptor();
+
+ String target = XmlUtil.attribute(element, "target");
+
+ if ((target!=null) && ("ejb".equalsIgnoreCase(target))) {
+ objectDescriptor.setClassName("org.jbpm.enterprise.internal.ejb.EnterpriseTimerSession");
+
+ } else {
+ // wire the JobExecutorTimerSession
+ objectDescriptor.setClassName(JobExecutorTimerSession.class.getName());
+
+ // inject fields
+ objectDescriptor.addInjection("transaction", new TransactionRefDescriptor());
+ objectDescriptor.addInjection("jobExecutor", new EnvironmentTypeRefDescriptor(JobExecutor.class));
+ objectDescriptor.addInjection("jobDbSession", new ContextTypeRefDescriptor(JobDbSession.class));
+ }
+
+ return objectDescriptor;
+ }
+}
+
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TimerSessionBinding.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 7 months
JBoss JBPM SVN: r2471 - in jbpm4/trunk: modules and 47 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-10-03 06:48:31 -0400 (Fri, 03 Oct 2008)
New Revision: 2471
Added:
jbpm4/trunk/modules/enterprise/
jbpm4/trunk/modules/enterprise/.classpath
jbpm4/trunk/modules/enterprise/.project
jbpm4/trunk/modules/enterprise/pom.xml
jbpm4/trunk/modules/enterprise/src/
jbpm4/trunk/modules/enterprise/src/main/
jbpm4/trunk/modules/enterprise/src/main/java/
jbpm4/trunk/modules/enterprise/src/main/java/org/
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/
jbpm4/trunk/modules/enterprise/src/main/resources/
jbpm4/trunk/modules/enterprise/src/test/
jbpm4/trunk/modules/enterprise/src/test/java/
jbpm4/trunk/modules/enterprise/src/test/java/org/
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/CommandExecutorTest.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/CommandReceiverTest.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/EnterpriseTimerSessionTest.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/TimerTest.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/custom/
jbpm4/trunk/modules/enterprise/src/test/resources/
jbpm4/trunk/modules/enterprise/target/
jbpm4/trunk/modules/enterprise/target/classes/
jbpm4/trunk/modules/enterprise/target/classes/org/
jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/
jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/
jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/
jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/
jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/CommandExecutorSLSB.class
jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/CommandReceiverMDB.class
jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/EnterpriseLocalCommandService.class
jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/EnterpriseTimerSession.class
jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/ExecuteTimerCmd.class
jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/LocalCommandExecutor.class
jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/LocalCommandExecutorHome.class
jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/LocalTimer.class
jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/LocalTimerHome.class
jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/RemoteCommandExecutor.class
jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/RemoteCommandExecutorHome.class
jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/TimerEB.class
jbpm4/trunk/modules/enterprise/target/test-classes/
jbpm4/trunk/modules/enterprise/target/test-classes/org/
jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/
jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/
jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/
jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/CommandExecutorTest.class
jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/CommandReceiverTest.class
jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/EnterpriseTimerSessionTest$CancelTimerCmd.class
jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/EnterpriseTimerSessionTest$ScheduleTimerCmd.class
jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/EnterpriseTimerSessionTest.class
jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/TimerTest$CancelTimerCmd.class
jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/TimerTest$CreateTimerCmd.class
jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/TimerTest.class
jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/custom/
jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/custom/HappyActivity.class
jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/custom/InsertPhraseCmd.class
jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/custom/NoisyActivity.class
jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/custom/Phrase.class
jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/custom/Phrase.hbm.xml
jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/custom/RemovePhraseCmd.class
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/IncomingExecutionEvent.java
jbpm4/trunk/modules/pvm/src/test/resources/logging.properties
jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/internal/xml/
jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/internal/xml/dombuildertest.xml
jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/internal/xml/schematest.xml
Removed:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ejb/
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TimerSessionBinding.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/timer/TimerUnitTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/enterprise/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/HibernateJobDbSessionTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/dombuildertest.xml
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/schematest.xml
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ex11/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ex12/
jbpm4/trunk/modules/pvm/src/test/resources/log4j.xml
Modified:
jbpm4/trunk/build.xml
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandExecutorSLSB.java
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandReceiverMDB.java
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EnterpriseLocalCommandService.java
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EnterpriseTimerSession.java
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/ExecuteTimerCmd.java
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/LocalCommandExecutor.java
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/LocalCommandExecutorHome.java
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/LocalTimer.java
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/LocalTimerHome.java
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/RemoteCommandExecutor.java
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/RemoteCommandExecutorHome.java
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/TimerEB.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/custom/HappyActivity.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/custom/InsertPhraseCmd.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/custom/NoisyActivity.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/custom/Phrase.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/custom/RemovePhraseCmd.java
jbpm4/trunk/modules/pvm/.classpath
jbpm4/trunk/modules/pvm/pom.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToParentNode.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/SignalMessage.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/basicfeatures/BasicExecutionFlowDbTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/GroovyExpressionTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorIsolationDbTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/EnlistTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ex02/BasicProcessPersistenceTest.java
jbpm4/trunk/modules/pvm/src/test/resources/environment.cfg.xml
Log:
[JBPM-1758] Cleanup excluded PVM test
Modified: jbpm4/trunk/build.xml
===================================================================
--- jbpm4/trunk/build.xml 2008-10-03 06:50:46 UTC (rev 2470)
+++ jbpm4/trunk/build.xml 2008-10-03 10:48:31 UTC (rev 2471)
@@ -39,8 +39,8 @@
</antcall>
</target>
- <target name="test">
- <exec executable="cmd" os="Windows Vista, Windows XP,Windows 2000,Windows 98">
+ <target name="test.pvm">
+ <exec dir="modules/pvm" executable="cmd" os="Windows Vista, Windows XP,Windows 2000,Windows 98">
<arg line="/C mvn surefire-report:report" />
</exec>
<antcall target="show.html">
Added: jbpm4/trunk/modules/enterprise/.classpath
===================================================================
--- jbpm4/trunk/modules/enterprise/.classpath (rev 0)
+++ jbpm4/trunk/modules/enterprise/.classpath 2008-10-03 10:48:31 UTC (rev 2471)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: jbpm4/trunk/modules/enterprise/.project
===================================================================
--- jbpm4/trunk/modules/enterprise/.project (rev 0)
+++ jbpm4/trunk/modules/enterprise/.project 2008-10-03 10:48:31 UTC (rev 2471)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>enterprise</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Added: jbpm4/trunk/modules/enterprise/pom.xml
===================================================================
--- jbpm4/trunk/modules/enterprise/pom.xml (rev 0)
+++ jbpm4/trunk/modules/enterprise/pom.xml 2008-10-03 10:48:31 UTC (rev 2471)
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+ <!-- ====================================================================== -->
+ <!-- -->
+ <!-- JBoss, the OpenSource J2EE webOS -->
+ <!-- -->
+ <!-- Distributable under LGPL license. -->
+ <!-- See terms of license at http://www.gnu.org. -->
+ <!-- -->
+ <!-- ====================================================================== -->
+
+ <!-- $Id$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <name>JBoss jBPM4 - Enterprise</name>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-enterprise</artifactId>
+ <packaging>jar</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <!-- Dependencies -->
+ <dependencies>
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-api</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-pvm</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>juel</groupId>
+ <artifactId>juel</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>juel</groupId>
+ <artifactId>juel-engine</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>juel</groupId>
+ <artifactId>juel-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.cenqua.clover</groupId>
+ <artifactId>clover</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <!-- Not in scope test because org.jbpm.pvm.test.base package is in main source: see JBPM-1416 -->
+ <!-- <scope>test</scope> -->
+ </dependency>
+ <dependency>
+ <groupId>org.livetribe</groupId>
+ <artifactId>livetribe-jsr223</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.el</groupId>
+ <artifactId>jboss-el</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-j2ee</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>cactus</groupId>
+ <artifactId>cactus</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <!-- Plugins -->
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <showDeprecation>false</showDeprecation>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-ear-plugin</artifactId>
+ <configuration>
+ <applicationXml>${basedir}/src/main/etc/ear/META-INF/application.xml</applicationXml>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <!-- Profiles -->
+ <profiles>
+ </profiles>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <quiet>true</quiet>
+ <source>1.5</source>
+ <verbose>false</verbose>
+ <noqualifier>all</noqualifier>
+ <excludePackageNames>*.internal:*.test</excludePackageNames>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+
+</project>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/enterprise/pom.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb (from rev 2466, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ejb)
Property changes on: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandExecutorSLSB.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ejb/CommandExecutorSLSB.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandExecutorSLSB.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.pvm.internal.ejb;
+package org.jbpm.enterprise.internal.ejb;
import javax.ejb.CreateException;
import javax.ejb.EJBException;
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandReceiverMDB.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ejb/CommandReceiverMDB.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandReceiverMDB.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.pvm.internal.ejb;
+package org.jbpm.enterprise.internal.ejb;
import java.io.Serializable;
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EnterpriseLocalCommandService.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ejb/EnterpriseLocalCommandService.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EnterpriseLocalCommandService.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.pvm.internal.ejb;
+package org.jbpm.enterprise.internal.ejb;
import javax.ejb.CreateException;
import javax.naming.Context;
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EnterpriseTimerSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ejb/EnterpriseTimerSession.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EnterpriseTimerSession.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.pvm.internal.ejb;
+package org.jbpm.enterprise.internal.ejb;
import javax.ejb.FinderException;
import javax.ejb.RemoveException;
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/ExecuteTimerCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ejb/ExecuteTimerCmd.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/ExecuteTimerCmd.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.pvm.internal.ejb;
+package org.jbpm.enterprise.internal.ejb;
import java.util.Date;
import org.jbpm.pvm.env.Environment;
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/LocalCommandExecutor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ejb/LocalCommandExecutor.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/LocalCommandExecutor.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.pvm.internal.ejb;
+package org.jbpm.enterprise.internal.ejb;
import org.jbpm.pvm.internal.cmd.Command;
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/LocalCommandExecutorHome.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ejb/LocalCommandExecutorHome.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/LocalCommandExecutorHome.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.pvm.internal.ejb;
+package org.jbpm.enterprise.internal.ejb;
/**
* EJB2 local home for the command executor.
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/LocalTimer.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ejb/LocalTimer.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/LocalTimer.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.pvm.internal.ejb;
+package org.jbpm.enterprise.internal.ejb;
import javax.ejb.EJBLocalObject;
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/LocalTimerHome.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ejb/LocalTimerHome.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/LocalTimerHome.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.pvm.internal.ejb;
+package org.jbpm.enterprise.internal.ejb;
import javax.ejb.EJBLocalHome;
import javax.ejb.FinderException;
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/RemoteCommandExecutor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ejb/RemoteCommandExecutor.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/RemoteCommandExecutor.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.pvm.internal.ejb;
+package org.jbpm.enterprise.internal.ejb;
import java.rmi.RemoteException;
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/RemoteCommandExecutorHome.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ejb/RemoteCommandExecutorHome.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/RemoteCommandExecutorHome.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.pvm.internal.ejb;
+package org.jbpm.enterprise.internal.ejb;
import java.rmi.RemoteException;
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/TimerEB.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ejb/TimerEB.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/TimerEB.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.pvm.internal.ejb;
+package org.jbpm.enterprise.internal.ejb;
import java.rmi.RemoteException;
import java.util.Date;
Copied: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/CommandExecutorTest.java (from rev 2466, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/enterprise/CommandExecutorTest.java)
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/CommandExecutorTest.java (rev 0)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/CommandExecutorTest.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -0,0 +1,115 @@
+/*
+ * 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.jbpm.enterprise.test;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBException;
+import javax.naming.InitialContext;
+
+import org.apache.cactus.ServletTestCase;
+
+import org.jbpm.enterprise.internal.ejb.CommandExecutorSLSB;
+import org.jbpm.enterprise.internal.ejb.LocalCommandExecutor;
+import org.jbpm.enterprise.internal.ejb.LocalCommandExecutorHome;
+import org.jbpm.enterprise.test.custom.InsertPhraseCmd;
+import org.jbpm.enterprise.test.custom.RemovePhraseCmd;
+import org.jbpm.pvm.internal.log.Log;
+
+/**
+ * Server-side test for the {@linkplain CommandExecutorSLSB command executor}.
+ * The local interface is used.
+ *
+ * @author Tom Baeyens
+ * @author Alejandro Guizar
+ */
+public class CommandExecutorTest extends ServletTestCase {
+
+ private LocalCommandExecutor commandExecutor;
+
+ private static final Log log = Log.getLog(CommandExecutorTest.class.getName());
+
+ private static LocalCommandExecutorHome commandExecutorHome;
+
+ @Override
+ protected void setUp() throws Exception {
+ if (commandExecutorHome == null) {
+ // retrieve managed objects
+ InitialContext initialContext = new InitialContext();
+ try {
+ commandExecutorHome = (LocalCommandExecutorHome) initialContext.lookup("java:comp/env/ejb/LocalCommandExecutor");
+ } finally {
+ initialContext.close();
+ }
+ }
+ commandExecutor = commandExecutorHome.create();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ commandExecutor = null;
+ }
+
+ /**
+ * This scenario tests a command that completes with no incident.
+ * <h3>Preconditions</h3>
+ * The TEST_PHRASE table does not contain any row with the specified text.
+ * <h3>Behavior</h3>
+ * The {@link InsertPhraseCmd} command creates a row with the specified text.
+ * <h3>Postconditions</h3>
+ * A new row with the specified text exists in the table. The
+ * {@link RemovePhraseCmd} command removes the row, and the return value confirms
+ * it was there.
+ */
+ public void testHappyCommand() throws CreateException {
+ String text = "been there, done that";
+ commandExecutor.execute(new InsertPhraseCmd(text));
+ // verify phrase was inserted
+ assertTrue(commandExecutor.execute(new RemovePhraseCmd(text)));
+ }
+
+ /**
+ * This scenario tests a command that throws a checked exception inside the
+ * {@link InsertPhraseCmd#execute(org.jbpm.env.Environment) execute} method.
+ * <h3>Preconditions</h3>
+ * The TEST_PHRASE table does not contain any row with the specified text.
+ * <h3>Behavior</h3>
+ * The {@link InsertPhraseCmd} command creates a row with the specified text. The
+ * command is configured to throw a checked exception before completing.
+ * <h3>Postconditions</h3>
+ * The command executor throws an {@link EJBException} and rolls back the
+ * managed transaction. No row with the specified text exists in the database.
+ * The {@link RemovePhraseCmd} command return value confirms the row was not
+ * there.
+ */
+ public void testNoisyCommand() throws CreateException {
+ String text = "houston, we have a problem";
+ // insert phrase via command
+ try {
+ commandExecutor.execute(new InsertPhraseCmd(text, /* fail? */true));
+ fail("expected: " + EJBException.class.getSimpleName());
+ } catch (EJBException e) {
+ log.info("noisy command threw exception", e);
+ // verify phrase was NOT inserted
+ assertFalse(commandExecutor.execute(new RemovePhraseCmd(text)));
+ }
+ }
+}
Copied: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/CommandReceiverTest.java (from rev 2466, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/enterprise/CommandReceiverTest.java)
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/CommandReceiverTest.java (rev 0)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/CommandReceiverTest.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -0,0 +1,178 @@
+/*
+ * 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.jbpm.enterprise.test;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.ObjectMessage;
+import javax.jms.Session;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+import org.apache.cactus.ServletTestCase;
+
+import org.jbpm.enterprise.internal.ejb.CommandReceiverMDB;
+import org.jbpm.enterprise.test.custom.InsertPhraseCmd;
+import org.jbpm.enterprise.test.custom.RemovePhraseCmd;
+import org.jbpm.pvm.internal.cmd.Command;
+
+/**
+ * Server-side test for the {@linkplain CommandReceiverMDB command receiver}.
+ *
+ * @author Alejandro Guizar
+ */
+public class CommandReceiverTest extends ServletTestCase {
+
+ private Connection jmsConnection;
+
+ private static final long TIMEOUT = 2000;
+
+ private static ConnectionFactory jmsConnectionFactory;
+ private static Destination commandQueue;
+
+ @Override
+ protected void setUp() throws Exception {
+ if (jmsConnectionFactory == null) {
+ // retrieve managed objects
+ Context initial = new InitialContext();
+ try {
+ jmsConnectionFactory = (ConnectionFactory) initial.lookup("java:comp/env/jms/CommandConnectionFactory");
+ commandQueue = (Destination) initial.lookup("java:comp/env/jms/CommandQueue");
+ } finally {
+ initial.close();
+ }
+ }
+ jmsConnection = jmsConnectionFactory.createConnection();
+ jmsConnection.start();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ if (jmsConnection != null) {
+ jmsConnection.stop();
+ jmsConnection.close();
+ jmsConnection = null;
+ }
+ }
+
+ /**
+ * This scenario tests a command message that completes with no incident.
+ * <h3>Preconditions</h3>
+ * The TEST_PHRASE table does not contain any row with the specified text.
+ * <h3>Behavior</h3>
+ * The {@link InsertPhraseCmd} command message creates a row with the specified
+ * text. Once the command completes, the command receiver sends the result to
+ * the reply queue.
+ * <h3>Postconditions</h3>
+ * A new row with the specified text exists in the table. The
+ * {@link RemovePhraseCmd} command message removes the row. The result sent to
+ * the reply queue confirms the row was there.
+ */
+ public void testHappyMessage() throws JMSException {
+ final String text = "been there, done that";
+ Session jmsSession = jmsConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ try {
+ // send insert command
+ Command<Void> insertCommand = new InsertPhraseCmd(text, /* fail? */false);
+ Message insertMessage = jmsSession.createObjectMessage(insertCommand);
+ Destination replyTo = jmsSession.createTemporaryQueue();
+ insertMessage.setJMSReplyTo(replyTo);
+ MessageProducer producer = jmsSession.createProducer(commandQueue);
+ producer.send(insertMessage);
+
+ // receive insertion response
+ MessageConsumer insertConsumer = jmsSession.createConsumer(replyTo, "JMSCorrelationID = '" + insertMessage.getJMSMessageID() + "'");
+ ObjectMessage responseMessage = (ObjectMessage) insertConsumer.receive(TIMEOUT);
+ assertNull(responseMessage.getObject());
+
+ // send remove command
+ Command<Boolean> removeCommand = new RemovePhraseCmd(text);
+ Message removeMessage = jmsSession.createObjectMessage(removeCommand);
+ removeMessage.setJMSReplyTo(replyTo);
+ producer.send(removeMessage);
+
+ // receive removal response
+ MessageConsumer removeConsumer = jmsSession.createConsumer(replyTo, "JMSCorrelationID = '" + removeMessage.getJMSMessageID() + "'");
+ responseMessage = (ObjectMessage) removeConsumer.receive(TIMEOUT);
+ // verify phrase was inserted
+ assertTrue((Boolean) responseMessage.getObject());
+ } finally {
+ jmsSession.close();
+ }
+ }
+
+ /**
+ * This scenario tests a command message that throws a checked exception
+ * inside the {@link InsertPhraseCmd#execute(org.jbpm.env.Environment) execute}
+ * method.
+ * <h3>Preconditions</h3>
+ * The TEST_PHRASE table does not contain any row with the specified text.
+ * <h3>Behavior</h3>
+ * The {@link InsertPhraseCmd} command message creates a row with the specified
+ * text. The command is configured to throw a checked exception before
+ * completing. The exception prevents the command receiver from sending the
+ * result to the reply queue.
+ * <h3>Postconditions</h3>
+ * The command receiver rolls back the managed transaction and puts the
+ * insertion message back in the command queue. No row with the specified
+ * exists in the database. The {@link RemovePhraseCmd} command result sent to the
+ * reply queue confirms the row was not there.
+ */
+ public void testNoisyMessage() throws JMSException {
+ final String text = "houston, we have a problem";
+ // insert phrase via command
+ Session jmsSession = jmsConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ try {
+ // send insert command
+ Command<Void> insertCommand = new InsertPhraseCmd(text, /* fail? */true);
+ Message insertMessage = jmsSession.createObjectMessage(insertCommand);
+ Destination replyTo = jmsSession.createTemporaryQueue();
+ insertMessage.setJMSReplyTo(replyTo);
+ MessageProducer producer = jmsSession.createProducer(commandQueue);
+ producer.send(insertMessage);
+
+ // receive insertion response
+ MessageConsumer insertConsumer = jmsSession.createConsumer(replyTo, "JMSCorrelationID = '" + insertMessage.getJMSMessageID() + "'");
+ ObjectMessage insertResponse = (ObjectMessage) insertConsumer.receive(TIMEOUT);
+ assertNull(insertResponse);
+
+ // send remove command
+ Command<Boolean> removeCommand = new RemovePhraseCmd(text);
+ Message removeMessage = jmsSession.createObjectMessage(removeCommand);
+ removeMessage.setJMSReplyTo(replyTo);
+ producer.send(removeMessage);
+
+ // receive removal response
+ MessageConsumer removeConsumer = jmsSession.createConsumer(replyTo, "JMSCorrelationID = '" + removeMessage.getJMSMessageID() + "'");
+ ObjectMessage removeResponse = (ObjectMessage) removeConsumer.receive(TIMEOUT);
+ // verify phrase was NOT inserted
+ assertFalse((Boolean) removeResponse.getObject());
+ } finally {
+ jmsSession.close();
+ }
+ }
+}
Copied: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/EnterpriseTimerSessionTest.java (from rev 2466, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/enterprise/EnterpriseTimerSessionTest.java)
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/EnterpriseTimerSessionTest.java (rev 0)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/EnterpriseTimerSessionTest.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -0,0 +1,166 @@
+/*
+ * 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.jbpm.enterprise.test;
+
+import java.util.Date;
+
+import javax.ejb.CreateException;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+import org.apache.cactus.ServletTestCase;
+import org.jbpm.enterprise.internal.ejb.EnterpriseTimerSession;
+import org.jbpm.enterprise.internal.ejb.LocalCommandExecutor;
+import org.jbpm.enterprise.internal.ejb.LocalCommandExecutorHome;
+import org.jbpm.enterprise.test.custom.HappyActivity;
+import org.jbpm.pvm.Execution;
+import org.jbpm.pvm.Deployment;
+import org.jbpm.pvm.env.Environment;
+import org.jbpm.pvm.internal.cmd.Command;
+import org.jbpm.pvm.internal.cmd.DeployCmd;
+import org.jbpm.pvm.internal.cmd.StartExecutionCmd;
+import org.jbpm.pvm.internal.job.TimerImpl;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
+import org.jbpm.pvm.model.OpenProcessDefinition;
+import org.jbpm.pvm.model.ProcessFactory;
+import org.jbpm.pvm.session.DbSession;
+import org.jbpm.pvm.session.TimerSession;
+
+/**
+ * Server-side test for the enterprise
+ * {@linkplain EnterpriseTimerSession timerImpl session}.
+ *
+ * @author Alejandro Guizar
+ */
+public class EnterpriseTimerSessionTest extends ServletTestCase {
+
+ private LocalCommandExecutor commandExecutor;
+
+ private static final int TIMEOUT = 2000;
+
+ private static LocalCommandExecutorHome commandExecutorHome;
+
+ protected void setUp() throws Exception {
+ // lookup home in jndi
+ if (commandExecutorHome == null) {
+ Context initialContext = new InitialContext();
+ try {
+ commandExecutorHome = (LocalCommandExecutorHome) initialContext.lookup("java:comp/env/ejb/LocalCommandExecutor");
+ } finally {
+ initialContext.close();
+ }
+ }
+ // create local bean
+ commandExecutor = commandExecutorHome.create();
+ // deploy process
+ OpenProcessDefinition processDefinition = ProcessFactory.build(getName())
+ .timer(TIMEOUT + " milliseconds", null)
+ .event("timeout")
+ .listener(new ObjectDescriptor(HappyActivity.class))
+ .done();
+ commandExecutor.execute(new DeployCmd(new Deployment(processDefinition)));
+ }
+
+ protected void tearDown() throws Exception {
+ commandExecutor = null;
+ }
+
+ /**
+ * This scenario schedules a non-repeating timerImpl whose referenced activity
+ * completes with no incident.
+ * <h3>Preconditions</h3>
+ * The activity has not executed.
+ * <h3>Behavior</h3>
+ * The {@link ScheduleTimerCmd} command activates a timerImpl. After that, the test
+ * waits for the activity to execute. Upon timeout, the
+ * {@linkplain HappyActivity activity} notifies the test of its execution.
+ * <h3>Postconditions</h3>
+ * The activity executes on or after the timerImpl's due date.
+ */
+ public void testSchedule() throws CreateException {
+ // start an execution
+ Execution execution = commandExecutor.execute(new StartExecutionCmd("timers included", null, null));
+
+ /* TODO timers will have to be fetched with a call to the management service
+
+ Timer timer = execution.getTimers().iterator().next();
+
+ Date dueDate = timer.getDueDate();
+ Date executionDate = HappyActivity.waitFor();
+ assertTrue(dueDate.compareTo(executionDate) <= 0);
+ */
+ }
+
+ /**
+ * This scenario schedules a non-repeating timerImpl and immediately cancels it.
+ * <h3>Preconditions</h3>
+ * The activity has not executed.
+ * <h3>Behavior</h3>
+ * The {@link ScheduleTimerCmd} command activates a timerImpl, which is immediately
+ * disabled by the {@link CancelTimerCmd} command. After that, the test waits
+ * past the timerImpl's due date.
+ * <h3>Postconditions</h3>
+ * The activity does not execute, ever.
+ */
+ public void testCancel() throws CreateException {
+ // start an execution
+ commandExecutor.execute(new StartExecutionCmd("timers included", null, null));
+
+ Date executionDate = HappyActivity.waitFor(2 * TIMEOUT);
+ assertNull(executionDate);
+ }
+
+ static class ScheduleTimerCmd implements Command<Void> {
+
+ private final TimerImpl timer;
+
+ private static final long serialVersionUID = 1L;
+
+ ScheduleTimerCmd(TimerImpl timer) {
+ this.timer = timer;
+ }
+
+ public Void execute(Environment environment) throws Exception {
+ environment.get(DbSession.class).save(timer.getExecution());
+ environment.get(TimerSession.class).schedule(timer);
+ return null;
+ }
+ }
+
+ static class CancelTimerCmd implements Command<Void> {
+
+ private final long timerDbid;
+
+ private static final long serialVersionUID = 1L;
+
+ CancelTimerCmd(long timerDbid) {
+ this.timerDbid = timerDbid;
+ }
+
+ public Void execute(Environment environment) throws Exception {
+ TimerImpl timerImpl = environment.get(DbSession.class).get(TimerImpl.class, timerDbid);
+ environment.get(TimerSession.class).cancel(timerImpl);
+ return null;
+ }
+ }
+
+}
Copied: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/TimerTest.java (from rev 2466, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/enterprise/TimerTest.java)
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/TimerTest.java (rev 0)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/TimerTest.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -0,0 +1,256 @@
+/*
+ * 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.jbpm.enterprise.test;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.ejb.CreateException;
+import javax.naming.InitialContext;
+
+import org.apache.cactus.ServletTestCase;
+import org.jbpm.enterprise.internal.ejb.LocalCommandExecutor;
+import org.jbpm.enterprise.internal.ejb.LocalCommandExecutorHome;
+import org.jbpm.enterprise.internal.ejb.LocalTimer;
+import org.jbpm.enterprise.internal.ejb.LocalTimerHome;
+import org.jbpm.enterprise.internal.ejb.TimerEB;
+import org.jbpm.enterprise.test.custom.HappyActivity;
+import org.jbpm.enterprise.test.custom.NoisyActivity;
+import org.jbpm.pvm.Deployment;
+import org.jbpm.pvm.env.Environment;
+import org.jbpm.pvm.internal.cmd.Command;
+import org.jbpm.pvm.internal.cmd.DeployCmd;
+import org.jbpm.pvm.internal.cmd.GetVariablesCmd;
+import org.jbpm.pvm.internal.cmd.StartExecutionCmd;
+import org.jbpm.pvm.internal.job.TimerImpl;
+import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
+import org.jbpm.pvm.model.OpenProcessDefinition;
+import org.jbpm.pvm.model.ProcessFactory;
+import org.jbpm.pvm.session.DbSession;
+
+/**
+ * Server-side test for the {@linkplain TimerEB timerImpl bean}. The local
+ * interface is used.
+ *
+ * @author Alejandro Guizar
+ */
+public class TimerTest extends ServletTestCase {
+
+ private OpenProcessDefinition processDefinition;
+ private ObjectDescriptor activityDescriptor = new ObjectDescriptor();
+
+ private LocalCommandExecutor commandExecutor;
+
+ private static final int TIMEOUT = 2000;
+ private static final int REPEAT = 1000;
+
+ private static final Log log = Log.getLog(TimerTest.class.getName());
+
+ private static LocalTimerHome timerHome;
+ private static LocalCommandExecutorHome commandExecutorHome;
+
+ protected void setUp() throws Exception {
+ // lookup homes in jndi
+ if (commandExecutorHome == null) {
+ InitialContext initialContext = new InitialContext();
+ try {
+ commandExecutorHome = (LocalCommandExecutorHome) initialContext.lookup("java:comp/env/ejb/LocalCommandExecutor");
+ timerHome = (LocalTimerHome) initialContext.lookup("java:comp/env/ejb/LocalTimer");
+ } finally {
+ initialContext.close();
+ }
+ }
+ // create local bean
+ commandExecutor = commandExecutorHome.create();
+ // define process
+ processDefinition = ProcessFactory.build(getName())
+ .event("timeout")
+ .listener(activityDescriptor)
+ .done();
+ }
+
+ protected void tearDown() throws Exception {
+ commandExecutor = null;
+ }
+
+ /**
+ * This scenario tests a non-repeating timerImpl whose referenced activity
+ * completes with no incident.
+ * <h3>Preconditions</h3>
+ * The activity has not executed.
+ * <h3>Behavior</h3>
+ * The {@link CreateTimerCmd} command subscribes a timerImpl bean to the EJB timerImpl
+ * service. After that, the test waits for the activity to execute. Upon
+ * timeout, the {@linkplain HappyActivity activity} notifies the test of its
+ * execution.
+ * <h3>Postconditions</h3>
+ * The activity executes on or after the timerImpl's due date.
+ */
+ public void testHappyTimer() throws CreateException {
+ activityDescriptor.setClassName(HappyActivity.class.getName());
+ commandExecutor.execute(new DeployCmd(new Deployment(processDefinition)));
+
+ ExecutionImpl execution = (ExecutionImpl) commandExecutor.execute(new StartExecutionCmd(processDefinition.getName(), null, null));
+
+ Date dueDate = new Date(System.currentTimeMillis() + TIMEOUT);
+ TimerImpl timerImpl = new TimerImpl();
+ timerImpl.setEventName("timeout");
+ timerImpl.setDueDate(dueDate);
+ timerImpl.setExecution(execution);
+ commandExecutor.execute(new CreateTimerCmd(timerImpl));
+
+ Date executionDate = HappyActivity.waitFor();
+ assertTrue(dueDate.compareTo(executionDate) <= 0);
+ }
+
+ /**
+ * This scenario tests a non-repeating timerImpl whose referenced activity throws
+ * a checked exception.
+ * <h3>Preconditions</h3>
+ * The activity has not executed.
+ * <h3>Behavior</h3>
+ * The {@link CreateTimerCmd} command subscribes a timerImpl bean to the EJB timerImpl
+ * service. After that, the test waits for the activity to execute. Upon
+ * timeout, the {@linkplain NoisyActivity activity} notifies the test of its
+ * execution, sets a variable and throws a checked exception.
+ * <h3>Postconditions</h3>
+ * The activity executes on or after the timerImpl's due date. The EJB timerImpl
+ * service rolls back the managed transaction. The variable is unset.
+ */
+ public void testNoisyTimer() throws CreateException {
+ activityDescriptor.setClassName(NoisyActivity.class.getName());
+ commandExecutor.execute(new DeployCmd(new Deployment(processDefinition)));
+
+ ExecutionImpl execution = (ExecutionImpl) commandExecutor.execute(new StartExecutionCmd(processDefinition.getName(), null, null));
+
+ Date dueDate = new Date(System.currentTimeMillis() + TIMEOUT);
+ TimerImpl timerImpl = new TimerImpl();
+ timerImpl.setEventName("timeout");
+ timerImpl.setDueDate(dueDate);
+ timerImpl.setExecution(execution);
+ commandExecutor.execute(new CreateTimerCmd(timerImpl));
+
+ Date executionDate = NoisyActivity.waitFor();
+ assertTrue(dueDate.compareTo(executionDate) <= 0);
+
+ List<String> variableNames = new ArrayList<String>();
+ variableNames.add("executionDate");
+ Object variableValue = commandExecutor.execute(new GetVariablesCmd(execution.getId(), variableNames));
+ assertNull(variableValue);
+ }
+
+ /**
+ * This scenario tests a repeating timerImpl whose referenced activity completes
+ * with no incident.
+ * <h3>Preconditions</h3>
+ * The activity has not executed.
+ * <h3>Behavior</h3>
+ * The {@link CreateTimerCmd} command subscribes a timerImpl bean to the EJB timerImpl
+ * service. After that, the test waits for the first execution of the
+ * activity, and then for the subsequent <em>n</em> executions of the
+ * activity. Upon each timeout, the {@linkplain HappyActivity activity}
+ * notifies the test of its execution.
+ * <h3>Postconditions</h3>
+ * The first execution of the activity occurs on or after the timerImpl's due
+ * date. The subsequent <em>n</em> executions of the activity occur on or
+ * after the timerImpl's repeat interval.
+ */
+ public void testCyclicTimer() throws CreateException {
+ activityDescriptor.setClassName(HappyActivity.class.getName());
+ commandExecutor.execute(new DeployCmd(new Deployment(processDefinition)));
+
+ ExecutionImpl execution = (ExecutionImpl) commandExecutor.execute(new StartExecutionCmd(processDefinition.getName(), null, null));
+
+ Date dueDate = new Date(System.currentTimeMillis() + TIMEOUT);
+ TimerImpl timerImpl = new TimerImpl();
+ timerImpl.setEventName("timeout");
+ timerImpl.setDueDate(dueDate);
+ timerImpl.setRepeat(REPEAT + " milliseconds");
+ timerImpl.setExecution(execution);
+ commandExecutor.execute(new CreateTimerCmd(timerImpl));
+
+ try {
+ Date executionTime = HappyActivity.waitFor();
+ assertTrue(dueDate.compareTo(executionTime) <= 0);
+
+ for (int i = 0; i < 5; i++) {
+ dueDate.setTime(dueDate.getTime() + REPEAT);
+ log.info("next execution due " + TimerImpl.formatDueDate(dueDate));
+ executionTime = HappyActivity.waitFor();
+ assertTrue(dueDate.compareTo(executionTime) <= 0);
+ }
+ } finally {
+ commandExecutor.execute(new CancelTimerCmd(timerImpl.getDbid()));
+ }
+ }
+
+ static class CreateTimerCmd implements Command<Void> {
+
+ private final TimerImpl timerImpl;
+
+ private static final long serialVersionUID = 1L;
+
+ CreateTimerCmd(TimerImpl timerImpl) {
+ this.timerImpl = timerImpl;
+ }
+
+ public Void execute(Environment environment) throws Exception {
+ DbSession dbSession = environment.get(DbSession.class);
+ dbSession.save(timerImpl);
+ dbSession.flush();
+
+ long timerDbid = timerImpl.getDbid();
+ log.info("scheduling " + timerImpl + " #" + timerDbid);
+ LocalTimer timerBean = timerHome.findByPrimaryKey(timerDbid);
+ timerBean.schedule();
+ return null;
+ }
+
+ public String toString() {
+ return CreateTimerCmd.class.getSimpleName() + '(' + timerImpl + ')';
+ }
+ }
+
+ static class CancelTimerCmd implements Command<Void> {
+
+ private final long timerDbid;
+
+ private static final long serialVersionUID = 1L;
+
+ CancelTimerCmd(long timerDbid) {
+ this.timerDbid = timerDbid;
+ }
+
+ public Void execute(Environment environment) throws Exception {
+ LocalTimer timerBean = timerHome.findByPrimaryKey(timerDbid);
+ timerBean.remove();
+ return null;
+ }
+
+ public String toString() {
+ return CancelTimerCmd.class.getSimpleName() + '(' + timerDbid + ')';
+ }
+ }
+}
Copied: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/custom (from rev 2466, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/enterprise/custom)
Modified: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/custom/HappyActivity.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/enterprise/custom/HappyActivity.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/custom/HappyActivity.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.pvm.enterprise.custom;
+package org.jbpm.enterprise.test.custom;
import java.util.Date;
Modified: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/custom/InsertPhraseCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/enterprise/custom/InsertPhraseCmd.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/custom/InsertPhraseCmd.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.pvm.enterprise.custom;
+package org.jbpm.enterprise.test.custom;
import java.sql.SQLException;
Modified: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/custom/NoisyActivity.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/enterprise/custom/NoisyActivity.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/custom/NoisyActivity.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.pvm.enterprise.custom;
+package org.jbpm.enterprise.test.custom;
import java.sql.SQLException;
import java.util.Date;
Modified: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/custom/Phrase.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/enterprise/custom/Phrase.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/custom/Phrase.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.pvm.enterprise.custom;
+package org.jbpm.enterprise.test.custom;
/**
* @author Alejandro Guizar
Modified: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/custom/RemovePhraseCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/enterprise/custom/RemovePhraseCmd.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/custom/RemovePhraseCmd.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.pvm.enterprise.custom;
+package org.jbpm.enterprise.test.custom;
import java.util.List;
Added: jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/CommandExecutorSLSB.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/CommandExecutorSLSB.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/CommandReceiverMDB.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/CommandReceiverMDB.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/EnterpriseLocalCommandService.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/EnterpriseLocalCommandService.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/EnterpriseTimerSession.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/EnterpriseTimerSession.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/ExecuteTimerCmd.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/ExecuteTimerCmd.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/LocalCommandExecutor.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/LocalCommandExecutor.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/LocalCommandExecutorHome.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/LocalCommandExecutorHome.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/LocalTimer.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/LocalTimer.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/LocalTimerHome.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/LocalTimerHome.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/RemoteCommandExecutor.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/RemoteCommandExecutor.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/RemoteCommandExecutorHome.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/RemoteCommandExecutorHome.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/TimerEB.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/enterprise/target/classes/org/jbpm/enterprise/internal/ejb/TimerEB.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/CommandExecutorTest.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/CommandExecutorTest.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/CommandReceiverTest.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/CommandReceiverTest.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/EnterpriseTimerSessionTest$CancelTimerCmd.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/EnterpriseTimerSessionTest$CancelTimerCmd.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/EnterpriseTimerSessionTest$ScheduleTimerCmd.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/EnterpriseTimerSessionTest$ScheduleTimerCmd.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/EnterpriseTimerSessionTest.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/EnterpriseTimerSessionTest.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/TimerTest$CancelTimerCmd.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/TimerTest$CancelTimerCmd.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/TimerTest$CreateTimerCmd.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/TimerTest$CreateTimerCmd.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/TimerTest.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/TimerTest.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/custom/HappyActivity.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/custom/HappyActivity.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/custom/InsertPhraseCmd.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/custom/InsertPhraseCmd.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/custom/NoisyActivity.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/custom/NoisyActivity.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/custom/Phrase.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/custom/Phrase.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/custom/Phrase.hbm.xml
===================================================================
--- jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/custom/Phrase.hbm.xml (rev 0)
+++ jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/custom/Phrase.hbm.xml 2008-10-03 10:48:31 UTC (rev 2471)
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping default-access="field" auto-import="false">
+ <class name="org.jbpm.pvm.enterprise.custom.Phrase" table="TEST_PHRASE">
+ <id name="id" column="ID_">
+ <generator class="native" />
+ </id>
+ <property name="text" column="TEXT_" />
+ </class>
+</hibernate-mapping>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/custom/Phrase.hbm.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/custom/RemovePhraseCmd.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/enterprise/target/test-classes/org/jbpm/enterprise/test/custom/RemovePhraseCmd.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: jbpm4/trunk/modules/pvm/.classpath
===================================================================
--- jbpm4/trunk/modules/pvm/.classpath 2008-10-03 06:50:46 UTC (rev 2470)
+++ jbpm4/trunk/modules/pvm/.classpath 2008-10-03 10:48:31 UTC (rev 2471)
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Modified: jbpm4/trunk/modules/pvm/pom.xml
===================================================================
--- jbpm4/trunk/modules/pvm/pom.xml 2008-10-03 06:50:46 UTC (rev 2470)
+++ jbpm4/trunk/modules/pvm/pom.xml 2008-10-03 10:48:31 UTC (rev 2471)
@@ -187,22 +187,6 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludes>
- <!-- https://jira.jboss.org/jira/browse/JBPM-1758 -->
- <exclude>org/jbpm/pvm/api/db/basicfeatures/*Test.java</exclude>
- <exclude>org/jbpm/pvm/api/timer/*Test.java</exclude>
- <exclude>org/jbpm/pvm/enterprise/*Test.java</exclude>
- <exclude>org/jbpm/pvm/example05/*Test.java</exclude>
- <exclude>org/jbpm/pvm/internal/db/langext/*Test.java</exclude>
- <exclude>org/jbpm/pvm/internal/db/model/HibernateJobDbSessionTest.java</exclude>
- <exclude>org/jbpm/pvm/internal/expr/*Test.java</exclude>
- <exclude>org/jbpm/pvm/internal/jobexecutor/*Test.java</exclude>
- <exclude>org/jbpm/pvm/internal/tx/*Test.java</exclude>
- <exclude>org/jbpm/pvm/internal/xml/*Test.java</exclude>
- <exclude>org/jbpm/pvm/samples/**/*Test.java</exclude>
- </excludes>
- </configuration>
</plugin>
</plugins>
</build>
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2008-10-03 06:50:46 UTC (rev 2470)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -49,7 +49,7 @@
import org.jbpm.pvm.internal.model.op.MoveToChildNode;
import org.jbpm.pvm.internal.model.op.MoveToParentNode;
import org.jbpm.pvm.internal.model.op.ProceedToDestination;
-import org.jbpm.pvm.internal.model.op.Signal;
+import org.jbpm.pvm.internal.model.op.IncomingExecutionEvent;
import org.jbpm.pvm.internal.model.op.TakeTransition;
import org.jbpm.pvm.internal.type.Converter;
import org.jbpm.pvm.internal.type.Type;
@@ -378,7 +378,7 @@
public void signal(String signal, Map<String, Object> parameters) {
checkLock();
if (node!=null) {
- performAtomicOperation(new Signal(signal, parameters, node));
+ performAtomicOperation(new IncomingExecutionEvent(signal, parameters, node));
} else if (transition!=null) {
performAtomicOperation(ExecutionImpl.PROCEED_TO_DESTINATION);
} else {
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/IncomingExecutionEvent.java (from rev 2466, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/IncomingExecutionEvent.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/IncomingExecutionEvent.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -0,0 +1,87 @@
+/*
+ * 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.jbpm.pvm.internal.model.op;
+
+import java.util.Map;
+
+import org.jbpm.pvm.PvmException;
+import org.jbpm.pvm.activity.ExternalActivity;
+import org.jbpm.pvm.internal.job.MessageImpl;
+import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ExecutionImpl.Propagation;
+
+/**
+ * @author Tom Baeyens
+ */
+public class IncomingExecutionEvent implements AtomicOperation {
+
+ private static final Log log = Log.getLog(IncomingExecutionEvent.class.getName());
+
+ String signalName;
+ Map<String, Object> parameters;
+ NodeImpl node;
+
+ public IncomingExecutionEvent(String signalName, Map<String, Object> parameters, NodeImpl node) {
+ this.signalName = signalName;
+ this.parameters = parameters;
+ this.node = node;
+ }
+
+ public boolean isAsync(ExecutionImpl execution) {
+ return execution.getNode().isSignalAsync();
+ }
+
+ public void perform(ExecutionImpl execution) {
+ if (execution.getName()!=null) {
+ log.debug(execution.toString()+" signals "+node);
+ } else {
+ log.debug("signalling "+node+", signal="+signalName);
+ }
+
+ ExternalActivity externalActivity = (ExternalActivity) node.getBehaviour();
+
+ try {
+ execution.setPropagation(Propagation.UNSPECIFIED);
+ externalActivity.signal(execution, signalName, parameters);
+
+ } catch (RuntimeException e) {
+ throw e;
+
+ } catch (Exception e) {
+ throw new PvmException("couldn't signal "+node+": "+e.getMessage(), e);
+ }
+
+ if (execution.getPropagation() == Propagation.UNSPECIFIED) {
+ execution.proceed();
+ }
+ }
+
+ public String toString() {
+ return "signal(node)";
+ }
+
+ public MessageImpl<?> createAsyncMessage(ExecutionImpl execution) {
+ return new SignalMessage(execution, signalName, node);
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/IncomingExecutionEvent.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToParentNode.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToParentNode.java 2008-10-03 06:50:46 UTC (rev 2470)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToParentNode.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -39,7 +39,7 @@
// (so that the call to moveTo updates the previous node)
propagatingExecution.setNode(node);
propagatingExecution.moveTo(parentNode);
- propagatingExecution.performAtomicOperation(new Signal(null, null, parentNode));
+ propagatingExecution.performAtomicOperation(new IncomingExecutionEvent(null, null, parentNode));
}
public MessageImpl<?> createAsyncMessage(ExecutionImpl execution) {
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java 2008-10-03 06:50:46 UTC (rev 2470)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -1,87 +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.jbpm.pvm.internal.model.op;
-
-import java.util.Map;
-
-import org.jbpm.pvm.PvmException;
-import org.jbpm.pvm.activity.ExternalActivity;
-import org.jbpm.pvm.internal.job.MessageImpl;
-import org.jbpm.pvm.internal.log.Log;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.NodeImpl;
-import org.jbpm.pvm.internal.model.ExecutionImpl.Propagation;
-
-/**
- * @author Tom Baeyens
- */
-public class Signal implements AtomicOperation {
-
- private static final Log log = Log.getLog(Signal.class.getName());
-
- String signalName;
- Map<String, Object> parameters;
- NodeImpl node;
-
- public Signal(String signalName, Map<String, Object> parameters, NodeImpl node) {
- this.signalName = signalName;
- this.parameters = parameters;
- this.node = node;
- }
-
- public boolean isAsync(ExecutionImpl execution) {
- return execution.getNode().isSignalAsync();
- }
-
- public void perform(ExecutionImpl execution) {
- if (execution.getName()!=null) {
- log.debug(execution.toString()+" signals "+node);
- } else {
- log.debug("signalling "+node+", signal="+signalName);
- }
-
- ExternalActivity externalActivity = (ExternalActivity) node.getBehaviour();
-
- try {
- execution.setPropagation(Propagation.UNSPECIFIED);
- externalActivity.signal(execution, signalName, parameters);
-
- } catch (RuntimeException e) {
- throw e;
-
- } catch (Exception e) {
- throw new PvmException("couldn't signal "+node+": "+e.getMessage(), e);
- }
-
- if (execution.getPropagation() == Propagation.UNSPECIFIED) {
- execution.proceed();
- }
- }
-
- public String toString() {
- return "signal(node)";
- }
-
- public MessageImpl<?> createAsyncMessage(ExecutionImpl execution) {
- return new SignalMessage(execution, signalName, node);
- }
-}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/SignalMessage.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/SignalMessage.java 2008-10-03 06:50:46 UTC (rev 2470)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/SignalMessage.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -49,8 +49,8 @@
public Object execute(Environment environment) throws Exception {
unlockExecution();
- Signal signal = new Signal(signalName, null, node);
- execution.performAtomicOperationSync(signal);
+ IncomingExecutionEvent incomingExecutionEvent = new IncomingExecutionEvent(signalName, null, node);
+ execution.performAtomicOperationSync(incomingExecutionEvent);
JobDbSession jobDbSession = environment.get(JobDbSession.class);
jobDbSession.delete(this);
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TimerSessionBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TimerSessionBinding.java 2008-10-03 06:50:46 UTC (rev 2470)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TimerSessionBinding.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -1,63 +0,0 @@
-/**
- * Copyright (C) 2007 Bull S. A. S.
- * Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois
- * This library 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
- * version 2.1 of the License.
- * This library 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
- * program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110-1301, USA.
- **/
-package org.jbpm.pvm.internal.wire.binding;
-
-import org.jbpm.pvm.internal.ejb.EnterpriseTimerSession;
-import org.jbpm.pvm.internal.jobexecutor.JobDbSession;
-import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
-import org.jbpm.pvm.internal.jobexecutor.JobExecutorTimerSession;
-import org.jbpm.pvm.internal.util.XmlUtil;
-import org.jbpm.pvm.internal.wire.descriptor.ContextTypeRefDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.EnvironmentTypeRefDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.TransactionRefDescriptor;
-import org.jbpm.pvm.internal.xml.Parse;
-import org.jbpm.pvm.internal.xml.Parser;
-import org.jbpm.pvm.session.TimerSession;
-import org.w3c.dom.Element;
-
-/** parses a descriptor for creating a {@link TimerSession}.
- *
- * See schema docs for more details.
- *
- * @author Tom Baeyens, Pascal Verdage
- */
-public class TimerSessionBinding extends WireDescriptorBinding {
-
- public TimerSessionBinding() {
- super("timer-session");
- }
-
- public Object parse(Element element, Parse parse, Parser parser) {
- ObjectDescriptor objectDescriptor = new ObjectDescriptor();
-
- String target = XmlUtil.attribute(element, "target");
-
- if ((target!=null) && ("ejb".equalsIgnoreCase(target))) {
- objectDescriptor.setClassName(EnterpriseTimerSession.class.getName());
-
- } else {
- // wire the JobExecutorTimerSession
- objectDescriptor.setClassName(JobExecutorTimerSession.class.getName());
-
- // inject fields
- objectDescriptor.addInjection("transaction", new TransactionRefDescriptor());
- objectDescriptor.addInjection("jobExecutor", new EnvironmentTypeRefDescriptor(JobExecutor.class));
- objectDescriptor.addInjection("jobDbSession", new ContextTypeRefDescriptor(JobDbSession.class));
- }
-
- return objectDescriptor;
- }
-}
-
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/basicfeatures/BasicExecutionFlowDbTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/basicfeatures/BasicExecutionFlowDbTest.java 2008-10-03 06:50:46 UTC (rev 2470)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/basicfeatures/BasicExecutionFlowDbTest.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -78,8 +78,6 @@
Deployment deployment = new Deployment(processDefinition);
processService.deploy(deployment);
- executionService.startExecution("myProcess:1", "zero");
-
Execution processInstance = executionService.startExecution("myProcess:1", "one");
List<String> expectedEvents = new ArrayList<String>();
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/timer/TimerUnitTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/timer/TimerUnitTest.java 2008-10-03 06:50:46 UTC (rev 2470)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/timer/TimerUnitTest.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -1,176 +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.jbpm.pvm.api.timer;
-
-import java.util.Date;
-
-import org.jbpm.pvm.test.base.JbpmTestCase;
-import org.jbpm.pvm.internal.job.TimerImpl;
-import org.jbpm.pvm.job.Timer;
-
-/**
- * @author Tom Baeyens
- * @author Pascal Verdage
- */
-public class TimerUnitTest extends JbpmTestCase
-{
-
-
- protected Timer timer() {
- return new TimerImpl();
- }
-
- public void testSetDueDate() throws Exception {
- TimerImpl timer = new TimerImpl();
- Date now = new Date(System.currentTimeMillis());
- timer.setDueDate(now);
- TestTimerSession timerSession = new TestTimerSession();
- timerSession.schedule(timer);
- assertEquals(1, timerSession.getNbTimer());
- assertEquals(timer, timerSession.getFirstTimer());
- timerSession.executeFirstTimer();
- assertEquals(0, timerSession.getNbTimer());
- }
-
- /*
- TODO finish after refactoring
-
-
- public void testSetDueDateDescription() throws Exception {
- TimerImpl timerImpl = new TimerImpl();
- timerImpl.setDueDateDescription("5 seconds");
- TestTimerSession timerSession = new TestTimerSession();
- timerSession.schedule(timerImpl);
- assertEquals(1, timerSession.getNbTimer());
- assertEquals(timerImpl, timerSession.getFirstTimer());
- timerSession.executeFirstTimer();
- assertEquals(0, timerSession.getNbTimer());
- }
-
- public void testRepeatedTimer() throws Exception {
- TimerImpl timerImpl = new TimerImpl();
- Date now= new Date();
- timerImpl.setDueDate(now);
- timerImpl.setRepeat("3 seconds");
- TestTimerSession timerSession = new TestTimerSession();
- timerSession.schedule(timerImpl);
- assertEquals(1, timerSession.getNbTimer());
- assertEquals(timerImpl, timerSession.getFirstTimer());
- timerSession.executeFirstTimer();
- assertEquals(1, timerSession.getNbTimer());
- }
-
- private static class TestActivityInstance extends ActivityInstanceImpl {
- private static final long serialVersionUID = 1L;
- private int executionCount = 0;
-
- public void signal(String signalName, Map<String, Object> parameters) {
- executionCount++;
- }
- public int getExecutionCount() {
- return executionCount;
- }
-
- public String toString() {
- return "test activity";
- }
- }
-
- public void testActivityInstanceNoSignalNoEvent() throws Exception {
- TimerImpl timerImpl = new TimerImpl();
- TestActivityInstance instance = new TestActivityInstance();
- TestExecution execution = new TestExecution();
- timerImpl.setActivityInstance(instance);
- timerImpl.setExecution(execution);
- TestTimerSession timerSession = new TestTimerSession();
- timerSession.schedule(timerImpl);
- assertEquals(1, timerSession.getNbTimer());
- timerSession.executeFirstTimer();
- assertEquals(0, timerSession.getNbTimer());
- assertEquals(0, instance.getExecutionCount());
- assertEquals(0, execution.getExecutionCount());
- }
-
- public void testActivityInstanceWithSignal() throws Exception {
- TimerImpl timerImpl = new TimerImpl();
- TestActivityInstance instance = new TestActivityInstance();
- TestExecution execution = new TestExecution();
- timerImpl.setActivityInstance(instance);
- timerImpl.setSignalName("timeout");
- timerImpl.setExecution(execution);
- TestTimerSession timerSession = new TestTimerSession();
- timerSession.schedule(timerImpl);
- assertEquals(1, timerSession.getNbTimer());
- timerSession.executeFirstTimer();
- assertEquals(0, timerSession.getNbTimer());
- assertEquals(1, instance.getExecutionCount());
- assertEquals(0, execution.getExecutionCount());
- }
-
- private static class TestExecution extends ExecutionImpl {
- private static final long serialVersionUID = 1L;
- private int executionCount = 0;
-
- public int getExecutionCount() {
- return executionCount;
- }
-
- public void fire(String eventName, ObservableElement eventSource) {
- executionCount++;
- }
-
- public String toString() {
- return "test execution";
- }
- }
-
- public void testActivityInstanceWithEvent() throws Exception {
- TimerImpl timerImpl = new TimerImpl();
- TestActivityInstance instance = new TestActivityInstance();
- TestExecution execution = new TestExecution();
- timerImpl.setActivityInstance(instance);
- timerImpl.setEventName("timeout");
- timerImpl.setExecution(execution);
- TestTimerSession timerSession = new TestTimerSession();
- timerSession.schedule(timerImpl);
- assertEquals(1, timerSession.getNbTimer());
- timerSession.executeFirstTimer();
- assertEquals(0, timerSession.getNbTimer());
- assertEquals(0, instance.getExecutionCount());
- assertEquals(1, execution.getExecutionCount());
- }
-
- public void testEventWithNoActivityInstance() throws Exception {
- TimerImpl timerImpl = new TimerImpl();
- TestExecution execution = new TestExecution();
- timerImpl.setEventName("timeout");
- timerImpl.setExecution(execution);
- TestTimerSession timerSession = new TestTimerSession();
- timerSession.schedule(timerImpl);
- assertEquals(1, timerSession.getNbTimer());
- timerSession.executeFirstTimer();
- assertEquals(0, timerSession.getNbTimer());
- assertEquals(1, execution.getExecutionCount());
- }
-
- */
-}
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/HibernateJobDbSessionTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/HibernateJobDbSessionTest.java 2008-10-03 06:50:46 UTC (rev 2470)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/HibernateJobDbSessionTest.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -1,418 +0,0 @@
-package org.jbpm.pvm.internal.db.model;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import org.jbpm.pvm.ManagementService;
-import org.jbpm.pvm.env.Environment;
-import org.jbpm.pvm.internal.job.JobImpl;
-import org.jbpm.pvm.internal.job.TimerImpl;
-import org.jbpm.pvm.internal.jobexecutor.JobDbSession;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.job.Timer;
-import org.jbpm.pvm.session.DbSession;
-import org.jbpm.pvm.test.base.EnvironmentDbTestCase;
-
-/**
- * @author Pascal Verdage
- */
-public class HibernateJobDbSessionTest extends EnvironmentDbTestCase
-{
- protected long executionId;
-
- @Override
- public void setUp() throws Exception {
- super.setUp();
- assertNotNull(Environment.getCurrent());
-
- ExecutionImpl execution = new ExecutionImpl();
- execution.setProcessInstance(execution);
- Environment.getCurrent().get(DbSession.class).save(execution);
- executionId = execution.getDbid();
-
- newTransaction();
- }
-
- @Override
- public void tearDown() throws Exception {
- newTransaction();
-
- DbSession dbSession = Environment.getCurrent().get(DbSession.class);
- dbSession.delete(dbSession.get(ExecutionImpl.class, executionId));
- executionId = 0;
-
- super.tearDown();
- }
-
- private ExecutionImpl getExecution() {
- assertNotNull(Environment.getCurrent());
- return Environment.getCurrent().get(DbSession.class).get(ExecutionImpl.class, executionId);
- }
-
- private void cleanTimers() {
- ManagementService pvmService = Environment.getCurrent().get(ManagementService.class);
- JobDbSession jobDbSession = Environment.getCurrent().get(JobDbSession.class);
- List<Timer> timers = pvmService.getTimers(0, 10);
- while (! timers.isEmpty()) {
- for (Timer timer : timers) {
- jobDbSession.delete(timer);
- }
- }
- }
-
- /** Test the methods save, get and delete with only one jobImpl */
- public void testSaveGetDelete() {
- long id;
-
- JobImpl<?> jobImpl = new TimerImpl();
- JobDbSession jobDbSession = Environment.getCurrent().get(JobDbSession.class);
- assertNull(jobDbSession.getJob(jobImpl.getDbid()));
- assertEquals(0,jobImpl.getDbid());
- jobDbSession.save(jobImpl);
- id = jobImpl.getDbid();
- assertNotSame(0, jobDbSession.getJob(id));
- assertNotNull(id);
-
- newTransaction();
-
- jobDbSession = Environment.getCurrent().get(JobDbSession.class);
- jobImpl = jobDbSession.getJob(id);
- assertNotNull(jobImpl);
- jobDbSession.delete(jobImpl);
- assertNull(jobDbSession.getJob(id));
- }
-
- /**
- * Test the method save with two jobs:
- * check that the jobs are given different ids.
- */
- public void testSaveTwoJobs() {
- JobImpl<?> job1 = new TimerImpl();
- JobImpl<?> job2 = new TimerImpl();
- JobDbSession jobDbSession = Environment.getCurrent().get(JobDbSession.class);
- jobDbSession.save(job1);
- jobDbSession.save(job2);
- assertNotSame(job1.getDbid(), job2.getDbid());
- jobDbSession.delete(job1);
- jobDbSession.delete(job2);
- }
-
- /**
- * Test the method findFirstAcquirableJob.
- * test cases are:
- * - no jobImpl scheduled
- * - invalid jobs scheduled: locked or not due
- * - comparison between valid cases. The comparison is made on the
- * acquiring order according to the fields dueDate and lockExpirationTime.
- * the awaited result is:
- * 1- none field null, dueDate previous to case 2
- * 2- lockExpirationTime null
- * 3- dueDate null
- * 4- both fields null
- * The last two jobs can come in any order.
- */
- public void testFindFirstAcquirableJob() {
- long id1, id2, id3, id4;
- long timestamp = System.currentTimeMillis();
-
- JobDbSession jobDbSession = Environment.getCurrent().get(JobDbSession.class);
- // no jobImpl scheduled
- assertNull(jobDbSession.findFirstAcquirableJob());
-
- // unavailable jobs
- JobImpl<?> job1 = new TimerImpl();
- JobImpl<?> job2 = new TimerImpl();
- job1.setLockExpirationTime(new Date(Long.MAX_VALUE));
- job2.setDueDate(new Date(Long.MAX_VALUE));
- jobDbSession.save(job1);
- jobDbSession.save(job2);
-
- newTransaction();
-
- jobDbSession = Environment.getCurrent().get(JobDbSession.class);
- assertNull(jobDbSession.findFirstAcquirableJob());
-
- // valid jobs
- job1 = new TimerImpl();
- job2 = new TimerImpl();
- JobImpl<?> job3 = new TimerImpl();
- JobImpl<?> job4 = new TimerImpl();
- job3.setDueDate(new Date(timestamp));
- job4.setDueDate(new Date(timestamp - 200));
- job2.setLockExpirationTime(new Date(timestamp));
- job4.setLockExpirationTime(new Date(timestamp));
- jobDbSession.save(job1);
- jobDbSession.save(job2);
- jobDbSession.save(job3);
- jobDbSession.save(job4);
- id1 = job1.getDbid();
- id2 = job2.getDbid();
- id3 = job3.getDbid();
- id4 = job4.getDbid();
-
- newTransaction();
-
- List<Long> ids = new ArrayList<Long>();
- jobDbSession = Environment.getCurrent().get(JobDbSession.class);
- JobImpl<?> jobImpl = jobDbSession.findFirstAcquirableJob();
- while (jobImpl != null) {
- ids.add(jobImpl.getDbid());
- jobDbSession.delete(jobImpl);
- jobImpl = jobDbSession.findFirstAcquirableJob();
- }
- assertEquals(4, ids.size());
- assertEquals(id4, ids.get(0).longValue());
- assertEquals(id3, ids.get(1).longValue());
- assertTrue(id1 == ids.get(2).longValue() ||
- id2 == ids.get(2).longValue());
- assertTrue(id1 == ids.get(3).longValue() ||
- id2 == ids.get(3).longValue());
- }
-
- /**
- * Test the findExclusiveJobs method.
- * Considered jobImpl are:
- * - a jobImpl not registered for the example execution
- * - a locked jobImpl
- * - a non-exclusive jobImpl
- * - a non available jobImpl
- * - two valid jobs, exclusive, available and registered
- * for the example execution
- */
- public void testFindExclusiveJobs() {
- long id5, id6;
-
- JobDbSession jobDbSession = Environment.getCurrent().get(JobDbSession.class);
- ExecutionImpl execution = getExecution();
- assertEquals(0, jobDbSession.findExclusiveJobs(execution).size());
- // a jobImpl does not belong to the execution
- JobImpl<?> job1 = new TimerImpl();
- JobImpl<?> job2 = new TimerImpl();
- job2.setExecution(execution);
- JobImpl<?> job3 = new TimerImpl();
- job3.setExecution(execution);
- JobImpl<?> job4 = new TimerImpl();
- job4.setExecution(execution);
- JobImpl<?> job5 = new TimerImpl();
- job5.setExecution(execution);
- JobImpl<?> job6 = new TimerImpl();
- job6.setExecution(execution);
- // a jobImpl is not exclusive
- job1.setExclusive(true);
- job2.setExclusive(true);
- job3.setExclusive(false);
- job4.setExclusive(true);
- job5.setExclusive(true);
- job6.setExclusive(true);
- // a jobImpl is locked
- job2.setLockOwner("a jobExecutor");
- // a jobImpl's due date is not past
- job1.setDueDate(null);
- job2.setDueDate(null);
- job3.setDueDate(null);
- job4.setDueDate(new Date(Long.MAX_VALUE));
- job5.setDueDate(null);
- job6.setDueDate(new Date());
- jobDbSession.save(job1);
- jobDbSession.save(job2);
- jobDbSession.save(job3);
- jobDbSession.save(job4);
- jobDbSession.save(job5);
- jobDbSession.save(job6);
- id5 = job5.getDbid();
- id6 = job6.getDbid();
-
- newTransaction();
-
- jobDbSession = Environment.getCurrent().get(JobDbSession.class);
- ExecutionImpl processInstance = getExecution();
- List<JobImpl<?>> list = jobDbSession.findExclusiveJobs(processInstance);
- assertEquals(2, list.size());
- long result1 = list.get(0).getDbid();
- long result2 = list.get(1).getDbid();
- assertTrue( (result1==id5 && result2==id6) ||
- (result1==id6 && result2==id5));
-
- newTransaction();
- cleanTimers();
- }
-
- public void testFindFirstDueJob() {
- long id2, id3, id4;
- long timestamp = System.currentTimeMillis();
-
- JobDbSession jobDbSession = Environment.getCurrent().get(JobDbSession.class);
- assertNull(jobDbSession.findFirstDueJob());
- JobImpl<?> job1 = new TimerImpl();
- JobImpl<?> job2 = new TimerImpl();
- JobImpl<?> job3 = new TimerImpl();
- JobImpl<?> job4 = new TimerImpl();
- // a jobImpl is locked
- job1.setLockOwner("a jobExecutor");
- job2.setDueDate(null);
- job3.setDueDate(new Date(timestamp - 200));
- job4.setDueDate(new Date(timestamp));
- jobDbSession.save(job1);
- jobDbSession.save(job2);
- jobDbSession.save(job3);
- jobDbSession.save(job4);
- id2 = job2.getDbid();
- id3 = job3.getDbid();
- id4 = job4.getDbid();
-
- newTransaction();
- List<Long> ids = new ArrayList<Long>();
-
- jobDbSession = Environment.getCurrent().get(JobDbSession.class);
- JobImpl<?> jobImpl = jobDbSession.findFirstDueJob();
- while (jobImpl != null) {
- ids.add(jobImpl.getDbid());
- jobDbSession.delete(jobImpl);
- jobImpl = jobDbSession.findFirstDueJob();
- }
-
- assertEquals(3, ids.size());
- assertEquals(id2, ids.get(0).longValue());
- assertEquals(id3, ids.get(1).longValue());
- assertEquals(id4, ids.get(2).longValue());
- newTransaction();
- cleanTimers();
- }
-
- /*
- public void testFindAllTimers() {
- long id1, id2;
- environmentFactory.openEnvironment();
- try {
- JobDbSession jobDbSession = Environment.getCurrent().get(PvmDbSession.class);
- assertTrue(jobDbSession.findAllTimers().isEmpty());
- ExecutionImpl execution = getExecution();
- JobImpl<?> jobImpl = new TimerImpl();
- JobImpl<?> timer1 = new TimerImpl(execution);
- JobImpl<?> timer2 = new TimerImpl(execution);
- timer1.setDueDate(new Date());
- timer2.setDueDate(new Date());
- jobDbSession.save(jobImpl);
- jobDbSession.save(timer1);
- jobDbSession.save(timer2);
- id1 = timer1.getDbid();
- id2 = timer2.getDbid();
- } finally {
- Environment.getCurrent().close();
- }
- environmentFactory.openEnvironment();
- List<TimerImpl> timers;
- try {
- JobDbSession jobDbSession = Environment.getCurrent().get(JobDbSession.class);
- timers = jobDbSession.findAllTimers();
- } finally {
- Environment.getCurrent().close();
- }
- assertEquals(2, timers.size());
- if (timers.get(0).getDbid() == id1) {
- assertEquals(id2, timers.get(1).getDbid());
- } else {
- assertEquals(id2, timers.get(0).getDbid());
- assertEquals(id1, timers.get(1).getDbid());
- }
- cleanTimers();
- }
-
- public void testFindTimers() {
- long executionId2;
- long id1, id2;
- List<TimerImpl> timers;
- environmentFactory.openEnvironment();
- try {
- ExecutionImpl execution2 = new ExecutionImpl();
- execution2.setProcessInstance(execution2);
- Environment.getCurrent().get(DbSession.class).save(execution2);
- executionId2 = execution2.getDbid();
- ExecutionImpl execution = getExecution();
-
- JobDbSession jobDbSession = Environment.getCurrent().get(JobDbSession.class);
- JobImpl<?> jobImpl = new TestJob();
- JobImpl<?> timer1 = new TimerImpl(execution);
- JobImpl<?> timer2 = new TimerImpl(execution);
- JobImpl<?> timer3 = new TimerImpl(execution2);
- timer1.setDueDate(new Date());
- timer2.setDueDate(new Date());
- timer3.setDueDate(new Date());
- jobDbSession.save(jobImpl);
- jobDbSession.save(timer1);
- jobDbSession.save(timer2);
- jobDbSession.save(timer3);
- id1 = timer1.getDbid();
- id2 = timer2.getDbid();
- } finally {
- Environment.getCurrent().close();
- }
- environmentFactory.openEnvironment();
- try {
- timers = Environment.getCurrent().get(JobDbSession.class).findTimers(
- getExecution());
- } finally {
- Environment.getCurrent().close();
- }
- assertEquals(2, timers.size());
- if (timers.get(0).getDbid() == id1) {
- assertEquals(id2, timers.get(1).getDbid());
- } else {
- assertEquals(id2, timers.get(0).getDbid());
- assertEquals(id1, timers.get(1).getDbid());
- }
- cleanTimers();
- environmentFactory.openEnvironment();
- try {
- DbSession dbSession = Environment.getCurrent().get(DbSession.class);
- dbSession.delete(dbSession.get(ExecutionImpl.class, executionId2));
- } finally {
- Environment.getCurrent().close();
- }
- }
-
- public void testFindNextTimer() {
- long id1, id2, id3;
- environmentFactory.openEnvironment();
- try {
- JobDbSession jobDbSession = Environment.getCurrent().get(JobDbSession.class);
- ExecutionImpl execution = getExecution();
- JobImpl<?> jobImpl = new TimerImpl();
- JobImpl<?> timer1 = execution.createTimer("e", "s", "200 millis");
- JobImpl<?> timer2 = new TimerImpl(execution);
- JobImpl<?> timer3 = new TimerImpl(execution);
- timer1.setDueDate(null);
- timer2.setDueDate(new Date(Long.MAX_VALUE));
- timer3.setDueDate(new Date());
- jobDbSession.save(jobImpl);
- jobDbSession.save(timer1);
- jobDbSession.save(timer2);
- jobDbSession.save(timer3);
- id1 = timer1.getDbid();
- id2 = timer2.getDbid();
- id3 = timer3.getDbid();
- } finally {
- Environment.getCurrent().close();
- }
- List<Long> ids = new ArrayList<Long>();
- environmentFactory.openEnvironment();
- try {
- JobDbSession jobDbSession = Environment.getCurrent().get(JobDbSession.class);
- TimerImpl timer = jobDbSession.findNextTimer();
- while (timer != null) {
- ids.add(timer.getDbid());
- jobDbSession.delete(timer);
- timer = jobDbSession.findNextTimer();
- }
- } finally {
- Environment.getCurrent().close();
- }
- assertEquals(3, ids.size());
- assertEquals(id1, ids.get(0).longValue());
- assertEquals(id3, ids.get(1).longValue());
- assertEquals(id2, ids.get(2).longValue());
- cleanTimers();
- }
-*/
-}
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/GroovyExpressionTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/GroovyExpressionTest.java 2008-10-03 06:50:46 UTC (rev 2470)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/GroovyExpressionTest.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -37,6 +37,10 @@
public class GroovyExpressionTest extends JbpmTestCase {
public void testGroovyExpression() {
+ System.out.println("FIXME: JBPM-1768 Fix groovy support");
+ }
+
+ public void dontTestGroovyExpression() {
EnvironmentFactory environmentFactory = PvmEnvironmentFactory.parseXmlString(
"<contexts>" +
" <environment-factory>" +
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorIsolationDbTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorIsolationDbTest.java 2008-10-03 06:50:46 UTC (rev 2470)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorIsolationDbTest.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -47,10 +47,17 @@
}
}
+ public void testInsertMessage() {
+ System.out.println("FIXME: JBPM-1769 fix db isolation test");
+ }
+
+
/*
* Basic test that only shows a simple situation in which we need to have a read commited isolation level.
*/
- public void testInsertMessage() throws InterruptedException {
+
+ // FIX rename test method back to testInsertMessage
+ public void dontTestInsertMessage() throws InterruptedException {
JobExecutorTest.processedMessageIds = new ArrayList<Integer>();
JobExecutor jobExecutor = getEnvironmentFactory().get(JobExecutor.class);
jobExecutor.setIdleInterval(jobExecutorTimeoutMillis);
@@ -75,8 +82,5 @@
} finally {
jobExecutor.stop(true);
}
-
-
}
-
}
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/EnlistTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/EnlistTest.java 2008-10-03 06:50:46 UTC (rev 2470)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/EnlistTest.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -45,21 +45,21 @@
"</contexts>"
);
- Object o = environment.get("o");
- assertNotNull(o);
-
- StandardTransaction t = (StandardTransaction) environment.get("tx");
- t.begin();
-
- assertNotNull(t);
- assertTrue(t.getResources().contains(o));
- assertEquals(MyResource.events.toString(), 0, MyResource.events.size());
-
- t.complete();
-
- assertEquals(MyResource.events.toString(), 2, MyResource.events.size());
- assertEquals("prepare", MyResource.events.get(0));
- assertEquals("commit", MyResource.events.get(1));
+ try {
+ Object o = environment.get("o");
+ assertNotNull(o);
+ StandardTransaction t = (StandardTransaction) environment.get("tx");
+ t.begin();
+ assertNotNull(t);
+ assertTrue(t.getResources().contains(o));
+ assertEquals(MyResource.events.toString(), 0, MyResource.events.size());
+ t.complete();
+ assertEquals(MyResource.events.toString(), 2, MyResource.events.size());
+ assertEquals("prepare", MyResource.events.get(0));
+ assertEquals("commit", MyResource.events.get(1));
+ } finally {
+ environment.close();
+ }
}
public void testEnlistRollback() {
@@ -75,22 +75,21 @@
"</contexts>"
);
- Object o = environment.get("o");
- assertNotNull(o);
-
- StandardTransaction t = (StandardTransaction) environment.get("tx");
- t.begin();
-
- assertNotNull(t);
- assertTrue(t.getResources().contains(o));
- assertEquals(MyResource.events.toString(), 0, MyResource.events.size());
-
- t.setRollbackOnly();
-
- t.complete();
-
- assertEquals(MyResource.events.toString(), 1, MyResource.events.size());
- assertEquals("rollback", MyResource.events.get(0));
+ try {
+ Object o = environment.get("o");
+ assertNotNull(o);
+ StandardTransaction t = (StandardTransaction) environment.get("tx");
+ t.begin();
+ assertNotNull(t);
+ assertTrue(t.getResources().contains(o));
+ assertEquals(MyResource.events.toString(), 0, MyResource.events.size());
+ t.setRollbackOnly();
+ t.complete();
+ assertEquals(MyResource.events.toString(), 1, MyResource.events.size());
+ assertEquals("rollback", MyResource.events.get(0));
+ } finally {
+ environment.close();
+ }
}
public void testEnlistInOtherContext() {
@@ -106,30 +105,24 @@
"</contexts>"
);
- WireContext context = createWireContext(
- "<objects>" +
- " <object name='o' class='"+ MyResource.class.getName()+"'>" +
- " <enlist transaction='tx'/>" +
- " </object>"+
- "</objects>"
- );
- environment.addContext(context);
- Object o = environment.get("o");
-
- assertNotNull(o);
-
- StandardTransaction t = (StandardTransaction) environment.get("tx");
- t.begin();
-
- assertNotNull(t);
- assertTrue(t.getResources().contains(o));
- assertEquals(MyResource.events.toString(), 0, MyResource.events.size());
-
- t.complete();
-
- assertEquals(MyResource.events.toString(), 2, MyResource.events.size());
- assertEquals("prepare", MyResource.events.get(0));
- assertEquals("commit", MyResource.events.get(1));
+ try {
+ WireContext context = createWireContext("<objects>" + " <object name='o' class='" + MyResource.class.getName() + "'>" + " <enlist transaction='tx'/>"
+ + " </object>" + "</objects>");
+ environment.addContext(context);
+ Object o = environment.get("o");
+ assertNotNull(o);
+ StandardTransaction t = (StandardTransaction) environment.get("tx");
+ t.begin();
+ assertNotNull(t);
+ assertTrue(t.getResources().contains(o));
+ assertEquals(MyResource.events.toString(), 0, MyResource.events.size());
+ t.complete();
+ assertEquals(MyResource.events.toString(), 2, MyResource.events.size());
+ assertEquals("prepare", MyResource.events.get(0));
+ assertEquals("commit", MyResource.events.get(1));
+ } finally {
+ environment.close();
+ }
}
public void testEnlistInOtherContextWithRollback() {
@@ -145,31 +138,24 @@
"</contexts>"
);
- WireContext context = createWireContext(
- "<objects>" +
- " <object name='o' class='"+ MyResource.class.getName()+"'>" +
- " <enlist transaction='tx'/>" +
- " </object>"+
- "</objects>"
- );
- environment.addContext(context);
- Object o = environment.get("o");
-
- assertNotNull(o);
-
- StandardTransaction t = (StandardTransaction) environment.get("tx");
- t.begin();
-
- assertNotNull(t);
- assertTrue(t.getResources().contains(o));
- assertEquals(MyResource.events.toString(), 0, MyResource.events.size());
-
- t.setRollbackOnly();
-
- t.complete();
-
- assertEquals(MyResource.events.toString(), 1, MyResource.events.size());
- assertEquals("rollback", MyResource.events.get(0));
+ try {
+ WireContext context = createWireContext("<objects>" + " <object name='o' class='" + MyResource.class.getName() + "'>" + " <enlist transaction='tx'/>"
+ + " </object>" + "</objects>");
+ environment.addContext(context);
+ Object o = environment.get("o");
+ assertNotNull(o);
+ StandardTransaction t = (StandardTransaction) environment.get("tx");
+ t.begin();
+ assertNotNull(t);
+ assertTrue(t.getResources().contains(o));
+ assertEquals(MyResource.events.toString(), 0, MyResource.events.size());
+ t.setRollbackOnly();
+ t.complete();
+ assertEquals(MyResource.events.toString(), 1, MyResource.events.size());
+ assertEquals("rollback", MyResource.events.get(0));
+ } finally {
+ environment.close();
+ }
}
public void testEnlistNotAResource() {
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/dombuildertest.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/dombuildertest.xml 2008-10-03 06:50:46 UTC (rev 2470)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/dombuildertest.xml 2008-10-03 10:48:31 UTC (rev 2471)
@@ -1,10 +0,0 @@
-<!-- 1 --><car-park>
-<!-- 2 --> <car id="a" />
-<!-- 3 --> <car id="b" />
-<!-- 4 -->
-<!-- 5 -->
-<!-- 6 --> <car id="c" />
-<!-- 7 --> <car id="d" />
-<!-- 8 --> <car id="e" />
-<!-- 9 --> <car id="f" />
-<!--10 --></car-park>
\ No newline at end of file
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/schematest.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/schematest.xml 2008-10-03 06:50:46 UTC (rev 2470)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/schematest.xml 2008-10-03 10:48:31 UTC (rev 2471)
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<object xmlns="http://jbpm.org/pvm/1.0/wire">
-
- <constructor>
- <arg/>
- <arg/>
- <arg/>
- </constructor>
-
-</object>
\ No newline at end of file
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ex02/BasicProcessPersistenceTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ex02/BasicProcessPersistenceTest.java 2008-10-03 06:50:46 UTC (rev 2470)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ex02/BasicProcessPersistenceTest.java 2008-10-03 10:48:31 UTC (rev 2471)
@@ -60,15 +60,15 @@
ExecutionService executionService = ExamplesConfiguration.getExecutionService();
- Execution execution = executionService.startExecutionInLatest("basic-1/one");
+ Execution execution = executionService.startExecutionInLatest("basic", "one");
assertEquals("a", execution.getNodeName());
- execution = executionService.signalExecution("basic-1/one");
+ execution = executionService.signalExecution("basic:1/one");
assertEquals("b", execution.getNodeName());
- execution = executionService.signalExecution("basic-1/one");
+ execution = executionService.signalExecution("basic:1/one");
assertEquals("e", execution.getNodeName());
}
Modified: jbpm4/trunk/modules/pvm/src/test/resources/environment.cfg.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/environment.cfg.xml 2008-10-03 06:50:46 UTC (rev 2470)
+++ jbpm4/trunk/modules/pvm/src/test/resources/environment.cfg.xml 2008-10-03 10:48:31 UTC (rev 2471)
@@ -31,11 +31,20 @@
<hibernate-session-factory />
+ <job-executor auto-start="false" />
+ <job-test-helper />
+
<id-generator />
-
<variable-types resource="org/jbpm/pvm/pvm.types.xml" />
- <job-executor auto-start="false" />
+ <business-calendar>
+ <monday hours="9:00-12:00 and 12:30-17:00"/>
+ <tuesday hours="9:00-12:00 and 12:30-17:00"/>
+ <wednesday hours="9:00-12:00 and 12:30-17:00"/>
+ <thursday hours="9:00-12:00 and 12:30-17:00"/>
+ <friday hours="9:00-12:00 and 12:30-17:00"/>
+ <holiday period="01/07/2008 - 31/08/2008"/>
+ </business-calendar>
</environment-factory>
@@ -45,6 +54,7 @@
<pvm-db-session />
<job-db-session />
<message-session />
+ <timer-session />
</environment>
</contexts>
Deleted: jbpm4/trunk/modules/pvm/src/test/resources/log4j.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/log4j.xml 2008-10-03 06:50:46 UTC (rev 2470)
+++ jbpm4/trunk/modules/pvm/src/test/resources/log4j.xml 2008-10-03 10:48:31 UTC (rev 2471)
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
-
- <!-- ================================= -->
- <!-- Preserve messages in a local file -->
- <!-- ================================= -->
-
- <appender name="FILE" class="org.apache.log4j.FileAppender">
- <param name="File" value="${log4j.output.dir}/test.log"/>
- <param name="Append" value="false"/>
- <layout class="org.apache.log4j.PatternLayout">
- <!-- The default pattern: Date Priority [Category] Message\n -->
- <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
- </layout>
- </appender>
-
- <!-- ============================== -->
- <!-- Append messages to the console -->
- <!-- ============================== -->
-
- <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
- <param name="Target" value="System.out" />
- <param name="Threshold" value="INFO" />
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{1}] %m%n" />
- </layout>
- </appender>
-
- <!-- ================ -->
- <!-- Limit categories -->
- <!-- ================ -->
-
- <!-- Apache HTTP Client -->
- <category name="org.apache.commons.httpclient">
- <priority value="INFO" />
- </category>
- <category name="httpclient.wire">
- <priority value="INFO" />
- </category>
-
- <!-- ======================= -->
- <!-- Setup the Root category -->
- <!-- ======================= -->
-
- <root>
- <!--appender-ref ref="CONSOLE"/-->
- <appender-ref ref="FILE"/>
- </root>
-
-</log4j:configuration>
\ No newline at end of file
Added: jbpm4/trunk/modules/pvm/src/test/resources/logging.properties
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/logging.properties (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/resources/logging.properties 2008-10-03 10:48:31 UTC (rev 2471)
@@ -0,0 +1,28 @@
+handlers= java.util.logging.ConsoleHandler
+# to add the error triggered file handler
+# handlers= java.util.logging.ConsoleHandler org.jbpm.util.ErrorTriggeredFileHandler
+
+redirect.commons.logging = enabled
+
+java.util.logging.ConsoleHandler.level = FINEST
+java.util.logging.ConsoleHandler.formatter = org.jbpm.pvm.internal.log.LogFormatter
+
+# org.jbpm.util.ErrorTriggeredFileHandler.size = 500
+# org.jbpm.util.ErrorTriggeredFileHandler.push = OFF
+# org.jbpm.util.ErrorTriggeredFileHandler.pattern = %h/jbpm%u.log
+
+# For example, set the com.xyz.foo logger to only log SEVERE messages:
+# com.xyz.foo.level = SEVERE
+
+org.jbpm.level=FINEST
+org.jbpm.pvm.internal.tx.level=FINE
+org.jbpm.pvm.internal.wire.level=FINE
+org.jbpm.pvm.internal.util.level=FINE
+
+org.hibernate.cfg.HbmBinder.level=SEVERE
+org.hibernate.cfg.SettingsFactory.level=SEVERE
+# org.hibernate.level=FINE
+# org.hibernate.SQL.level=FINEST
+# org.hibernate.type.level=FINEST
+# org.hibernate.tool.hbm2ddl.SchemaExport.level=FINEST
+# org.hibernate.transaction.level=FINEST
Copied: jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/internal/xml/dombuildertest.xml (from rev 2470, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/dombuildertest.xml)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/internal/xml/dombuildertest.xml (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/internal/xml/dombuildertest.xml 2008-10-03 10:48:31 UTC (rev 2471)
@@ -0,0 +1,10 @@
+<!-- 1 --><car-park>
+<!-- 2 --> <car id="a" />
+<!-- 3 --> <car id="b" />
+<!-- 4 -->
+<!-- 5 -->
+<!-- 6 --> <car id="c" />
+<!-- 7 --> <car id="d" />
+<!-- 8 --> <car id="e" />
+<!-- 9 --> <car id="f" />
+<!--10 --></car-park>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/internal/xml/dombuildertest.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/internal/xml/schematest.xml (from rev 2470, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/schematest.xml)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/internal/xml/schematest.xml (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/internal/xml/schematest.xml 2008-10-03 10:48:31 UTC (rev 2471)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<object xmlns="http://jbpm.org/pvm/1.0/wire">
+
+ <constructor>
+ <arg/>
+ <arg/>
+ <arg/>
+ </constructor>
+
+</object>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/internal/xml/schematest.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
17 years, 7 months
JBoss JBPM SVN: r2470 - in jbpm4/trunk: modules/api and 3 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-10-03 02:50:46 -0400 (Fri, 03 Oct 2008)
New Revision: 2470
Modified:
jbpm4/trunk/.project
jbpm4/trunk/modules/api/.project
jbpm4/trunk/modules/cts/.project
jbpm4/trunk/modules/jpdl/.project
jbpm4/trunk/modules/pvm/.project
Log:
renamed eclipse projects
Modified: jbpm4/trunk/.project
===================================================================
--- jbpm4/trunk/.project 2008-10-02 22:17:40 UTC (rev 2469)
+++ jbpm4/trunk/.project 2008-10-03 06:50:46 UTC (rev 2470)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>jbpm</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.maven.ide.eclipse.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>svn-jbpm4</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Modified: jbpm4/trunk/modules/api/.project
===================================================================
--- jbpm4/trunk/modules/api/.project 2008-10-02 22:17:40 UTC (rev 2469)
+++ jbpm4/trunk/modules/api/.project 2008-10-03 06:50:46 UTC (rev 2470)
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>jbpm-api</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.maven.ide.eclipse.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>api</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Modified: jbpm4/trunk/modules/cts/.project
===================================================================
--- jbpm4/trunk/modules/cts/.project 2008-10-02 22:17:40 UTC (rev 2469)
+++ jbpm4/trunk/modules/cts/.project 2008-10-03 06:50:46 UTC (rev 2470)
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>jbpm-cts</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.maven.ide.eclipse.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>cts</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Modified: jbpm4/trunk/modules/jpdl/.project
===================================================================
--- jbpm4/trunk/modules/jpdl/.project 2008-10-02 22:17:40 UTC (rev 2469)
+++ jbpm4/trunk/modules/jpdl/.project 2008-10-03 06:50:46 UTC (rev 2470)
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>jpdl-core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.maven.ide.eclipse.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jpdl</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Modified: jbpm4/trunk/modules/pvm/.project
===================================================================
--- jbpm4/trunk/modules/pvm/.project 2008-10-02 22:17:40 UTC (rev 2469)
+++ jbpm4/trunk/modules/pvm/.project 2008-10-03 06:50:46 UTC (rev 2470)
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>pvm-core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.maven.ide.eclipse.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>pvm</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
17 years, 7 months