Author: alex.guizar(a)jboss.com
Date: 2010-08-21 14:14:12 -0400 (Sat, 21 Aug 2010)
New Revision: 6618
Modified:
jbpm3/branches/jbpm-3.2-soa/hudson/hudson-home/standalone.sh
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/jbpm.mail.templates.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/mail/TaskMailTest.java
Log:
update task list base url in mail templates;
adapt TaskMailTest that relied on old url
Modified: jbpm3/branches/jbpm-3.2-soa/hudson/hudson-home/standalone.sh
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/hudson/hudson-home/standalone.sh 2010-08-20 12:58:14 UTC
(rev 6617)
+++ jbpm3/branches/jbpm-3.2-soa/hudson/hudson-home/standalone.sh 2010-08-21 18:14:12 UTC
(rev 6618)
@@ -33,4 +33,4 @@
# Run standalone test suite
export JAVA_HOME=$ORIG_JAVA_HOME
-mvn --fail-at-end -Dsurefire.jvm.args="-Xms64m -Xmx256m" test
+mvn --fail-at-end -Dsurefire.jvm.args="-Xms64m -Xmx256m"
-Dmaven.test.failure.ignore=true test
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/jbpm.mail.templates.xml
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/jbpm.mail.templates.xml 2010-08-20
12:58:14 UTC (rev 6617)
+++
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/jbpm.mail.templates.xml 2010-08-21
18:14:12 UTC (rev 6618)
@@ -4,20 +4,19 @@
<mail-template name='task-assign'>
<actors>${taskInstance.actorId}</actors>
- <subject>Task '${taskInstance.name}'</subject>
+ <subject>Task notification: ${taskInstance.name}</subject>
<text><![CDATA[Hi ${taskInstance.actorId},
Task '${taskInstance.name}' has been assigned to you.
Go for it: ${taskListBaseURL}${taskInstance.id}
-Thanks.
Sent by jBPM]]></text>
</mail-template>
<mail-template name='task-reminder'>
<actors>${taskInstance.actorId}</actors>
- <subject>Task '${taskInstance.name}' !</subject>
+ <subject>Task reminder: ${taskInstance.name}</subject>
<text><![CDATA[Hey ${taskInstance.actorId},
-Do not forget about task '${taskInstance.name}'
+Do not forget about task '${taskInstance.name}'.
Get going: ${taskListBaseURL}${taskInstance.id}
Sent by jBPM]]></text>
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/mail/TaskMailTest.java
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/mail/TaskMailTest.java 2010-08-20
12:58:14 UTC (rev 6617)
+++
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/mail/TaskMailTest.java 2010-08-21
18:14:12 UTC (rev 6618)
@@ -72,15 +72,6 @@
return testSetup;
}
- public static class RoundRobinAssigner implements AssignmentHandler {
- private static final long serialVersionUID = 1L;
-
- public void assign(Assignable assignable, ExecutionContext executionContext)
- throws Exception {
- assignable.setActorId("you");
- }
- }
-
public void testTaskInstanceNotification() throws IOException, MessagingException {
ProcessDefinition processDefinition =
ProcessDefinition.parseXmlString("<process-definition>"
+ " <start-state>"
@@ -88,9 +79,7 @@
+ " </start-state>"
+ " <task-node name='a'>"
+ " <task name='laundry' notify='yes'>"
- + " <assignment class='"
- + RoundRobinAssigner.class.getName()
- + "' />"
+ + " <assignment actor-id='you' />"
+ " </task>"
+ " <transition to='b' />"
+ " </task-node>"
@@ -105,12 +94,13 @@
WiserMessage message = (WiserMessage) messages.get(0);
MimeMessage email = message.getMimeMessage();
- assert Arrays.equals(InternetAddress.parse("you(a)example.domain"),
email.getRecipients(RecipientType.TO));
- assertEquals("Task 'laundry'", email.getSubject());
+ assert Arrays.equals(InternetAddress.parse("you(a)example.domain"),
+ email.getRecipients(RecipientType.TO));
+ assertEquals("Task notification: laundry", email.getSubject());
// just to make sure that all expressions were resolved
String content = (String) email.getContent();
- assertEquals(-1, content.indexOf("#{"));
- assertTrue(content.indexOf("http://localhost:8080/jbpm/home?taskId=0") !=
-1);
+ assertEquals(-1, content.indexOf("${"));
+ assert content.startsWith("Hi you,") : content;
}
public static class TestSchedulerService implements SchedulerService, ServiceFactory {
@@ -154,9 +144,7 @@
+ " </start-state>"
+ " <task-node name='a'>"
+ " <task name='laundry'>"
- + " <assignment class='"
- + RoundRobinAssigner.class.getName()
- + "' />"
+ + " <assignment actor-id='you' />"
+ " <reminder duedate='0 seconds' repeat='60 seconds'
/>"
+ " </task>"
+ " <transition to='b' />"
@@ -184,12 +172,13 @@
WiserMessage message = (WiserMessage) messages.get(0);
MimeMessage email = message.getMimeMessage();
- assert Arrays.equals(InternetAddress.parse("you(a)example.domain"),
email.getRecipients(RecipientType.TO));
- assertEquals("Task 'laundry' !", email.getSubject());
+ assert Arrays.equals(InternetAddress.parse("you(a)example.domain"),
+ email.getRecipients(RecipientType.TO));
+ assertEquals("Task reminder: laundry", email.getSubject());
// just to make sure that all expressions were resolved
String content = (String) email.getContent();
- assertEquals(-1, content.indexOf("#{"));
- assertTrue(content.indexOf("http://localhost:8080/jbpm/home?taskId=0") !=
-1);
+ assertEquals(-1, content.indexOf("${"));
+ assert content.startsWith("Hey you,") : content;
TaskMgmtInstance taskMgmtInstance = processInstance.getTaskMgmtInstance();
TaskInstance taskInstance = (TaskInstance) taskMgmtInstance.getTaskInstances()
Show replies by date