[jbpm-commits] JBoss JBPM SVN: r2426 - in jbpm3/trunk/modules/examples: src/test/java/org/jbpm/examples/door and 1 other directory.
do-not-reply at jboss.org
do-not-reply at jboss.org
Mon Sep 29 05:37:21 EDT 2008
Author: thomas.diesler at jboss.com
Date: 2008-09-29 05:37:21 -0400 (Mon, 29 Sep 2008)
New Revision: 2426
Modified:
jbpm3/trunk/modules/examples/pom.xml
jbpm3/trunk/modules/examples/src/test/java/org/jbpm/examples/door/DoorProcessTest.java
jbpm3/trunk/modules/examples/src/test/java/org/jbpm/examples/door/DoorTest.java
Log:
[JBPM-1745] Fix examples/door
Modified: jbpm3/trunk/modules/examples/pom.xml
===================================================================
--- jbpm3/trunk/modules/examples/pom.xml 2008-09-29 09:32:46 UTC (rev 2425)
+++ jbpm3/trunk/modules/examples/pom.xml 2008-09-29 09:37:21 UTC (rev 2426)
@@ -97,7 +97,6 @@
<configuration>
<!-- [JBPM-1290] Integrate example tests in automated testrun -->
<excludes>
- <exclude>org/jbpm/examples/door/**</exclude>
<exclude>org/jbpm/examples/mail/**</exclude>
<exclude>org/jbpm/examples/raise/**</exclude>
<exclude>org/jbpm/examples/rulesAction/**</exclude>
Modified: jbpm3/trunk/modules/examples/src/test/java/org/jbpm/examples/door/DoorProcessTest.java
===================================================================
--- jbpm3/trunk/modules/examples/src/test/java/org/jbpm/examples/door/DoorProcessTest.java 2008-09-29 09:32:46 UTC (rev 2425)
+++ jbpm3/trunk/modules/examples/src/test/java/org/jbpm/examples/door/DoorProcessTest.java 2008-09-29 09:37:21 UTC (rev 2426)
@@ -29,7 +29,7 @@
protected void setUp() throws Exception
{
super.setUp();
- doorProcess = ProcessDefinition.parseXmlInputStream(DoorProcessTest.class.getResourceAsStream("processdefinition.xml"));
+ doorProcess = ProcessDefinition.parseXmlInputStream(DoorProcessTest.class.getResourceAsStream("/door/processdefinition.xml"));
locked = doorProcess.getNode("Locked");
closed = doorProcess.getNode("Closed");
open = doorProcess.getNode("Open");
@@ -37,7 +37,7 @@
}
};
}
-
+
/**
* This test shows how you can execute one scenario in a test method. Inside the test method, the external triggers (=signals) are provided to a process instance.
* Then you assert wether the process instance ends up in the expected state.
Modified: jbpm3/trunk/modules/examples/src/test/java/org/jbpm/examples/door/DoorTest.java
===================================================================
--- jbpm3/trunk/modules/examples/src/test/java/org/jbpm/examples/door/DoorTest.java 2008-09-29 09:32:46 UTC (rev 2425)
+++ jbpm3/trunk/modules/examples/src/test/java/org/jbpm/examples/door/DoorTest.java 2008-09-29 09:37:21 UTC (rev 2426)
@@ -1,146 +1,192 @@
package org.jbpm.examples.door;
-
import junit.framework.TestCase;
/**
- * This example shows the tradeoff between implementing the behaviour of a door in plain Java and using a jPDL process.
- * This is intended for developers to learn about the aspects that are handled better in a process versus plain programming.
+ * This example shows the tradeoff between implementing the behaviour of a door in plain Java and using a jPDL process. This is intended for developers to learn about
+ * the aspects that are handled better in a process versus plain programming.
*/
-public class DoorTest extends TestCase {
+public class DoorTest extends TestCase
+{
- public void testClosedOpen() {
+ public void testClosedOpen()
+ {
Door door = new Door();
door.open();
assertSame(Door.OPEN, door.state);
}
- public void testClosedLock() {
+ public void testClosedLock()
+ {
Door door = new Door();
door.lock();
assertSame(Door.LOCKED, door.state);
}
- public void testClosedClose() {
+ public void testClosedClose()
+ {
Door door = new Door();
- try {
+ try
+ {
door.close();
fail("expected exception");
- } catch (IllegalStateException e) {
}
+ catch (IllegalStateException e)
+ {
+ }
}
- public void testClosedUnlock() {
+ public void testClosedUnlock()
+ {
Door door = new Door();
- try {
+ try
+ {
door.unlock();
fail("expected exception");
- } catch (IllegalStateException e) {
}
+ catch (IllegalStateException e)
+ {
+ }
}
- public void testOpenedOpen() {
+ public void testOpenedOpen()
+ {
Door door = new Door();
door.state = Door.OPEN;
- try {
+ try
+ {
door.open();
fail("expected exception");
- } catch (IllegalStateException e) {
}
+ catch (IllegalStateException e)
+ {
+ }
}
- public void testOpenedLock() {
+ public void testOpenedLock()
+ {
Door door = new Door();
door.state = Door.OPEN;
door.lock();
assertSame(Door.OPEN_LOCKED, door.state);
}
- public void testOpenedClose() {
+ public void testOpenedClose()
+ {
Door door = new Door();
door.state = Door.OPEN;
door.close();
assertSame(Door.CLOSED, door.state);
}
- public void testOpenedUnlock() {
+ public void testOpenedUnlock()
+ {
Door door = new Door();
door.state = Door.OPEN;
- try {
+ try
+ {
door.unlock();
fail("expected exception");
- } catch (IllegalStateException e) {
}
+ catch (IllegalStateException e)
+ {
+ }
}
- public void testLockedOpen() {
+ public void testLockedOpen()
+ {
Door door = new Door();
door.state = Door.LOCKED;
- try {
+ try
+ {
door.open();
fail("expected exception");
- } catch (IllegalStateException e) {
}
+ catch (IllegalStateException e)
+ {
+ }
}
- public void testLockedLock() {
+ public void testLockedLock()
+ {
Door door = new Door();
door.state = Door.LOCKED;
- try {
+ try
+ {
door.lock();
fail("expected exception");
- } catch (IllegalStateException e) {
}
+ catch (IllegalStateException e)
+ {
+ }
}
- public void testLockedClose() {
+ public void testLockedClose()
+ {
Door door = new Door();
door.state = Door.LOCKED;
- try {
+ try
+ {
door.close();
fail("expected exception");
- } catch (IllegalStateException e) {
}
+ catch (IllegalStateException e)
+ {
+ }
}
- public void testLockedUnlock() {
+ public void testLockedUnlock()
+ {
Door door = new Door();
door.state = Door.LOCKED;
door.unlock();
assertSame(Door.CLOSED, door.state);
}
- public void testOpenLockedOpen() {
+ public void testOpenLockedOpen()
+ {
Door door = new Door();
door.state = Door.OPEN_LOCKED;
- try {
+ try
+ {
door.open();
fail("expected exception");
- } catch (IllegalStateException e) {
}
+ catch (IllegalStateException e)
+ {
+ }
}
- public void testOpenLockedLock() {
+ public void testOpenLockedLock()
+ {
Door door = new Door();
door.state = Door.OPEN_LOCKED;
- try {
+ try
+ {
door.lock();
fail("expected exception");
- } catch (IllegalStateException e) {
}
+ catch (IllegalStateException e)
+ {
+ }
}
- public void testOpenLockedClose() {
+ public void testOpenLockedClose()
+ {
Door door = new Door();
door.state = Door.OPEN_LOCKED;
- try {
+ try
+ {
door.close();
fail("expected exception");
- } catch (IllegalStateException e) {
}
+ catch (IllegalStateException e)
+ {
+ }
}
- public void testOpenLockedUnlock() {
+ public void testOpenLockedUnlock()
+ {
Door door = new Door();
door.state = Door.OPEN_LOCKED;
door.unlock();
More information about the jbpm-commits
mailing list