Author: tom.baeyens(a)jboss.com
Date: 2008-12-29 06:56:26 -0500 (Mon, 29 Dec 2008)
New Revision: 3575
Removed:
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example02/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example03/AutomaticActivity.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example03/EmbeddedExecutionModeTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example03/Loan.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example03/WaitState.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example04/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example05/ExternalActivityExampleTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example05/WaitState.java
Log:
pvm test suite cleanup
Deleted:
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example03/AutomaticActivity.java
===================================================================
---
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example03/AutomaticActivity.java 2008-12-29
11:56:14 UTC (rev 3574)
+++
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example03/AutomaticActivity.java 2008-12-29
11:56:26 UTC (rev 3575)
@@ -1,38 +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.example03;
-
-import org.jbpm.activity.Activity;
-import org.jbpm.activity.ActivityExecution;
-
-/** a node behaviour implementation that records its execution and then
- * just proceeds.
- *
- * @author Tom Baeyens
- */
-public class AutomaticActivity implements Activity {
-
- private static final long serialVersionUID = 1L;
-
- public void execute(ActivityExecution execution) throws Exception {
- }
-}
\ No newline at end of file
Deleted:
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example03/EmbeddedExecutionModeTest.java
===================================================================
---
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example03/EmbeddedExecutionModeTest.java 2008-12-29
11:56:14 UTC (rev 3574)
+++
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example03/EmbeddedExecutionModeTest.java 2008-12-29
11:56:26 UTC (rev 3575)
@@ -1,106 +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.example03;
-
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.hibernate.Transaction;
-import org.hibernate.cfg.Configuration;
-import org.jbpm.test.JbpmTestCase;
-
-/**
- * @author Tom Baeyens
- */
-public class EmbeddedExecutionModeTest extends JbpmTestCase {
-
- SessionFactory sessionFactory;
- Session session;
- Transaction transaction;
-
- public void testLoanApprove() {
- Configuration configuration = new Configuration();
- configuration.configure("org/jbpm/pvm/example03/hibernate.cfg.xml");
- sessionFactory = configuration.buildSessionFactory();
-
- startTransaction();
-
- Loan loan = new Loan("john doe", 234.0);
- session.save(loan);
- assertEquals("evaluate", loan.getState());
-
- newTransaction();
-
- loan = (Loan) session.get(Loan.class, loan.getDbid());
- assertEquals("evaluate", loan.getState());
- loan.approve();
- assertEquals("archive", loan.getState());
-
- newTransaction();
-
- loan = (Loan) session.get(Loan.class, loan.getDbid());
- assertEquals("archive", loan.getState());
- loan.archiveComplete();
- assertEquals("end", loan.getState());
-
- commitTransaction();
- }
-
- public void testLoanReject() {
- Configuration configuration = new Configuration();
- configuration.configure("org/jbpm/pvm/example03/hibernate.cfg.xml");
- sessionFactory = configuration.buildSessionFactory();
-
- startTransaction();
-
- Loan loan = new Loan("john doe", 234.0);
- session.save(loan);
- assertEquals("evaluate", loan.getState());
-
- newTransaction();
-
- loan = (Loan) session.get(Loan.class, loan.getDbid());
- assertEquals("evaluate", loan.getState());
- loan.reject();
- assertEquals("end", loan.getState());
-
- newTransaction();
-
- loan = (Loan) session.get(Loan.class, loan.getDbid());
- assertEquals("end", loan.getState());
- }
-
-
- void newTransaction() {
- commitTransaction();
- startTransaction();
- }
-
- void startTransaction() {
- session = sessionFactory.openSession();
- transaction = session.beginTransaction();
- }
-
- void commitTransaction() {
- transaction.commit();
- session.close();
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example03/Loan.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example03/Loan.java 2008-12-29
11:56:14 UTC (rev 3574)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example03/Loan.java 2008-12-29
11:56:26 UTC (rev 3575)
@@ -1,101 +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.example03;
-
-
-import org.jbpm.client.ClientExecution;
-import org.jbpm.client.ClientProcessDefinition;
-import org.jbpm.pvm.model.ProcessFactory;
-
-/**
- * @author Tom Baeyens
- */
-public class Loan {
-
- /** the loan process definition as a static resource */
- private static final ClientProcessDefinition processDefinition = createLoanProcess();
-
- private static ClientProcessDefinition createLoanProcess() {
- ClientProcessDefinition processDefinition = ProcessFactory.build("loan")
- .node("submit loan
request").initial().behaviour(AutomaticActivity.class)
- .transition().to("evaluate")
- .node("evaluate").behaviour(WaitState.class)
- .transition("approve").to("wire money")
- .transition("reject").to("end")
- .node("wire money").behaviour(AutomaticActivity.class)
- .transition().to("archive")
- .node("archive").behaviour(WaitState.class)
- .transition().to("end")
- .node("end").behaviour(WaitState.class)
- .done();
-
- return processDefinition;
- }
-
- /** exposes the process definition to the execution hibernate type */
- private static ClientProcessDefinition getProcessDefinition() {
- return processDefinition;
- }
-
- long dbid;
- String customer;
- double amount;
- ClientExecution execution;
-
- /** constructor for persistence */
- protected Loan() {
- }
-
- public Loan(String customer, double amount) {
- this.customer = customer;
- this.amount = amount;
- this.execution = processDefinition.startProcessInstance();
- }
-
- public void approve() {
- execution.signal("approve");
- }
-
- public void reject() {
- execution.signal("reject");
- }
-
- public void archiveComplete() {
- execution.signal();
- }
-
- public String getState() {
- return execution.getNodeName();
- }
-
- // getters //////////////////////////////////////////////////////////////////
-
- public long getDbid() {
- return dbid;
- }
- public String getCustomer() {
- return customer;
- }
- public double getAmount() {
- return amount;
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example03/WaitState.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example03/WaitState.java 2008-12-29
11:56:14 UTC (rev 3574)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example03/WaitState.java 2008-12-29
11:56:26 UTC (rev 3575)
@@ -1,46 +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.example03;
-
-import java.util.Map;
-
-import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivity;
-
-/**
- * @author Tom Baeyens
- */
-public class WaitState implements ExternalActivity {
-
- private static final long serialVersionUID = 1L;
-
- public WaitState() {
- }
-
- public void execute(ActivityExecution execution) throws Exception {
- execution.waitForSignal();
- }
-
- public void signal(ActivityExecution execution, String signalName, Map<String,
Object> parameters) throws Exception {
- execution.take(signalName);
- }
-}
\ No newline at end of file
Deleted:
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example05/ExternalActivityExampleTest.java
===================================================================
---
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example05/ExternalActivityExampleTest.java 2008-12-29
11:56:14 UTC (rev 3574)
+++
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example05/ExternalActivityExampleTest.java 2008-12-29
11:56:26 UTC (rev 3575)
@@ -1,48 +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.example05;
-
-import org.jbpm.client.ClientExecution;
-import org.jbpm.client.ClientProcessDefinition;
-import org.jbpm.pvm.model.ProcessFactory;
-import org.jbpm.test.JbpmTestCase;
-
-
-public class ExternalActivityExampleTest extends JbpmTestCase {
-
- public void testExternalActivityExample() {
- ClientProcessDefinition processDefinition = ProcessFactory.build()
- .node("a").initial().behaviour(new WaitState())
- .transition().to("b")
- .node("b").behaviour(new WaitState())
- .done();
-
- ClientExecution execution = processDefinition.startProcessInstance();
-
- assertEquals("a", execution.getNodeName());
-
- execution.signal();
-
- assertEquals("b", execution.getNodeName());
- }
-
-}
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example05/WaitState.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example05/WaitState.java 2008-12-29
11:56:14 UTC (rev 3574)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example05/WaitState.java 2008-12-29
11:56:26 UTC (rev 3575)
@@ -1,42 +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.example05;
-
-import java.util.Map;
-
-import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivity;
-
-public class WaitState implements ExternalActivity {
-
- private static final long serialVersionUID = 1L;
-
- public void execute(ActivityExecution execution) {
- execution.waitForSignal();
- }
-
- public void signal(ActivityExecution execution,
- String signalName,
- Map<String, Object> parameters) {
- execution.take(signalName);
- }
-}