[jbpm-commits] JBoss JBPM SVN: r2494 - in jbpm3/branches/jpdl-3.2.2-SOA-4.2: jpdl/examples and 10 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Mon Oct 6 19:29:44 EDT 2008
Author: alex.guizar at jboss.com
Date: 2008-10-06 19:29:44 -0400 (Mon, 06 Oct 2008)
New Revision: 2494
Added:
jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/main/java/org/jbpm/mail/MyAddressResolver.java
jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/main/jpdl/
jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/main/jpdl/Mail/
jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/main/jpdl/Mail/processdefinition.xml
jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/test/
jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/test/java/
jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/test/java/org/
jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/test/java/org/jbpm/
jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/test/java/org/jbpm/mail/
jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/test/java/org/jbpm/mail/MailTest.java
jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/test/java/org/jbpm/mail/test.mail.properties
Removed:
jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/main/java/org/jbpm/mail/MailTest.java
Modified:
jbpm3/branches/jpdl-3.2.2-SOA-4.2/build/build.properties
jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/
jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/example.base.build.xml
Log:
[SOA-483] Restructured the mail example so that the sample process is in the src/main directory and the test code is in src/test. This produces the expected test results.
Modified: jbpm3/branches/jpdl-3.2.2-SOA-4.2/build/build.properties
===================================================================
--- jbpm3/branches/jpdl-3.2.2-SOA-4.2/build/build.properties 2008-10-06 23:25:04 UTC (rev 2493)
+++ jbpm3/branches/jpdl-3.2.2-SOA-4.2/build/build.properties 2008-10-06 23:29:44 UTC (rev 2494)
@@ -20,7 +20,7 @@
jboss.version=4.3.0.GA
jboss.eap.version=4.3
jboss.eap.name=jboss-eap-${jboss.eap.version}
-jboss.eap.remote.file.name=${jboss.eap.name}.0.GA_CP01.zip
+jboss.eap.remote.file.name=${jboss.eap.name}.0.GA_CP02.zip
jboss.home=${software.installation.dir}/${jboss.eap.name}/jbossas
# the eclipse home property has to end with 'eclipse' since the folders in the eclipse
@@ -36,7 +36,7 @@
# REPOSITORY LOCATION PROPERTIES
local.repository=${user.home}/jbpm/repository
remote.repository=http://repository.jboss.org
-remote.jboss.repository=http://porkchop.redhat.com/devel/candidates/JBEAP4.3.0/20080429/zip
+remote.jboss.repository=http://porkchop.redhat.com/devel/candidates/JBEAP4.3.0/20080806/zip
docbook.support.dir=${local.repository}
# BROWSER PROPERTIES
Property changes on: jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples
___________________________________________________________________
Name: svn:ignore
+ target
Modified: jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/example.base.build.xml
===================================================================
--- jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/example.base.build.xml 2008-10-06 23:25:04 UTC (rev 2493)
+++ jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/example.base.build.xml 2008-10-06 23:29:44 UTC (rev 2494)
@@ -16,6 +16,7 @@
<include name="${lib.commons.logging.path}"/>
<include name="${lib.commons.collections.path}" />
<include name="${lib.dom4j.path}"/>
+ <include name="${lib.dumbster.path}"/>
<include name="${lib.hibernate.path}"/>
<include name="${lib.hsqldb.path}"/>
<include name="${lib.javamail.path}"/>
Deleted: jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/main/java/org/jbpm/mail/MailTest.java
===================================================================
--- jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/main/java/org/jbpm/mail/MailTest.java 2008-10-06 23:25:04 UTC (rev 2493)
+++ jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/main/java/org/jbpm/mail/MailTest.java 2008-10-06 23:29:44 UTC (rev 2494)
@@ -1,68 +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.mail;
-
-import org.jbpm.JbpmConfiguration;
-import org.jbpm.JbpmContext;
-import org.jbpm.graph.def.ProcessDefinition;
-import org.jbpm.graph.exe.ProcessInstance;
-
-public class MailTest {
-
- public static class MyAddressResolver implements AddressResolver {
- private static final long serialVersionUID = 1L;
- public Object resolveAddress(String actorId) {
- return actorId+"@dalton.com";
- }
- }
-
- public void testSimpleProcess() throws Exception {
- JbpmConfiguration jbpmConfiguration = JbpmConfiguration.parseXmlString(
- "<jbpm-configuration>" +
- " <bean name='jbpm.mail.address.resolver' class='"+MyAddressResolver.class.getName()+"' singleton='true' />" +
- "</jbpm-configuration>"
- );
-
- JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
- try {
- ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
- "<process-definition name='mailtest'>" +
- " <start-state name='start'>" +
- " <transition to='start toothpick line' />" +
- " </start-state>" +
- " <task-node name='start toothpick line'>" +
- " <task notify='yes'>" +
- " <assignment actor-id='grandma' />" +
- " </task>" +
- " <transition to='end' />" +
- " </task-node>" +
- " <end-state name='end' />" +
- "</process-definition>"
- );
- ProcessInstance processInstance = new ProcessInstance(processDefinition);
- processInstance.signal();
-
- } finally {
- jbpmContext.close();
- }
- }
-}
Added: jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/main/java/org/jbpm/mail/MyAddressResolver.java
===================================================================
--- jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/main/java/org/jbpm/mail/MyAddressResolver.java (rev 0)
+++ jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/main/java/org/jbpm/mail/MyAddressResolver.java 2008-10-06 23:29:44 UTC (rev 2494)
@@ -0,0 +1,11 @@
+package org.jbpm.mail;
+
+public class MyAddressResolver implements AddressResolver {
+
+ private static final long serialVersionUID = 1L;
+
+ public Object resolveAddress(String actorId) {
+ return actorId + "@dalton.com";
+ }
+
+}
\ No newline at end of file
Added: jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/main/jpdl/Mail/processdefinition.xml
===================================================================
--- jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/main/jpdl/Mail/processdefinition.xml (rev 0)
+++ jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/main/jpdl/Mail/processdefinition.xml 2008-10-06 23:29:44 UTC (rev 2494)
@@ -0,0 +1,12 @@
+<process-definition name='mailtest'>
+ <start-state name='start'>
+ <transition to='start toothpick line' />
+ </start-state>
+ <task-node name='start toothpick line'>
+ <task notify='yes'>
+ <assignment actor-id='grandma' />
+ </task>
+ <transition to='end' />
+ </task-node>
+ <end-state name='end' />
+</process-definition>
\ No newline at end of file
Copied: jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/test/java/org/jbpm/mail/MailTest.java (from rev 2490, jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/main/java/org/jbpm/mail/MailTest.java)
===================================================================
--- jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/test/java/org/jbpm/mail/MailTest.java (rev 0)
+++ jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/test/java/org/jbpm/mail/MailTest.java 2008-10-06 23:29:44 UTC (rev 2494)
@@ -0,0 +1,68 @@
+/*
+ * 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.mail;
+
+import java.util.Iterator;
+
+import org.jbpm.JbpmConfiguration;
+import org.jbpm.JbpmContext;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ProcessInstance;
+
+import com.dumbster.smtp.SimpleSmtpServer;
+import com.dumbster.smtp.SmtpMessage;
+
+import junit.framework.TestCase;
+
+public class MailTest extends TestCase {
+
+ private SimpleSmtpServer server;
+ private JbpmContext jbpmContext;
+
+ private static JbpmConfiguration jbpmConfiguration = JbpmConfiguration.parseXmlString(
+ "<jbpm-configuration>" +
+ " <string name='resource.mail.properties' value='org/jbpm/mail/test.mail.properties' />" +
+ " <bean name='jbpm.mail.address.resolver' class='" + MyAddressResolver.class.getName() + "' singleton='true' />" +
+ "</jbpm-configuration>"
+ );
+
+ protected void setUp() throws Exception {
+ server = SimpleSmtpServer.start(23583);
+ jbpmContext = jbpmConfiguration.createJbpmContext();
+ }
+
+ protected void tearDown() throws Exception {
+ jbpmContext.close();
+ server.stop();
+ }
+
+ public void testMailProcess() throws Exception {
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("Mail/processdefinition.xml");
+ ProcessInstance processInstance = new ProcessInstance(processDefinition);
+ processInstance.signal();
+
+ assertEquals(1, server.getReceivedEmailSize());
+ Iterator emailIter = server.getReceivedEmail();
+ SmtpMessage email = (SmtpMessage) emailIter.next();
+ assertEquals("grandma at dalton.com", email.getHeaderValue("To"));
+ }
+}
Property changes on: jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/test/java/org/jbpm/mail/MailTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Added: jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/test/java/org/jbpm/mail/test.mail.properties
===================================================================
--- jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/test/java/org/jbpm/mail/test.mail.properties (rev 0)
+++ jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/examples/mail/src/test/java/org/jbpm/mail/test.mail.properties 2008-10-06 23:29:44 UTC (rev 2494)
@@ -0,0 +1,2 @@
+mail.smtp.host = localhost
+mail.smtp.port = 23583
\ No newline at end of file
More information about the jbpm-commits
mailing list