JBoss JBPM SVN: r6289 - jbpm4/trunk.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-04-30 19:02:00 -0400 (Fri, 30 Apr 2010)
New Revision: 6289
Modified:
jbpm4/trunk/pom.xml
Log:
point to jboss public maven repos
Modified: jbpm4/trunk/pom.xml
===================================================================
--- jbpm4/trunk/pom.xml 2010-04-29 22:17:02 UTC (rev 6288)
+++ jbpm4/trunk/pom.xml 2010-04-30 23:02:00 UTC (rev 6289)
@@ -463,6 +463,37 @@
</plugins>
</build>
+ <!-- Repositories -->
+ <repositories>
+ <repository>
+ <id>jboss-public-repository-group</id>
+ <name>JBoss Public Maven Repository Group</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>jboss-public-repository-group</id>
+ <name>JBoss Public Maven Repository Group</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+
<profiles>
<!-- schema for direct db integration test. see qa\hudson-jbpm4-db.* -->
<profile>
13 years, 12 months
JBoss JBPM SVN: r6288 - jbpm3/branches/jbpm-3.2-soa.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-04-29 18:17:02 -0400 (Thu, 29 Apr 2010)
New Revision: 6288
Modified:
jbpm3/branches/jbpm-3.2-soa/profiles.example.xml
Log:
update example profiles
Modified: jbpm3/branches/jbpm-3.2-soa/profiles.example.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/profiles.example.xml 2010-04-29 21:32:49 UTC (rev 6287)
+++ jbpm3/branches/jbpm-3.2-soa/profiles.example.xml 2010-04-29 22:17:02 UTC (rev 6288)
@@ -56,26 +56,10 @@
<jdbc.sybase.password>jbpm3jbpm3</jdbc.sybase.password>
<jdbc.sybase.driver>com.sybase.jdbc3.jdbc.SybDriver</jdbc.sybase.driver>
<jdbc.sybase.datasource>com.sybase.jdbc3.jdbc.SybXADataSource</jdbc.sybase.datasource>
-
- <updateReleaseInfo>true</updateReleaseInfo>
</properties>
</profile>
</profiles>
- <servers>
- <server>
- <id>snapshots.jboss.org</id>
- <username>jboss.org-username</username>
- <password>password</password>
- </server>
-
- <server>
- <id>repository.jboss.org</id>
- <username>jboss.org-username</username>
- <password>password</password>
- </server>
- </servers>
-
<activeProfiles>
<activeProfile>dev-local</activeProfile>
</activeProfiles>
13 years, 12 months
JBoss JBPM SVN: r6287 - jbpm3/branches/jbpm-3.2-soa/modules/core and 3 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-04-29 17:32:49 -0400 (Thu, 29 Apr 2010)
New Revision: 6287
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/pom.xml
jbpm3/branches/jbpm-3.2-soa/modules/examples/pom.xml
jbpm3/branches/jbpm-3.2-soa/modules/identity/pom.xml
jbpm3/branches/jbpm-3.2-soa/pom.xml
projects/jsf-console/branches/jsf-console-3.2-soa/pom.xml
Log:
prevent jbpm3 build from depending on local settings
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/pom.xml 2010-04-29 16:31:38 UTC (rev 6286)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/pom.xml 2010-04-29 21:32:49 UTC (rev 6287)
@@ -65,6 +65,11 @@
<!-- Provided Dependencies -->
<dependency>
+ <groupId>org.jboss.spec.javax.transaction</groupId>
+ <artifactId>jboss-transaction-api_1.1_spec</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>javax.jcr</groupId>
<artifactId>jcr</artifactId>
<scope>provided</scope>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/examples/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/examples/pom.xml 2010-04-29 16:31:38 UTC (rev 6286)
+++ jbpm3/branches/jbpm-3.2-soa/modules/examples/pom.xml 2010-04-29 21:32:49 UTC (rev 6287)
@@ -42,13 +42,13 @@
<!-- Provided Dependencies -->
<dependency>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
+ <groupId>org.jboss.spec.javax.transaction</groupId>
+ <artifactId>jboss-transaction-api_1.1_spec</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate</artifactId>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
<scope>provided</scope>
</dependency>
@@ -64,6 +64,11 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/identity/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/identity/pom.xml 2010-04-29 16:31:38 UTC (rev 6286)
+++ jbpm3/branches/jbpm-3.2-soa/modules/identity/pom.xml 2010-04-29 21:32:49 UTC (rev 6287)
@@ -40,6 +40,11 @@
<artifactId>ant</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.spec.javax.transaction</groupId>
+ <artifactId>jboss-transaction-api_1.1_spec</artifactId>
+ <scope>provided</scope>
+ </dependency>
<!-- Test Dependencies -->
<dependency>
@@ -123,4 +128,4 @@
</dependencies>
</profile>
</profiles>
-</project>
\ No newline at end of file
+</project>
Modified: jbpm3/branches/jbpm-3.2-soa/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/pom.xml 2010-04-29 16:31:38 UTC (rev 6286)
+++ jbpm3/branches/jbpm-3.2-soa/pom.xml 2010-04-29 21:32:49 UTC (rev 6287)
@@ -58,13 +58,15 @@
<jboss.client.version>4.0.5.GA</jboss.client.version>
<jboss.gravel.version>1.0.0.GA</jboss.gravel.version>
<jboss.j2ee.version>4.0.2</jboss.j2ee.version>
+ <jboss.transaction.api.version>1.0.0.Beta1</jboss.transaction.api.version>
<jbpm.designer.version>3.1.7</jbpm.designer.version>
<jbpm.jsf-console.version>3.2.9</jbpm.jsf-console.version>
+ <jsf.facelets.version>1.1.15</jsf.facelets.version>
<junit.version>3.8.1</junit.version>
<log4j.version>1.2.14</log4j.version>
<mvel.version>1.3.1-java1.4</mvel.version>
+ <retrotranslator.version>1.2.7</retrotranslator.version>
<richfaces.ui.version>3.2.1.GA</richfaces.ui.version>
- <sun.facelets.version>1.1.15</sun.facelets.version>
<wiser.version>1.2</wiser.version>
<xerces.version>2.6.2</xerces.version>
@@ -77,7 +79,6 @@
<mysql.connector.version>5.0.7</mysql.connector.version>
<ojdbc.version>10.2.0.4</ojdbc.version>
<postgresql.version>8.2-504.jdbc3</postgresql.version>
- <retrotranslator.version>1.2.7</retrotranslator.version>
</properties>
<!-- DependencyManagement -->
@@ -195,6 +196,12 @@
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>${hibernate.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
@@ -222,6 +229,11 @@
<version>${jboss.j2ee.version}</version>
</dependency>
<dependency>
+ <groupId>org.jboss.spec.javax.transaction</groupId>
+ <artifactId>jboss-transaction-api_1.1_spec</artifactId>
+ <version>${jboss.transaction.api.version}</version>
+ </dependency>
+ <dependency>
<groupId>javax.jcr</groupId>
<artifactId>jcr</artifactId>
<version>${javax.jcr.version}</version>
@@ -229,7 +241,7 @@
<dependency>
<groupId>com.sun.facelets</groupId>
<artifactId>jsf-facelets</artifactId>
- <version>${sun.facelets.version}</version>
+ <version>${jsf.facelets.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
@@ -394,11 +406,34 @@
<!-- Repositories -->
<repositories>
<repository>
- <id>repository.jboss.org</id>
- <url>http://repository.jboss.org/maven2</url>
+ <id>jboss-public-repository-group</id>
+ <name>JBoss Public Maven Repository Group</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
</repository>
</repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>jboss-public-repository-group</id>
+ <name>JBoss Public Maven Repository Group</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+
<!-- Profiles -->
<profiles>
<!--
Modified: projects/jsf-console/branches/jsf-console-3.2-soa/pom.xml
===================================================================
--- projects/jsf-console/branches/jsf-console-3.2-soa/pom.xml 2010-04-29 16:31:38 UTC (rev 6286)
+++ projects/jsf-console/branches/jsf-console-3.2-soa/pom.xml 2010-04-29 21:32:49 UTC (rev 6287)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-parent</artifactId>
- <version>1.0.2</version>
+ <version>1.0.3</version>
</parent>
<!-- Modules -->
@@ -123,11 +123,41 @@
</plugins>
</build>
+ <!-- Repositories -->
+ <repositories>
+ <repository>
+ <id>jboss-public-repository-group</id>
+ <name>JBoss Public Maven Repository Group</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>jboss-public-repository-group</id>
+ <name>JBoss Public Maven Repository Group</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+
<!-- Profiles -->
<profiles>
<profile>
<id>soa</id>
-
<modules>
<module>soa</module>
</modules>
13 years, 12 months
JBoss JBPM SVN: r6286 - in jbpm4/trunk/modules: test-db/src/test/java/org/jbpm/test/task and 1 other directory.
by do-not-reply@jboss.org
Author: swiderski.maciej
Date: 2010-04-29 12:31:38 -0400 (Thu, 29 Apr 2010)
New Revision: 6286
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/TaskQueryImpl.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryCandidatesTest.java
Log:
JBPM-2648: implementation and test cases
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/TaskQueryImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/TaskQueryImpl.java 2010-04-28 04:33:08 UTC (rev 6285)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/TaskQueryImpl.java 2010-04-29 16:31:38 UTC (rev 6286)
@@ -139,9 +139,9 @@
hql.append("select ");
if (count) {
- hql.append("count(task) ");
+ hql.append("count(distinct task) ");
} else {
- hql.append("task ");
+ hql.append("distinct task ");
}
hql.append("from ");
@@ -167,7 +167,7 @@
groupIds = new ArrayList<String>();
for (Group group: groups) {
groupIds.add(group.getId());
- }
+ }
appendWhereClause("((participant.userId = :candidateUserId) or (participant.groupId in (:candidateGroupIds)))", hql);
}
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryCandidatesTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryCandidatesTest.java 2010-04-28 04:33:08 UTC (rev 6285)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryCandidatesTest.java 2010-04-29 16:31:38 UTC (rev 6286)
@@ -49,6 +49,7 @@
developmentGroupId = identityService.createGroup("development");
identityService.createMembership("jackblack", developmentGroupId);
+ identityService.createMembership("johndoe", developmentGroupId);
}
public void tearDown() throws Exception {
@@ -127,4 +128,51 @@
taskService.deleteTaskCascade(johnsOtherTaskId);
taskService.deleteTaskCascade(joesOtherTaskId);
}
+
+ public void testGroupCandidateDuplicate() {
+ Task task = taskService.newTask();
+ task.setName("do laundry");
+ String taskId = taskService.saveTask(task);
+ taskService.addTaskParticipatingGroup(taskId, salesGroupId, Participation.CANDIDATE);
+ taskService.addTaskParticipatingGroup(taskId, developmentGroupId, Participation.CANDIDATE);
+
+ // this tasks are a diversion to see if the query only selects the above task
+ task = taskService.newTask();
+ task.setName("dishes");
+ String johnsOtherTaskId = taskService.saveTask(task);
+
+ // this tasks are a diversion to see if the query only selects the above task
+ task = taskService.newTask();
+ task.setName("dishes");
+ String joesOtherTaskId = taskService.saveTask(task);
+
+
+ List<Task> groupTasks = taskService.findGroupTasks("johndoe");
+ assertEquals(1, groupTasks.size());
+ assertEquals(taskId, groupTasks.get(0).getId());
+
+ groupTasks = taskService.findGroupTasks("joesmoe");
+ assertEquals(1, groupTasks.size());
+ assertEquals(taskId, groupTasks.get(0).getId());
+
+ groupTasks = taskService.findGroupTasks("jackblack");
+ assertEquals(1, groupTasks.size());
+
+ taskService.deleteTaskCascade(taskId);
+ taskService.deleteTaskCascade(johnsOtherTaskId);
+ taskService.deleteTaskCascade(joesOtherTaskId);
+ }
+
+ public void testCountGroupCandidateDuplicate() {
+ Task task = taskService.newTask();
+ task.setName("do laundry");
+ String taskId = taskService.saveTask(task);
+ taskService.addTaskParticipatingGroup(taskId, salesGroupId, Participation.CANDIDATE);
+ taskService.addTaskParticipatingGroup(taskId, developmentGroupId, Participation.CANDIDATE);
+
+ long count = taskService.createTaskQuery().candidate("johndoe").count();
+ assertEquals(1, count);
+
+ taskService.deleteTaskCascade(taskId);
+ }
}
13 years, 12 months
JBoss JBPM SVN: r6285 - in jbpm4/trunk: modules/db/src/main/java/org/jbpm/db and 2 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-04-28 00:33:08 -0400 (Wed, 28 Apr 2010)
New Revision: 6285
Modified:
jbpm4/trunk/modules/db/src/main/java/org/jbpm/db/Create.java
jbpm4/trunk/modules/migration/pom.xml
jbpm4/trunk/modules/pvm/pom.xml
jbpm4/trunk/pom.xml
Log:
JBPM-2844: upgrade to activation 1.1.1
migrate to maven nexus repo
Modified: jbpm4/trunk/modules/db/src/main/java/org/jbpm/db/Create.java
===================================================================
--- jbpm4/trunk/modules/db/src/main/java/org/jbpm/db/Create.java 2010-04-28 02:52:18 UTC (rev 6284)
+++ jbpm4/trunk/modules/db/src/main/java/org/jbpm/db/Create.java 2010-04-28 04:33:08 UTC (rev 6285)
@@ -55,9 +55,9 @@
.buildProcessEngine();
try {
- processEngine.execute(new Command<Object>(){
+ processEngine.execute(new Command<Void>(){
private static final long serialVersionUID = 1L;
- public Object execute(Environment environment) throws Exception {
+ public Void execute(Environment environment) throws Exception {
Session session = environment.get(Session.class);
DbHelper.executeSqlResource("create/jbpm."+database+".create.sql", session);
PropertyImpl.createProperties(session);
Modified: jbpm4/trunk/modules/migration/pom.xml
===================================================================
--- jbpm4/trunk/modules/migration/pom.xml 2010-04-28 02:52:18 UTC (rev 6284)
+++ jbpm4/trunk/modules/migration/pom.xml 2010-04-28 04:33:08 UTC (rev 6285)
@@ -1,76 +1,74 @@
<?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. -->
<!-- -->
-<!-- ======================================================================
--->
+<!-- ====================================================================== -->
<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">
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
- <modelVersion>4.0.0</modelVersion>
+ <name>jBPM 4 - Migration - Tool</name>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jpdl-migration</artifactId>
+ <packaging>jar</packaging>
- <name>jBPM 4 - Migration - Tool</name>
- <groupId>org.jbpm.jbpm4</groupId>
- <artifactId>jpdl-migration</artifactId>
- <packaging>jar</packaging>
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm</artifactId>
+ <version>4.4-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
- <!-- Parent -->
- <parent>
- <groupId>org.jbpm.jbpm4</groupId>
- <artifactId>jbpm</artifactId>
- <version>4.4-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <!-- Dependencies -->
- <dependencies>
+ <!-- Dependencies -->
+ <dependencies>
<dependency>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-jpdl</artifactId>
<version>${project.version}</version>
- </dependency>
+ </dependency>
- <dependency>
- <groupId>dom4j</groupId>
- <artifactId>dom4j</artifactId>
- <exclusions>
- <exclusion>
- <artifactId>xml-apis</artifactId>
- <groupId>xml-apis</groupId>
- </exclusion>
- </exclusions>
- <version>1.6.1</version>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.14</version>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.4</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ <dependency>
+ <groupId>dom4j</groupId>
+ <artifactId>dom4j</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>xml-apis</artifactId>
+ <groupId>xml-apis</groupId>
+ </exclusion>
+ </exclusions>
+ <version>1.6.1</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.4</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
- <!-- Profiles -->
- <profiles>
-
- <!-- skip tests if this is an integration test run
- (only examples and test-db are part of the integration test runs) -->
+ <!-- Profiles -->
+ <profiles>
+ <!--
+ skip tests if this is an integration test run (only examples and test-db are part of the
+ integration test runs)
+ -->
<profile>
<id>skip.tests.during.database.testrun</id>
<activation>
@@ -83,60 +81,48 @@
</properties>
</profile>
- <profile>
- <id>distro</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <finalName>jbpm-migration</finalName>
- <archive>
- <manifest>
- <addClasspath>true</addClasspath>
- <classpathPrefix>lib/</classpathPrefix>
- <mainClass>org.jbpm.jpdl.internal.convert.JpdlConverterTool</mainClass>
- </manifest>
- </archive>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <!--version>2.2-beta-3</version-->
- <executions>
- <execution>
- <id>distribution-package</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <finalName>migration-distro</finalName>
- <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
- <appendAssemblyId>false</appendAssemblyId>
- <descriptors>
- <descriptor>scripts/assembly-distro.xml</descriptor>
- </descriptors>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
+ <profile>
+ <id>distro</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <finalName>jbpm-migration</finalName>
+ <archive>
+ <manifest>
+ <addClasspath>true</addClasspath>
+ <classpathPrefix>lib/</classpathPrefix>
+ <mainClass>org.jbpm.jpdl.internal.convert.JpdlConverterTool</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
- <pluginRepositories>
- <pluginRepository>
- <id>codehaus</id>
- <name>codehaus</name>
- <url>http://repository.codehaus.org
- </url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </pluginRepository>
- </pluginRepositories>
-
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <!--version>2.2-beta-3</version-->
+ <executions>
+ <execution>
+ <id>distribution-package</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <finalName>migration-distro</finalName>
+ <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
+ <appendAssemblyId>false</appendAssemblyId>
+ <descriptors>
+ <descriptor>scripts/assembly-distro.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
Modified: jbpm4/trunk/modules/pvm/pom.xml
===================================================================
--- jbpm4/trunk/modules/pvm/pom.xml 2010-04-28 02:52:18 UTC (rev 6284)
+++ jbpm4/trunk/modules/pvm/pom.xml 2010-04-28 04:33:08 UTC (rev 6285)
@@ -12,7 +12,7 @@
<!-- $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">
+ 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>jBPM 4 - PVM</name>
@@ -28,14 +28,6 @@
<relativePath>../../pom.xml</relativePath>
</parent>
- <repositories>
- <repository>
- <id>Snapshot</id>
- <name>JBoss Snapshot</name>
- <url>http://snapshots.jboss.org/maven2/</url>
- </repository>
- </repositories>
-
<!-- Dependencies -->
<dependencies>
<dependency>
@@ -77,8 +69,8 @@
<artifactId>bsh</artifactId>
</dependency>
<dependency>
- <groupId>org.codehaus.groovy</groupId>
- <artifactId>groovy-all</artifactId>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy-all</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
@@ -132,7 +124,7 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
- </exclusions>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
@@ -215,7 +207,7 @@
</plugins>
</reporting>
</profile>
-
+
<!-- skip tests if this is an integration test run
(only examples and test-db are part of the integration test runs) -->
<profile>
@@ -229,6 +221,18 @@
<skipTests>true</skipTests>
</properties>
</profile>
+
+ <profile>
+ <id>jdk15</id>
+ <activation>
+ <jdk>1.5</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
</profiles>
-
</project>
Modified: jbpm4/trunk/pom.xml
===================================================================
--- jbpm4/trunk/pom.xml 2010-04-28 02:52:18 UTC (rev 6284)
+++ jbpm4/trunk/pom.xml 2010-04-28 04:33:08 UTC (rev 6285)
@@ -12,22 +12,22 @@
<!-- $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">
-
+ 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>jBPM 4</name>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm</artifactId>
+ <version>4.4-SNAPSHOT</version>
<packaging>pom</packaging>
- <version>4.4-SNAPSHOT</version>
+ <!-- Parent -->
+ <parent>
+ <artifactId>jbpm-parent</artifactId>
+ <groupId>org.jbpm</groupId>
+ <version>1.0.3</version>
+ </parent>
- <organization>
- <name>JBoss, a division of Red Hat</name>
- <url>http://www.jboss.org</url>
- </organization>
-
<!-- Modules -->
<modules>
<module>modules/log</module>
@@ -45,7 +45,6 @@
<!-- Properties -->
<properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<apache.ant.version>1.7.0</apache.ant.version>
<beanshell.version>2.0b5</beanshell.version>
<groovy.version>1.5.6</groovy.version>
@@ -73,19 +72,19 @@
<signavio.jbpmeditor.version>1.1</signavio.jbpmeditor.version>
<spring.version>2.0.8</spring.version>
<stax.api.version>1.0.1</stax.api.version>
- <wiser.version>1.2</wiser.version>
+ <wiser.version>1.2</wiser.version>
<woodstox.version>3.2.6</woodstox.version>
<mysql.connector.version>5.0.8</mysql.connector.version>
<postgresql.version>8.3-603.jdbc3</postgresql.version>
<jtds.version>1.2.2</jtds.version>
<oracle.version>10.2.0.4</oracle.version>
<cdi.version>1.0</cdi.version>
- </properties>
+ <activation.version>1.1.1</activation.version>
+ </properties>
<!-- DependencyManagement -->
<dependencyManagement>
<dependencies>
-
<!-- Core engine components -->
<dependency>
<groupId>org.jbpm.jbpm4</groupId>
@@ -164,31 +163,31 @@
<artifactId>jbpm-tomcat6</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.jbpm.jbpm4</groupId>
- <artifactId>jbpm-console-integration</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jbpm.jbpm4</groupId>
- <artifactId>jbpm-console-form-plugin</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
- <groupId>org.jbpm.jbpm4</groupId>
- <artifactId>jbpm-console-graphView-plugin</artifactId>
- <version>${project.version}</version>
- </dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-console-integration</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-console-form-plugin</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-console-graphView-plugin</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-console-reports</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.jbpm.jbpm4</groupId>
- <artifactId>jbpm-jboss4</artifactId>
- <version>${project.version}</version>
- </dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-jboss4</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-gpd</artifactId>
@@ -204,12 +203,12 @@
<!-- External dependencies -->
<!-- Please sort by groupid -->
- <dependency>
- <groupId>aspectj</groupId>
- <artifactId>aspectjrt</artifactId>
- <version>${aspectjrt.version}</version>
- </dependency>
<dependency>
+ <groupId>aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ <version>${aspectjrt.version}</version>
+ </dependency>
+ <dependency>
<groupId>cactus</groupId>
<artifactId>cactus.core</artifactId>
<version>${cactus.version}</version>
@@ -240,10 +239,12 @@
<version>${juel.version}</version>
</dependency>
<dependency>
- <!-- The juel engine is the library from scripting.java.sun.com that exposes juel as a jsr233 scripting engine.
- It's not part of the juel distribution. For some reason i don't recall, we uploaded it as
- an juel-engine artifact in the group juel. And more problematic, used the juel version (2.1.0) for it.
- That is not intuitive. -->
+ <!--
+ The juel engine is the library from scripting.java.sun.com that exposes juel as a
+ jsr233 scripting engine. It's not part of the juel distribution. For some reason i
+ don't recall, we uploaded it as an juel-engine artifact in the group juel. And more
+ problematic, used the juel version (2.1.0) for it. That is not intuitive.
+ -->
<groupId>juel</groupId>
<artifactId>juel-engine</artifactId>
<version>${juel.engine.version}</version>
@@ -264,6 +265,16 @@
<version>${log4j.version}</version>
</dependency>
<dependency>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ <version>${activation.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
+ <version>${cdi.version}</version>
+ </dependency>
+ <dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>${mail.version}</version>
@@ -300,9 +311,9 @@
<version>${report.engine.version}</version>
</dependency>
<dependency>
- <groupId>org.freemarker</groupId>
- <artifactId>freemarker</artifactId>
- <version>${freemarker.version}</version>
+ <groupId>org.freemarker</groupId>
+ <artifactId>freemarker</artifactId>
+ <version>${freemarker.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
@@ -338,23 +349,23 @@
<artifactId>gwt-console-server-integration</artifactId>
<version>${gwt.console.version}</version>
</dependency>
- <dependency>
- <groupId>org.jboss.bpm</groupId>
- <artifactId>gwt-console-rpc</artifactId>
- <version>${gwt.console.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.errai</groupId>
- <artifactId>errai-common</artifactId>
- <version>${errai.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.errai</groupId>
- <artifactId>errai-bus</artifactId>
- <version>${errai.version}</version>
- </dependency>
<dependency>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-rpc</artifactId>
+ <version>${gwt.console.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.errai</groupId>
+ <artifactId>errai-common</artifactId>
+ <version>${errai.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.errai</groupId>
+ <artifactId>errai-bus</artifactId>
+ <version>${errai.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss.javaee</groupId>
<artifactId>jboss-javaee</artifactId>
<version>${jboss.client.version}</version>
@@ -396,11 +407,6 @@
<version>${wiser.version}</version>
</dependency>
<dependency>
- <groupId>org.subethamail</groupId>
- <artifactId>subethasmtp-smtp</artifactId>
- <version>${wiser.version}</version>
- </dependency>
- <dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>wstx-lgpl</artifactId>
<version>${woodstox.version}</version>
@@ -427,34 +433,9 @@
<artifactId>jtds</artifactId>
<version>${jtds.version}</version>
</dependency>
- <dependency>
- <groupId>javax.enterprise</groupId>
- <artifactId>cdi-api</artifactId>
- <version>${cdi.version}</version>
- </dependency>
</dependencies>
</dependencyManagement>
- <scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/jbpm/jbpm4</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/jbpm/jbpm4</developerConnection>
- <url>http://fisheye.jboss.com/browse/JbpmSvn/jbpm4</url>
- </scm>
-
- <!-- IssueManagement -->
- <issueManagement>
- <system>jira</system>
- <url>http://jira.jboss.org/jira/browse/JBPM</url>
- </issueManagement>
-
- <!-- Licenses -->
- <licenses>
- <license>
- <name>lgpl</name>
- <url>http://repository.jboss.com/licenses/lgpl.txt</url>
- </license>
- </licenses>
-
<!-- Plugins -->
<build>
<plugins>
@@ -480,42 +461,6 @@
</configuration>
</plugin>
</plugins>
-
- <!-- PluginManagement -->
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.0.2.SP1</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.2-beta-2</version>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.1</version>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>buildnumber-maven-plugin</artifactId>
- <version>1.0-beta-1</version>
- </plugin>
- <plugin>
- <groupId>net.sourceforge.maven-taglib</groupId>
- <artifactId>maven-taglib-plugin</artifactId>
- <version>2.3</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.3</version>
- </plugin>
- </plugins>
- </pluginManagement>
</build>
<profiles>
@@ -738,89 +683,5 @@
<module>modules/test-load</module>
</modules>
</profile>
-
</profiles>
-
- <!-- Repositories -->
- <repositories>
- <repository>
- <id>maven1.java.net</id>
- <url>http://download.java.net/maven/1/</url>
- <layout>legacy</layout>
- </repository>
- <repository>
- <id>repository.jboss.org</id>
- <url>http://repository.jboss.com/maven2</url>
- <snapshots>
- <enabled>false</enabled>
- <checksumPolicy>ignore</checksumPolicy>
- </snapshots>
- </repository>
- <repository>
- <id>snapshots.jboss.org</id>
- <url>http://snapshots.jboss.org/maven2</url>
- <snapshots>
- <enabled>true</enabled>
- <checksumPolicy>ignore</checksumPolicy>
- </snapshots>
- </repository>
- <repository>
- <id>repository.codehaus.org</id>
- <url>http://repository.codehaus.org</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- <repository>
- <id>maven2.java.net</id>
- <name>Java.net Repository for Maven 2</name>
- <url>http://download.java.net/maven/2/</url>
- </repository>
- <repository>
- <id>gwt-maven</id>
- <url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/</url>
- </repository>
- </repositories>
-
- <!-- PluginRepositories -->
- <pluginRepositories>
- <pluginRepository>
- <id>maven2.java.net</id>
- <name>Java.net Repository for Maven 2</name>
- <url>http://download.java.net/maven/2/</url>
- </pluginRepository>
- <pluginRepository>
- <id>repository.jboss.com</id>
- <url>http://repository.jboss.com/maven2</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </pluginRepository>
- <pluginRepository>
- <id>snapshots.jboss.org</id>
- <url>http://snapshots.jboss.org/maven2</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </pluginRepository>
- <pluginRepository>
- <id>gwt-maven</id>
- <url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/</url>
- </pluginRepository>
- </pluginRepositories>
-
- <!-- DistributionManagement -->
- <distributionManagement>
- <repository>
- <id>repository.jboss.org</id>
- <name>JBoss Maven Repository</name>
- <url>file://${jboss.maven.repository}</url>
- </repository>
- <snapshotRepository>
- <id>snapshots.jboss.org</id>
- <name>JBoss Snapshot Repository</name>
- <url>dav:https://snapshots.jboss.org/maven2</url>
- </snapshotRepository>
- </distributionManagement>
-
</project>
13 years, 12 months
JBoss JBPM SVN: r6283 - jbpm3/branches/jbpm-3.2-soa.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-04-27 22:05:53 -0400 (Tue, 27 Apr 2010)
New Revision: 6283
Modified:
jbpm3/branches/jbpm-3.2-soa/pom.xml
Log:
upgrade to jbpm-parent 1.0.3
Modified: jbpm3/branches/jbpm-3.2-soa/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/pom.xml 2010-04-28 00:26:26 UTC (rev 6282)
+++ jbpm3/branches/jbpm-3.2-soa/pom.xml 2010-04-28 02:05:53 UTC (rev 6283)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-parent</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.3</version>
</parent>
<!-- Modules -->
13 years, 12 months
JBoss JBPM SVN: r6282 - projects/parent/trunk.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-04-27 20:26:26 -0400 (Tue, 27 Apr 2010)
New Revision: 6282
Modified:
projects/parent/trunk/pom.xml
Log:
release jbpm-parent 1.0.3
Modified: projects/parent/trunk/pom.xml
===================================================================
--- projects/parent/trunk/pom.xml 2010-04-27 05:19:48 UTC (rev 6281)
+++ projects/parent/trunk/pom.xml 2010-04-28 00:26:26 UTC (rev 6282)
@@ -7,7 +7,7 @@
<groupId>org.jbpm</groupId>
<artifactId>jbpm-parent</artifactId>
<packaging>pom</packaging>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.3</version>
<!-- Organization -->
<organization>
@@ -78,7 +78,6 @@
<!-- Plugin Management -->
<pluginManagement>
<plugins>
-
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
@@ -108,6 +107,7 @@
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.5</version>
</plugin>
+
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
13 years, 12 months
JBoss JBPM SVN: r6281 - jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/modules.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-04-27 01:19:48 -0400 (Tue, 27 Apr 2010)
New Revision: 6281
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/modules/mail.xml
Log:
JBPM-2852: document cc support
Modified: jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/modules/mail.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/modules/mail.xml 2010-04-27 04:49:17 UTC (rev 6280)
+++ jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/modules/mail.xml 2010-04-27 05:19:48 UTC (rev 6281)
@@ -18,7 +18,7 @@
<para>Anywhere you are allowed to specify actions in the process, you can specify a mail action
like this:
</para>
- <programlisting><<emphasis role="bold">mail</emphasis> actors="#{president}" subject="readmylips" text="nomoretaxes" /></programlisting>
+ <programlisting><mail actors="#{president}" subject="readmylips" text="nomoretaxes" /></programlisting>
<para>The subject and text attributes can also be specified as an element like this:</para>
<programlisting><mail actors="#{president}" >
<subject>readmylips</subject>
@@ -54,9 +54,9 @@
<para>The attributes and elements supported by mail nodes are exactly the same as with
the <link linkend="mailaction">mail actions</link>.
</para>
- <programlisting><<emphasis role="bold">mail-node</emphasis> name="send email" to="#{president}" subject="readmylips" text="nomoretaxes">
+ <programlisting><mail-node name="send email" to="#{president}" subject="readmylips" text="nomoretaxes">
<transition to="the next node" />
-</<emphasis role="bold">mail-node</emphasis>></programlisting>
+</mail-node></programlisting>
<para>Mail nodes should have exactly one leaving transition.</para>
</section>
@@ -84,7 +84,7 @@
</para>
<programlisting><task-node name='a'>
<task name='laundry' swimlane="grandma" notify='yes'>
- <emphasis role="bold"><reminder duedate="2 business days" repeat="2 business hours"/></emphasis>
+ <reminder duedate="2 business days" repeat="2 business hours"/>
</task>
<transition to='b' />
</task-node>
@@ -98,7 +98,7 @@
and <literal>text</literal> can contain JSF-like expressions. For more information about expressions,
see <xref linkend="expressions" />
</para>
- <para>The variables in the expressions can be : swimlanes, process variables, transient variables
+ <para>The variables in the expressions can be: swimlanes, process variables, transient variables
beans configured in the jbpm.cfg.xml, ...
</para>
<para>These expressions can be combined with the <link linkend="addressresolving">address resolving</link>
@@ -116,23 +116,28 @@
<section id="multiplerecipients">
<title>Multiple recipients</title>
<para>In the <literal>actors</literal> and <literal>to</literal> fields, multiple recipients
- can be separated with a semi colon (;) or a colon (:).</para>
+ can be separated with a comma (,) semi colon (;) or colon (:).</para>
</section>
<section id="BCC">
- <title>Sending Mails to a BCC target</title>
- <para>Sometimes you want to send emails to a BCC target in addition to the normal receipient.
+ <title>Sending Mails to a BCC recipient</title>
+ <para>Sometimes you want to send emails to a BCC recipient in addition to the normal recipient.
Currently, there are two supported ways of doing that: First you can specify an <literal>bccActors</literal>
- or <literal>bcc</literal> attribute (according to <literal>actors</literal> and <literal>to</literal>) in the process definition.
+ or <literal>bcc</literal> attribute (according to <literal>actors</literal> and <literal>to</literal>)
+ in the process definition.</para>
<programlisting><mail to='#{initiator}' bcc='bcc(a)mycompany.com' subject='websale' text='your websale of #{quantity} #{item} was approved' /></programlisting>
-
-
- The second way is to always send an BCC Mail to some location you can configure in the central configuration (jbpm.cfg.xml) in a property:
- <programlisting><jbpm-configuration>
+ <para>The second way is to always send a BCC mail to some location you can configure in a
+ property of the configuration file (jbpm.cfg.xml):</para>
+ <programlisting><jbpm-configuration>
...
- <emphasis role="bold"><string name="jbpm.mail.bcc.address" value="bcc(a)mycompany.com" /></emphasis>
+ <string name="jbpm.mail.bcc.address" value="bcc(a)mycompany.com" />
</jbpm-configuration></programlisting>
- </para>
</section>
+ <section id="CC">
+ <title>Sending Mails to a CC recipient</title>
+ <para>It is possible to send a carbon copy of an email in much the same way as BCC recipients.</para>
+ <programlisting><mail to='#{initiator}' cc='#{supervisor}' subject='websale' text='your websale of #{quantity} #{item} was approved' /></programlisting>
+ <para>There is no provision to send mail to a preconfigured CC recipient though.</para>
+ </section>
<section id="addressresolving">
<title>Address resolving</title>
<para>In all of jBPM, actors are referenced by actorId's. This is a string that servers as the identifier
@@ -147,7 +152,7 @@
<programlisting>public interface AddressResolver extends Serializable {
Object resolveAddress(String actorId);
}</programlisting>
- <para>An address resolver should return 1 of 3 types: a String, a Collection of Strings or an array
+ <para>An address resolver should return one of the following: a String, a Collection of Strings or an array
of Strings. All strings should represent email addresses for the given actorId.
</para>
<para>The address resolver implementation should be a bean configured in the jbpm.cfg.xml with
@@ -155,7 +160,7 @@
</para>
<programlisting><jbpm-configuration>
...
- <emphasis role="bold"><bean name='jbpm.mail.address.resolver' class='org.jbpm.identity.mail.IdentityAddressResolver' singleton='true' /></emphasis>
+ <bean name='jbpm.mail.address.resolver' class='org.jbpm.identity.mail.IdentityAddressResolver' singleton='true' />
</jbpm-configuration>
</programlisting>
<para>The identity component of jBPM includes an address resolver. That address resolver
@@ -198,45 +203,46 @@
</mail-templates>
</programlisting>
<para>As you can see in this example (BaseTaskListURL), extra variables can be defined in
- the mail templates that will be availble in the expressions.
+ the mail templates that will be available in the expressions.
</para>
<para>The resource that contains the templates should be configured in the jbpm.cfg.xml
like this:
</para>
<programlisting><jbpm-configuration>
...
- <emphasis role="bold"><string name="resource.mail.templates" value="jbpm.mail.templates.xml" /></emphasis>
+ <string name="resource.mail.templates" value="jbpm.mail.templates.xml" />
</jbpm-configuration></programlisting>
</section>
<section id="mailserverconfiguration">
<title>Mail server configuration</title>
- <para>The simplest way to configure the mail server is with the configuration property
- <literal>jbpm.mail.smtp.host</literal> in the jbpm.cfg.xml like this:
+ <para>The simplest way to configure the mail server is with the
+ <literal>jbpm.mail.smtp</literal> properties in the configuration like this:
</para>
<programlisting><jbpm-configuration>
...
- <emphasis role="bold"><string name="jbpm.mail.smtp.host" value="localhost" /></emphasis>
+ <string name="jbpm.mail.smtp.host" value="localhost" />
+ <int name="jbpm.mail.smtp.port" value="25" />
</jbpm-configuration></programlisting>
- <para>Alternatively, when more properties need to be specified, a resource reference to
- a properties file can be given with the key '' like this:
+ <para>Alternatively, when more properties need to be specified, a mail properties
+ resource can be specified with <literal>resource.mail.properties</literal>.
</para>
<programlisting><jbpm-configuration>
...
- <emphasis role="bold"><string name='resource.mail.properties' value='jbpm.mail.properties' /></emphasis>
+ <string name='resource.mail.properties' value='jbpm.mail.properties' />
</jbpm-configuration></programlisting>
</section>
<section id="fromaddressconfiguration">
<title>From address configuration</title>
- <para>The default value for the From address used in jPDL mails is <literal>jbpm@noreply</literal>.
- The from address of mails can be configured in the jBPM configuration file jbpm.xfg.xml with
- key 'jbpm.mail.from.address' like this:
+ <para>The default value for the From address used in jPDL mails is <literal>no-reply(a)jbpm.org</literal>.
+ The from address of mails can be configured in the configuration file jbpm.cfg.xml under
+ key <literal>jbpm.mail.from.address</literal>.
</para>
<programlisting><jbpm-configuration>
...
- <emphasis role="bold"><string name='jbpm.mail.from.address' value='jbpm(a)yourcompany.com' /></emphasis>
+ <string name='jbpm.mail.from.address' value='jbpm(a)yourcompany.com' />
</jbpm-configuration></programlisting>
</section>
@@ -246,23 +252,15 @@
This is an ActionHandler implementation. Whenever an mail is specified in the process xml, this will
result in a delegation to the mail class. It is possible to inherit from the Mail class and customize
certain behaviour for your perticular needs. To configure your class to be used for mail delegations,
- specify a 'jbpm.mail.class.name' configuration string in the jbpm.cfg.xml like this:
+ specify a 'jbpm.mail.class.name' configuration string in jbpm.cfg.xml like this:
</para>
<programlisting><jbpm-configuration>
...
- <emphasis role="bold"><string name='jbpm.mail.class.name' value='com.your.specific.CustomMail' /></emphasis>
+ <string name='jbpm.mail.class.name' value='com.your.specific.CustomMail' />
</jbpm-configuration></programlisting>
<para>The customized mail class will be read during parsing and actions will be configured in the
process that reference the configured (or the default) mail classname. So if you change the
property, all the processes that were already deployed will still refer to the old mail class name.
But they can be easily updated with one simple update statement to the jbpm database.</para>
</section>
-
- <section id="mailserver">
- <title>Mail server</title>
- <para>If you need a mailserver that is easy to install, checkout <ulink url="http://www.jboss.org/products/mailservices">JBossMail Server</ulink>
- or <ulink url="http://james.apache.org/">Apache James</ulink>
- </para>
- </section>
-
</chapter>
\ No newline at end of file
14 years
JBoss JBPM SVN: r6280 - jbpm3/branches/jbpm-3.2-soa/modules/core and 10 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-04-27 00:49:17 -0400 (Tue, 27 Apr 2010)
New Revision: 6280
Added:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/mail/MailTestSetup.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/perf/PerformanceTest.java
Removed:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/perf/SimplePerformanceTest.java
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/pom.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/jpdl/xml/JpdlXmlReader.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/mail/Mail.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2852/JBPM2852Test.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/mail/MailTest.java
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/resources/org/jbpm/jbpm2852/gpd.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2852/mail.templates.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2852/processdefinition.xml
jbpm3/branches/jbpm-3.2-soa/modules/examples/pom.xml
jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/java/org/jbpm/examples/mail/MailTest.java
jbpm3/branches/jbpm-3.2-soa/pom.xml
projects/jsf-console/branches/jsf-console-3.2-soa/pom.xml
projects/parent/trunk/pom.xml
Log:
JBPM-2852: test bcc addresses
switch to wiser for mail tests
migrate to nexus maven repo
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/pom.xml 2010-04-26 17:01:15 UTC (rev 6279)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/pom.xml 2010-04-27 04:49:17 UTC (rev 6280)
@@ -82,11 +82,6 @@
<!-- Test Dependencies -->
<dependency>
- <groupId>dumbster</groupId>
- <artifactId>dumbster</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<scope>test</scope>
@@ -96,6 +91,23 @@
<artifactId>hsqldb</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>net.sf.retrotranslator</groupId>
+ <artifactId>retrotranslator-runtime</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.subethamail</groupId>
+ <artifactId>subethasmtp-wiser</artifactId>
+ <classifier>java14</classifier>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.subethamail</groupId>
+ <artifactId>subethasmtp-smtp</artifactId>
+ <classifier>java14</classifier>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<!-- Plugins -->
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/jpdl/xml/JpdlXmlReader.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/jpdl/xml/JpdlXmlReader.java 2010-04-26 17:01:15 UTC (rev 6279)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/jpdl/xml/JpdlXmlReader.java 2010-04-27 04:49:17 UTC (rev 6280)
@@ -868,6 +868,20 @@
config.append("<cc>").append(cc).append("</cc>");
}
// cc - actors
+ String ccActors = element.attributeValue("cc-actors");
+ if (ccActors != null) {
+ config.append("<ccActors>").append(ccActors).append("</ccActors>");
+ }
+ // bcc - addresses
+ String bcc = element.attributeValue("cc");
+ if (bcc != null) {
+ config.append("<bcc>").append(bcc).append("</bcc>");
+ }
+ // bcc - actors
+ String bccActors = element.attributeValue("bcc-actors");
+ if (bccActors != null) {
+ config.append("<bccActors>").append(bccActors).append("</bccActors>");
+ }
// subject
String subject = getProperty("subject", element);
if (subject != null) {
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/mail/Mail.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/mail/Mail.java 2010-04-26 17:01:15 UTC (rev 6279)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/mail/Mail.java 2010-04-27 04:49:17 UTC (rev 6280)
@@ -363,19 +363,14 @@
addTemplateProperty(templateElement, "cc", templateProperties);
addTemplateProperty(templateElement, "cc-actors", templateProperties);
addTemplateProperty(templateElement, "bcc", templateProperties);
- addTemplateProperty(templateElement, "bcc-actors", templateProperties);
// preserve backwards compatibility with bccActors element
Element bccActorsElement = XmlUtil.element(templateElement, "bccActors");
if (bccActorsElement != null) {
- String bccActors = templateProperties.getProperty("bcc-actors");
- if (bccActors != null) {
- bccActors += ';' + XmlUtil.getContentText(bccActorsElement);
- }
- else {
- bccActors = XmlUtil.getContentText(bccActorsElement);
- }
- templateProperties.setProperty("bcc-actors", bccActors);
+ templateProperties.setProperty("bcc-actors", XmlUtil.getContentText(bccActorsElement));
}
+ else {
+ addTemplateProperty(templateElement, "bcc-actors", templateProperties);
+ }
templatePropertiesMap.put(templateElement.getAttribute("name"), templateProperties);
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2852/JBPM2852Test.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2852/JBPM2852Test.java 2010-04-26 17:01:15 UTC (rev 6279)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2852/JBPM2852Test.java 2010-04-27 04:49:17 UTC (rev 6280)
@@ -21,29 +21,41 @@
*/
package org.jbpm.jbpm2852;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.mail.MessagingException;
+import javax.mail.Message.RecipientType;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeMessage;
+
+import junit.framework.Test;
+
+import org.subethamail.wiser.Wiser;
+import org.subethamail.wiser.WiserMessage;
+
import org.jbpm.AbstractJbpmTestCase;
import org.jbpm.JbpmConfiguration;
import org.jbpm.JbpmContext;
import org.jbpm.context.exe.ContextInstance;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;
-import org.jbpm.mail.MailTest;
+import org.jbpm.mail.MailTestSetup;
-import com.dumbster.smtp.SimpleSmtpServer;
-import com.dumbster.smtp.SmtpMessage;
-
/**
* CC support in mail nodes and mail templates.
*
+ * @see <a href="https://jira.jboss.org/jira/browse/JBPM-2852">JBPM-2852</a>
* @author Alejandro Guizar
*/
public class JBPM2852Test extends AbstractJbpmTestCase {
private JbpmContext jbpmContext;
- private SimpleSmtpServer smtpServer;
private ProcessInstance processInstance;
private static JbpmConfiguration jbpmConfiguration = JbpmConfiguration.parseResource("org/jbpm/jbpm2852/jbpm.cfg.xml");
+ private static Wiser wiser;
protected void setUp() throws Exception {
super.setUp();
@@ -55,36 +67,55 @@
ContextInstance contextInstance = processInstance.getContextInstance();
contextInstance.setVariable("technician", "technician(a)example.com");
contextInstance.setVariable("supervisor", "supervisor(a)example.com");
+ contextInstance.setVariable("observer", "observer(a)example.com");
processInstance.signal();
-
- smtpServer = MailTest.startSmtpServer(2525);
}
protected void tearDown() throws Exception {
- smtpServer.stop();
+ wiser.getMessages().clear();
jbpmContext.close();
super.tearDown();
}
- public void testMailNodeInlineCC() {
+ public static Test suite() {
+ MailTestSetup testSetup = new MailTestSetup(JBPM2852Test.class);
+ wiser = testSetup.getWiser();
+ return testSetup;
+ }
+
+ public void testMailNodeInlineCC() throws MessagingException {
processInstance.signal("high");
assertEquals("alert", processInstance.getRootToken().getNode().getName());
- assertEquals(1, smtpServer.getReceivedEmailSize());
- SmtpMessage message = (SmtpMessage) smtpServer.getReceivedEmail().next();
- assertEquals("Reactor temperature exceeded threshold", message.getHeaderValue("Subject"));
- assertEquals("technician(a)example.com", message.getHeaderValue("To"));
- assertEquals("supervisor(a)example.com", message.getHeaderValue("Cc"));
+ List messages = wiser.getMessages();
+ assertEquals(3, messages.size());
+
+ for (Iterator iter = messages.iterator(); iter.hasNext();) {
+ WiserMessage wiserMessage = (WiserMessage) iter.next();
+ MimeMessage message = wiserMessage.getMimeMessage();
+ assertEquals("Reactor temperature exceeded threshold", message.getSubject());
+ assert Arrays.equals(InternetAddress.parse("technician(a)example.com"), message.getRecipients(RecipientType.TO));
+ assert Arrays.equals(InternetAddress.parse("supervisor(a)example.com"), message.getRecipients(RecipientType.CC));
+ // bcc recipients undisclosed
+ assertNull(message.getRecipients(RecipientType.BCC));
+ }
}
- public void testMailActionTemplateCC() {
+ public void testMailActionTemplateCC() throws MessagingException {
processInstance.signal("normal");
assertEquals("ok", processInstance.getRootToken().getNode().getName());
- assertEquals(1, smtpServer.getReceivedEmailSize());
- SmtpMessage message = (SmtpMessage) smtpServer.getReceivedEmail().next();
- assertEquals("Reactor temperature normal", message.getHeaderValue("Subject"));
- assertEquals("technician(a)example.com", message.getHeaderValue("To"));
- assertEquals("supervisor(a)example.com", message.getHeaderValue("Cc"));
+ List messages = wiser.getMessages();
+ assertEquals(3, messages.size());
+
+ for (Iterator iter = messages.iterator(); iter.hasNext();) {
+ WiserMessage wiserMessage = (WiserMessage) iter.next();
+ MimeMessage message = wiserMessage.getMimeMessage();
+ assertEquals("Reactor temperature normal", message.getSubject());
+ assert Arrays.equals(InternetAddress.parse("technician(a)example.com"), message.getRecipients(RecipientType.TO));
+ assert Arrays.equals(InternetAddress.parse("supervisor(a)example.com"), message.getRecipients(RecipientType.CC));
+ // bcc recipients undisclosed
+ assertNull(message.getRecipients(RecipientType.BCC));
+ }
}
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/mail/MailTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/mail/MailTest.java 2010-04-26 17:01:15 UTC (rev 6279)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/mail/MailTest.java 2010-04-27 04:49:17 UTC (rev 6280)
@@ -1,8 +1,19 @@
package org.jbpm.mail;
+import java.io.IOException;
import java.util.Arrays;
-import java.util.Iterator;
+import java.util.List;
+import javax.mail.MessagingException;
+import javax.mail.Message.RecipientType;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeMessage;
+
+import junit.framework.Test;
+
+import org.subethamail.wiser.Wiser;
+import org.subethamail.wiser.WiserMessage;
+
import org.jbpm.AbstractJbpmTestCase;
import org.jbpm.JbpmConfiguration;
import org.jbpm.JbpmContext;
@@ -11,13 +22,10 @@
import org.jbpm.taskmgmt.def.Swimlane;
import org.jbpm.taskmgmt.exe.SwimlaneInstance;
-import com.dumbster.smtp.SimpleSmtpServer;
-import com.dumbster.smtp.SmtpMessage;
-
public class MailTest extends AbstractJbpmTestCase {
- private SimpleSmtpServer smtpServer;
private JbpmContext jbpmContext;
+
private static final String XML_DECL = "<?xml version='1.0'?>";
private static JbpmConfiguration jbpmConfiguration = JbpmConfiguration.parseXmlString(XML_DECL
@@ -29,44 +37,26 @@
+ "' singleton='true' />"
+ "</jbpm-configuration>");
- public static SimpleSmtpServer startSmtpServer(int port) {
- /*
- * SimpleSmtpServer.start(int) blocks the calling thread until the server socket is created.
- * If the socket is created too quickly (seems to happen on Linux and Mac) then the
- * notification is sent too early and the calling thread blocks forever.
- *
- * The code below corresponds to SimpleSmtpServer.start(int) except that the thread is
- * started inside of the synchronized block.
- */
- SimpleSmtpServer server = new SimpleSmtpServer(port);
- Thread serverThread = new Thread(server);
+ private static Wiser wiser;
- // Block until the server socket is created
- synchronized (server) {
- serverThread.start();
- try {
- server.wait(10 * 1000);
- }
- catch (InterruptedException e) {
- // Ignore don't care.
- }
- }
- return server;
- }
-
protected void setUp() throws Exception {
super.setUp();
jbpmContext = jbpmConfiguration.createJbpmContext();
- smtpServer = startSmtpServer(2525);
}
protected void tearDown() throws Exception {
- smtpServer.stop();
+ wiser.getMessages().clear();
jbpmContext.close();
super.tearDown();
}
- public void testWithoutAddressResolving() {
+ public static Test suite() {
+ MailTestSetup testSetup = new MailTestSetup(MailTest.class);
+ wiser = testSetup.getWiser();
+ return testSetup;
+ }
+
+ public void testWithoutAddressResolving() throws MessagingException, IOException {
String to = "sample.shipper(a)example.domain";
String subject = "latest news";
String text = "roy is assurancetourix";
@@ -74,16 +64,17 @@
Mail mail = new Mail(null, null, to, subject, text);
mail.send();
- assertEquals(1, smtpServer.getReceivedEmailSize());
- Iterator emailIter = smtpServer.getReceivedEmail();
+ List messages = wiser.getMessages();
+ assertEquals(1, messages.size());
- SmtpMessage email = (SmtpMessage) emailIter.next();
- assertEquals("latest news", email.getHeaderValue("Subject"));
- assertEquals("roy is assurancetourix", email.getBody());
- assertEquals("sample.shipper(a)example.domain", email.getHeaderValue("To"));
+ WiserMessage message = (WiserMessage) messages.get(0);
+ MimeMessage email = message.getMimeMessage();
+ assertEquals("latest news", email.getSubject());
+ assertEquals("roy is assurancetourix", email.getContent());
+ assert Arrays.equals(InternetAddress.parse("sample.shipper(a)example.domain"), email.getRecipients(RecipientType.TO));
}
- public void testMailWithAddressResolving() {
+ public void testMailWithAddressResolving() throws MessagingException, IOException {
String actors = "manager";
String subject = "latest news";
String text = "roy is assurancetourix";
@@ -91,16 +82,17 @@
Mail mail = new Mail(null, actors, null, subject, text);
mail.send();
- assertEquals(1, smtpServer.getReceivedEmailSize());
- Iterator emailIter = smtpServer.getReceivedEmail();
+ List messages = wiser.getMessages();
+ assertEquals(1, messages.size());
- SmtpMessage email = (SmtpMessage) emailIter.next();
- assertEquals("latest news", email.getHeaderValue("Subject"));
- assertEquals("roy is assurancetourix", email.getBody());
- assertEquals("manager(a)example.domain", email.getHeaderValue("To"));
+ WiserMessage message = (WiserMessage) messages.get(0);
+ MimeMessage email = message.getMimeMessage();
+ assertEquals("latest news", email.getSubject());
+ assertEquals("roy is assurancetourix", email.getContent());
+ assert Arrays.equals(InternetAddress.parse("manager(a)example.domain"), email.getRecipients(RecipientType.TO));
}
- public void testMailWithBccAddress() {
+ public void testMailWithBccAddress() throws MessagingException, IOException {
String bcc = "bcc(a)example.domain";
String subject = "latest news";
String text = "roy is assurancetourix";
@@ -108,16 +100,17 @@
Mail mail = new Mail(null, null, null, null, bcc, subject, text);
mail.send();
- assertEquals(1, smtpServer.getReceivedEmailSize());
- Iterator emailIter = smtpServer.getReceivedEmail();
+ List messages = wiser.getMessages();
+ assertEquals(1, messages.size());
- SmtpMessage email = (SmtpMessage) emailIter.next();
- assertEquals("latest news", email.getHeaderValue("Subject"));
- assertEquals("roy is assurancetourix", email.getBody());
- assertNull(email.getHeaderValue("To"));
+ WiserMessage message = (WiserMessage) messages.get(0);
+ MimeMessage email = message.getMimeMessage();
+ assertEquals("latest news", email.getSubject());
+ assertEquals("roy is assurancetourix", email.getContent());
+ assertNull(email.getRecipients(RecipientType.TO));
}
- public void testMailNodeAttributes() {
+ public void testMailNodeAttributes() throws MessagingException, IOException {
ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(XML_DECL
+ "<process-definition>"
+ " <start-state>"
@@ -131,16 +124,17 @@
ProcessInstance processInstance = new ProcessInstance(processDefinition);
processInstance.signal();
- assertEquals(1, smtpServer.getReceivedEmailSize());
- Iterator emailIter = smtpServer.getReceivedEmail();
+ List messages = wiser.getMessages();
+ assertEquals(1, messages.size());
- SmtpMessage email = (SmtpMessage) emailIter.next();
- assertEquals("readmylips", email.getHeaderValue("Subject"));
- assertEquals("nomoretaxes", email.getBody());
- assertEquals("george(a)example.domain", email.getHeaderValue("To"));
+ WiserMessage message = (WiserMessage) messages.get(0);
+ MimeMessage email = message.getMimeMessage();
+ assertEquals("readmylips", email.getSubject());
+ assertEquals("nomoretaxes", email.getContent());
+ assert Arrays.equals(InternetAddress.parse("george(a)example.domain"), email.getRecipients(RecipientType.TO));
}
- public void testMailNodeElements() {
+ public void testMailNodeElements() throws MessagingException, IOException {
ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(XML_DECL
+ "<process-definition>"
+ " <start-state>"
@@ -156,16 +150,17 @@
ProcessInstance processInstance = new ProcessInstance(processDefinition);
processInstance.signal();
- assertEquals(1, smtpServer.getReceivedEmailSize());
- Iterator emailIter = smtpServer.getReceivedEmail();
+ List messages = wiser.getMessages();
+ assertEquals(1, messages.size());
- SmtpMessage email = (SmtpMessage) emailIter.next();
- assertEquals("readmylips", email.getHeaderValue("Subject"));
- assertEquals("nomoretaxes", email.getBody());
- assertEquals("george(a)example.domain", email.getHeaderValue("To"));
+ WiserMessage message = (WiserMessage) messages.get(0);
+ MimeMessage email = message.getMimeMessage();
+ assertEquals("readmylips", email.getSubject());
+ assertEquals("nomoretaxes", email.getContent());
+ assert Arrays.equals(InternetAddress.parse("george(a)example.domain"), email.getRecipients(RecipientType.TO));
}
- public void testMailActionAttributes() {
+ public void testMailActionAttributes() throws MessagingException, IOException {
ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(XML_DECL
+ "<process-definition>"
+ " <start-state>"
@@ -178,16 +173,17 @@
ProcessInstance processInstance = new ProcessInstance(processDefinition);
processInstance.signal();
- assertEquals(1, smtpServer.getReceivedEmailSize());
- Iterator emailIter = smtpServer.getReceivedEmail();
+ List messages = wiser.getMessages();
+ assertEquals(1, messages.size());
- SmtpMessage email = (SmtpMessage) emailIter.next();
- assertEquals("readmylips", email.getHeaderValue("Subject"));
- assertEquals("nomoretaxes", email.getBody());
- assertEquals("george(a)example.domain", email.getHeaderValue("To"));
+ WiserMessage message = (WiserMessage) messages.get(0);
+ MimeMessage email = message.getMimeMessage();
+ assertEquals("readmylips", email.getSubject());
+ assertEquals("nomoretaxes", email.getContent());
+ assert Arrays.equals(InternetAddress.parse("george(a)example.domain"), email.getRecipients(RecipientType.TO));
}
- public void testMailActionElements() {
+ public void testMailActionElements() throws MessagingException, IOException {
ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(XML_DECL
+ "<process-definition>"
+ " <start-state>"
@@ -204,16 +200,17 @@
ProcessInstance processInstance = new ProcessInstance(processDefinition);
processInstance.signal();
- assertEquals(1, smtpServer.getReceivedEmailSize());
- Iterator emailIter = smtpServer.getReceivedEmail();
+ List messages = wiser.getMessages();
+ assertEquals(1, messages.size());
- SmtpMessage email = (SmtpMessage) emailIter.next();
- assertEquals("readmylips", email.getHeaderValue("Subject"));
- assertEquals("nomoretaxes", email.getBody());
- assertEquals("george(a)example.domain", email.getHeaderValue("To"));
+ WiserMessage message = (WiserMessage) messages.get(0);
+ MimeMessage email = message.getMimeMessage();
+ assertEquals("readmylips", email.getSubject());
+ assertEquals("nomoretaxes", email.getContent());
+ assert Arrays.equals(InternetAddress.parse("george(a)example.domain"), email.getRecipients(RecipientType.TO));
}
- public void testMultipleRecipients() {
+ public void testMultipleRecipients() throws MessagingException, IOException {
ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(XML_DECL
+ "<process-definition>"
+ " <start-state>"
@@ -227,20 +224,18 @@
ProcessInstance processInstance = new ProcessInstance(processDefinition);
processInstance.signal();
- assertEquals(1, smtpServer.getReceivedEmailSize());
- Iterator emailIter = smtpServer.getReceivedEmail();
+ List messages = wiser.getMessages();
+ assertEquals(3, messages.size());
- SmtpMessage email = (SmtpMessage) emailIter.next();
- assertEquals("readmylips", email.getHeaderValue("Subject"));
- assertEquals("nomoretaxes", email.getBody());
- String[] expectedTo = {
- "george(a)example.domain", "barbara(a)example.domain", "suzy(a)example.domain"
- };
- String[] to = email.getHeaderValues("To");
- assert Arrays.equals(expectedTo, to) : Arrays.asList(to);
+ WiserMessage message = (WiserMessage) messages.get(0);
+ MimeMessage email = message.getMimeMessage();
+ assertEquals("readmylips", email.getSubject());
+ assertEquals("nomoretaxes", email.getContent());
+ InternetAddress[] expectedTo = InternetAddress.parse("george(a)example.domain, barbara(a)example.domain, suzy(a)example.domain");
+ assert Arrays.equals(expectedTo, email.getRecipients(RecipientType.TO));
}
- public void testMailWithoutAddressResolving() {
+ public void testMailWithoutAddressResolving() throws MessagingException, IOException {
ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(XML_DECL
+ "<process-definition>"
+ " <start-state>"
@@ -254,18 +249,18 @@
ProcessInstance processInstance = new ProcessInstance(processDefinition);
processInstance.signal();
- assertEquals(1, smtpServer.getReceivedEmailSize());
- Iterator emailIter = smtpServer.getReceivedEmail();
+ List messages = wiser.getMessages();
+ assertEquals(2, messages.size());
- SmtpMessage email = (SmtpMessage) emailIter.next();
- String[] expectedTo = {
- "george(a)humpydumpy.gov", "spiderman(a)hollywood.ca.us"
- };
- String[] to = email.getHeaderValues("To");
- assert Arrays.equals(expectedTo, to) : Arrays.asList(to);
+ WiserMessage message = (WiserMessage) messages.get(0);
+ MimeMessage email = message.getMimeMessage();
+ assertEquals("readmylips", email.getSubject());
+ assertEquals("nomoretaxes", email.getContent());
+ InternetAddress[] expectedTo = InternetAddress.parse("george(a)humpydumpy.gov, spiderman(a)hollywood.ca.us");
+ assert Arrays.equals(expectedTo, email.getRecipients(RecipientType.TO));
}
- public void testToVariableExpression() {
+ public void testToVariableExpression() throws MessagingException {
ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(XML_DECL
+ "<process-definition>"
+ " <start-state>"
@@ -282,14 +277,15 @@
processInstance.getContextInstance().setVariable("user", mrNobody);
processInstance.signal();
- assertEquals(1, smtpServer.getReceivedEmailSize());
- Iterator emailIter = smtpServer.getReceivedEmail();
+ List messages = wiser.getMessages();
+ assertEquals(1, messages.size());
- SmtpMessage email = (SmtpMessage) emailIter.next();
- assertEquals("hucklebuck(a)example.domain", email.getHeaderValue("To"));
+ WiserMessage message = (WiserMessage) messages.get(0);
+ MimeMessage email = message.getMimeMessage();
+ assert Arrays.equals(InternetAddress.parse("hucklebuck(a)example.domain"), email.getRecipients(RecipientType.TO));
}
- public void testToSwimlaneExpression() {
+ public void testToSwimlaneExpression() throws MessagingException {
ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(XML_DECL
+ "<process-definition>"
+ " <start-state>"
@@ -300,21 +296,22 @@
+ " <end-state name='end' />"
+ "</process-definition>");
- ProcessInstance processInstance = new ProcessInstance(processDefinition);
- Swimlane initiator = new Swimlane("initiator");
- SwimlaneInstance initiatorInstance = new SwimlaneInstance(initiator);
+ SwimlaneInstance initiatorInstance = new SwimlaneInstance(new Swimlane("initiator"));
initiatorInstance.setActorId("huckelberry");
+
+ ProcessInstance processInstance = new ProcessInstance(processDefinition);
processInstance.getTaskMgmtInstance().addSwimlaneInstance(initiatorInstance);
processInstance.signal();
- assertEquals(1, smtpServer.getReceivedEmailSize());
- Iterator emailIter = smtpServer.getReceivedEmail();
+ List messages = wiser.getMessages();
+ assertEquals(1, messages.size());
- SmtpMessage email = (SmtpMessage) emailIter.next();
- assertEquals("huckelberry(a)example.domain", email.getHeaderValue("To"));
+ WiserMessage message = (WiserMessage) messages.get(0);
+ MimeMessage email = message.getMimeMessage();
+ assert Arrays.equals(InternetAddress.parse("huckelberry(a)example.domain"), email.getRecipients(RecipientType.TO));
}
- public void testSubjectExpression() {
+ public void testSubjectExpression() throws MessagingException {
ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(XML_DECL
+ "<process-definition>"
+ " <start-state>"
@@ -329,14 +326,15 @@
processInstance.getContextInstance().setVariable("item", "cookies");
processInstance.signal();
- assertEquals(1, smtpServer.getReceivedEmailSize());
- Iterator emailIter = smtpServer.getReceivedEmail();
+ List messages = wiser.getMessages();
+ assertEquals(1, messages.size());
- SmtpMessage email = (SmtpMessage) emailIter.next();
- assertEquals("your cookies order", email.getHeaderValue("Subject"));
+ WiserMessage message = (WiserMessage) messages.get(0);
+ MimeMessage email = message.getMimeMessage();
+ assertEquals("your cookies order", email.getSubject());
}
- public void testTextExpression() {
+ public void testTextExpression() throws IOException, MessagingException {
ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(XML_DECL
+ "<process-definition>"
+ " <start-state>"
@@ -351,11 +349,12 @@
processInstance.getContextInstance().setVariable("item", "cookies");
processInstance.signal();
- assertEquals(1, smtpServer.getReceivedEmailSize());
- Iterator emailIter = smtpServer.getReceivedEmail();
+ List messages = wiser.getMessages();
+ assertEquals(1, messages.size());
- SmtpMessage email = (SmtpMessage) emailIter.next();
- assertEquals("your cookies order", email.getBody());
+ WiserMessage message = (WiserMessage) messages.get(0);
+ MimeMessage email = message.getMimeMessage();
+ assertEquals("your cookies order", email.getContent());
}
public static class User {
Added: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/mail/MailTestSetup.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/mail/MailTestSetup.java (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/mail/MailTestSetup.java 2010-04-27 04:49:17 UTC (rev 6280)
@@ -0,0 +1,54 @@
+/*
+ * 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.subethamail.wiser.Wiser;
+
+import junit.extensions.TestSetup;
+import junit.framework.TestSuite;
+
+public class MailTestSetup extends TestSetup {
+
+ private Wiser wiser = new Wiser();
+
+ public MailTestSetup(Class testClass) {
+ super(new TestSuite(testClass));
+ }
+
+ public Wiser getWiser() {
+ return wiser;
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ wiser.setPort(2525);
+ wiser.start();
+ }
+
+ protected void tearDown() throws Exception {
+ wiser.stop();
+ wiser = null;
+
+ super.tearDown();
+ }
+}
\ No newline at end of file
Property changes on: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/mail/MailTestSetup.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
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-04-26 17:01:15 UTC (rev 6279)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/mail/TaskMailTest.java 2010-04-27 04:49:17 UTC (rev 6280)
@@ -1,9 +1,20 @@
package org.jbpm.mail;
+import java.io.IOException;
import java.util.ArrayList;
-import java.util.Iterator;
+import java.util.Arrays;
import java.util.List;
+import javax.mail.MessagingException;
+import javax.mail.Message.RecipientType;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeMessage;
+
+import junit.framework.Test;
+
+import org.subethamail.wiser.Wiser;
+import org.subethamail.wiser.WiserMessage;
+
import org.jbpm.AbstractJbpmTestCase;
import org.jbpm.JbpmConfiguration;
import org.jbpm.JbpmContext;
@@ -22,13 +33,9 @@
import org.jbpm.taskmgmt.exe.TaskInstance;
import org.jbpm.taskmgmt.exe.TaskMgmtInstance;
-import com.dumbster.smtp.SimpleSmtpServer;
-import com.dumbster.smtp.SmtpMessage;
-
public class TaskMailTest extends AbstractJbpmTestCase {
private JbpmContext jbpmContext;
- private SimpleSmtpServer smtpServer;
private static JbpmConfiguration jbpmConfiguration = JbpmConfiguration.parseXmlString("<jbpm-configuration>"
+ " <jbpm-context>"
@@ -42,14 +49,15 @@
+ "' singleton='true' />"
+ "</jbpm-configuration>");
+ private static Wiser wiser;
+
protected void setUp() throws Exception {
super.setUp();
jbpmContext = jbpmConfiguration.createJbpmContext();
- smtpServer = MailTest.startSmtpServer(2525);
}
protected void tearDown() throws Exception {
- smtpServer.stop();
+ wiser.getMessages().clear();
TestSchedulerService testSchedulerService = (TestSchedulerService) jbpmContext.getServiceFactory(Services.SERVICENAME_SCHEDULER);
testSchedulerService.reset();
@@ -58,6 +66,12 @@
super.tearDown();
}
+ public static Test suite() {
+ MailTestSetup testSetup = new MailTestSetup(TaskMailTest.class);
+ wiser = testSetup.getWiser();
+ return testSetup;
+ }
+
public static class RoundRobinAssigner implements AssignmentHandler {
private static final long serialVersionUID = 1L;
@@ -67,7 +81,7 @@
}
}
- public void testTaskInstanceNotification() {
+ public void testTaskInstanceNotification() throws IOException, MessagingException {
ProcessDefinition processDefinition = ProcessDefinition.parseXmlString("<process-definition>"
+ " <start-state>"
+ " <transition to='a' />"
@@ -85,16 +99,18 @@
ProcessInstance processInstance = new ProcessInstance(processDefinition);
processInstance.signal();
- assertTrue(smtpServer.getReceivedEmailSize() == 1);
- Iterator emailIter = smtpServer.getReceivedEmail();
- SmtpMessage email = (SmtpMessage) emailIter.next();
- emailIter.remove();
+ List messages = wiser.getMessages();
+ assertEquals(1, messages.size());
- assertEquals("you(a)example.domain", email.getHeaderValue("To"));
- assertEquals("Task 'laundry'", email.getHeaderValue("Subject"));
+ 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());
// just to make sure that all expressions were resolved
- assertEquals(-1, email.getBody().indexOf("#{"));
- assertTrue(-1 != email.getBody().indexOf("http://localhost:8080/jbpm/home?taskId=0"));
+ String content = (String) email.getContent();
+ assertEquals(-1, content.indexOf("#{"));
+ assertTrue(content.indexOf("http://localhost:8080/jbpm/home?taskId=0") != -1);
}
public static class TestSchedulerService implements SchedulerService, ServiceFactory {
@@ -150,7 +166,7 @@
ProcessInstance processInstance = new ProcessInstance(processDefinition);
processInstance.signal();
- assertTrue(smtpServer.getReceivedEmailSize() == 0);
+ assertEquals(0, wiser.getMessages().size());
TestSchedulerService testSchedulerService = (TestSchedulerService) jbpmContext.getServices()
.getService("scheduler");
@@ -162,16 +178,18 @@
createdTimer.execute(jbpmContext);
- assertTrue(smtpServer.getReceivedEmailSize() == 1);
- Iterator emailIter = smtpServer.getReceivedEmail();
- SmtpMessage email = (SmtpMessage) emailIter.next();
- emailIter.remove();
+ List messages = wiser.getMessages();
+ assertEquals(1, messages.size());
- assertEquals("you(a)example.domain", email.getHeaderValue("To"));
- assertEquals("Task 'laundry' !", email.getHeaderValue("Subject"));
+ 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());
// just to make sure that all expressions were resolved
- assertEquals(-1, email.getBody().indexOf("#{"));
- assertTrue(-1 != email.getBody().indexOf("http://localhost:8080/jbpm/home?taskId=0"));
+ String content = (String) email.getContent();
+ assertEquals(-1, content.indexOf("#{"));
+ assertTrue(content.indexOf("http://localhost:8080/jbpm/home?taskId=0") != -1);
TaskMgmtInstance taskMgmtInstance = processInstance.getTaskMgmtInstance();
TaskInstance taskInstance = (TaskInstance) taskMgmtInstance.getTaskInstances()
@@ -209,7 +227,7 @@
ProcessInstance processInstance = new ProcessInstance(processDefinition);
processInstance.signal();
- assertEquals(0, smtpServer.getReceivedEmailSize());
+ assertEquals(0, wiser.getMessages().size());
TaskMgmtInstance taskMgmtInstance = processInstance.getTaskMgmtInstance();
TaskInstance taskInstance = (TaskInstance) taskMgmtInstance.getTaskInstances()
@@ -221,6 +239,6 @@
assertEquals("ghost", taskInstance.getActorId());
taskInstance.end();
- assertEquals(0, smtpServer.getReceivedEmailSize());
+ assertEquals(0, wiser.getMessages().size());
}
}
Copied: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/perf/PerformanceTest.java (from rev 6262, jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/perf/SimplePerformanceTest.java)
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/perf/PerformanceTest.java (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/perf/PerformanceTest.java 2010-04-27 04:49:17 UTC (rev 6280)
@@ -0,0 +1,91 @@
+/*
+ * 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.perf;
+
+import org.jbpm.db.AbstractDbTestCase;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ProcessInstance;
+
+/**
+ * This test creates a number of process instances. Every instance has a call to
+ * an ActionHandler.
+ *
+ * @see <a href="https://jira.jboss.org/jira/browse/JBPM-2043">JBPM-2043</a>
+ * @author mvecera(a)redhat.com
+ * @author pmacik(a)redhat.com
+ * @author Alejandro Guizar
+ * @since 18-Feb-2009
+ */
+public class PerformanceTest extends AbstractDbTestCase {
+
+ private static final int WARMUP_INSTANCES = 100;
+ private static final int MEASURED_INSTANCES = 1000;
+ private static final long TIMEOUT = 2 * 60 * 1000;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlString("<process-definition name='jbpm2043'>"
+ + " <start-state name='start'>"
+ + " <transition to='midway'/>"
+ + " </start-state>"
+ + " <node name='midway' async='true'>"
+ + " <transition to='end'/>"
+ + " </node>"
+ + " <end-state name='end'/>"
+ + "</process-definition>");
+ deployProcessDefinition(processDefinition);
+ }
+
+ public void testAsyncCall() {
+ Runtime rt = Runtime.getRuntime();
+ System.out.print("Free memory: ");
+ System.out.println(rt.freeMemory());
+ System.out.print("Total memory: ");
+ System.out.println(rt.totalMemory());
+ System.out.print("Max memory: ");
+ System.out.println(rt.maxMemory());
+ System.out.print("Processors: ");
+ System.out.println(rt.availableProcessors());
+
+ long firstTime = System.currentTimeMillis();
+ launchProcessInstances(WARMUP_INSTANCES);
+ processJobs(TIMEOUT);
+
+ long secondTime = System.currentTimeMillis();
+ launchProcessInstances(MEASURED_INSTANCES);
+ processJobs((secondTime - firstTime) * (MEASURED_INSTANCES / WARMUP_INSTANCES + 1));
+
+ long duration = System.currentTimeMillis() - secondTime;
+ System.out.println("### Processed "
+ + (1000 * MEASURED_INSTANCES / duration)
+ + " instances per second ###");
+ }
+
+ private void launchProcessInstances(int count) {
+ for (int i = 0; i < count; i++) {
+ ProcessInstance processInstance = jbpmContext.newProcessInstanceForUpdate("jbpm2043");
+ processInstance.signal();
+ newTransaction();
+ }
+ }
+}
Deleted: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/perf/SimplePerformanceTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/perf/SimplePerformanceTest.java 2010-04-26 17:01:15 UTC (rev 6279)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/perf/SimplePerformanceTest.java 2010-04-27 04:49:17 UTC (rev 6280)
@@ -1,91 +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.perf;
-
-import org.jbpm.db.AbstractDbTestCase;
-import org.jbpm.graph.def.ProcessDefinition;
-import org.jbpm.graph.exe.ProcessInstance;
-
-/**
- * This test creates a number of process instances. Every instance has a call to
- * an ActionHandler.
- *
- * @see <a href="https://jira.jboss.org/jira/browse/JBPM-2043">JBPM-2043</a>
- * @author mvecera(a)redhat.com
- * @author pmacik(a)redhat.com
- * @author Alejandro Guizar
- * @since 18-Feb-2009
- */
-public class SimplePerformanceTest extends AbstractDbTestCase {
-
- private static final int WARMUP_INSTANCES = 100;
- private static final int MEASURED_INSTANCES = 1000;
- private static final long TIMEOUT = 2 * 60 * 1000;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- ProcessDefinition processDefinition = ProcessDefinition.parseXmlString("<process-definition name='jbpm2043'>"
- + " <start-state name='start'>"
- + " <transition to='midway'/>"
- + " </start-state>"
- + " <node name='midway' async='true'>"
- + " <transition to='end'/>"
- + " </node>"
- + " <end-state name='end'/>"
- + "</process-definition>");
- deployProcessDefinition(processDefinition);
- }
-
- public void testAsyncCall() {
- Runtime rt = Runtime.getRuntime();
- System.out.print("Free memory: ");
- System.out.println(rt.freeMemory());
- System.out.print("Total memory: ");
- System.out.println(rt.totalMemory());
- System.out.print("Max memory: ");
- System.out.println(rt.maxMemory());
- System.out.print("Processors: ");
- System.out.println(rt.availableProcessors());
-
- long firstTime = System.currentTimeMillis();
- launchProcessInstances(WARMUP_INSTANCES);
- processJobs(TIMEOUT);
-
- long secondTime = System.currentTimeMillis();
- launchProcessInstances(MEASURED_INSTANCES);
- processJobs((secondTime - firstTime) * (MEASURED_INSTANCES / WARMUP_INSTANCES + 1));
-
- long duration = System.currentTimeMillis() - secondTime;
- System.out.println("### Processed "
- + (1000 * MEASURED_INSTANCES / duration)
- + " instances per second ###");
- }
-
- private void launchProcessInstances(int count) {
- for (int i = 0; i < count; i++) {
- ProcessInstance processInstance = jbpmContext.newProcessInstanceForUpdate("jbpm2043");
- processInstance.signal();
- newTransaction();
- }
- }
-}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2852/gpd.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2852/gpd.xml 2010-04-26 17:01:15 UTC (rev 6279)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2852/gpd.xml 2010-04-27 04:49:17 UTC (rev 6280)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<root-container name="jbpm2852" width="788" height="568">
+<root-container name="jbpm2852" width="788" height="574">
<node name="start" x="36" y="36" width="121" height="37">
<edge>
<label x="5" y="-10"/>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2852/mail.templates.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2852/mail.templates.xml 2010-04-26 17:01:15 UTC (rev 6279)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2852/mail.templates.xml 2010-04-27 04:49:17 UTC (rev 6280)
@@ -3,6 +3,7 @@
<mail-template name='a-ok'>
<to>${technician}</to>
<cc>${supervisor}</cc>
+ <bcc>${observer}</bcc>
<subject>Reactor temperature normal</subject>
<text><![CDATA[Keep up the good work!]]></text>
</mail-template>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2852/processdefinition.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2852/processdefinition.xml 2010-04-26 17:01:15 UTC (rev 6279)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2852/processdefinition.xml 2010-04-27 04:49:17 UTC (rev 6280)
@@ -13,7 +13,7 @@
</transition>
</state>
- <mail-node name="contact technician" to="${technician}" cc="${supervisor}">
+ <mail-node name="contact technician" to="${technician}" cc="${supervisor}" bcc="${observer}">
<subject>Reactor temperature exceeded threshold</subject>
<text>Act fast! We do not want another Chernobyl.</text>
<transition to="alert" />
Modified: jbpm3/branches/jbpm-3.2-soa/modules/examples/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/examples/pom.xml 2010-04-26 17:01:15 UTC (rev 6279)
+++ jbpm3/branches/jbpm-3.2-soa/modules/examples/pom.xml 2010-04-27 04:49:17 UTC (rev 6280)
@@ -74,10 +74,22 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>dumbster</groupId>
- <artifactId>dumbster</artifactId>
- <scope>test</scope>
+ <groupId>net.sf.retrotranslator</groupId>
+ <artifactId>retrotranslator-runtime</artifactId>
+ <scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.subethamail</groupId>
+ <artifactId>subethasmtp-smtp</artifactId>
+ <classifier>java14</classifier>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.subethamail</groupId>
+ <artifactId>subethasmtp-wiser</artifactId>
+ <classifier>java14</classifier>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<!-- Plugins -->
Modified: jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/java/org/jbpm/examples/mail/MailTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/java/org/jbpm/examples/mail/MailTest.java 2010-04-26 17:01:15 UTC (rev 6279)
+++ jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/java/org/jbpm/examples/mail/MailTest.java 2010-04-27 04:49:17 UTC (rev 6280)
@@ -21,6 +21,17 @@
*/
package org.jbpm.examples.mail;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.mail.MessagingException;
+import javax.mail.Message.RecipientType;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeMessage;
+
+import org.subethamail.wiser.Wiser;
+import org.subethamail.wiser.WiserMessage;
+
import org.jbpm.AbstractJbpmTestCase;
import org.jbpm.JbpmConfiguration;
import org.jbpm.JbpmContext;
@@ -28,61 +39,37 @@
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.mail.AddressResolver;
-import com.dumbster.smtp.SimpleSmtpServer;
-import com.dumbster.smtp.SmtpMessage;
-
public class MailTest extends AbstractJbpmTestCase {
private JbpmContext jbpmContext;
- private SimpleSmtpServer smtpServer;
+ private Wiser wiser = new Wiser();
private static JbpmConfiguration jbpmConfiguration = JbpmConfiguration.parseResource("mail/jbpm.cfg.xml");
protected void setUp() throws Exception {
super.setUp();
jbpmContext = jbpmConfiguration.createJbpmContext();
- smtpServer = startSmtpServer(2525);
+ wiser.setPort(2525);
+ wiser.start();
}
protected void tearDown() throws Exception {
- smtpServer.stop();
+ wiser.stop();
jbpmContext.close();
super.tearDown();
}
- public void testSimpleProcess() throws Exception {
+ public void testSimpleProcess() throws MessagingException {
ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("mail/processdefinition.xml");
ProcessInstance processInstance = new ProcessInstance(processDefinition);
processInstance.signal();
- assertEquals(1, smtpServer.getReceivedEmailSize());
- SmtpMessage smtpMessage = (SmtpMessage) smtpServer.getReceivedEmail().next();
- assertEquals("grandma(a)dalton.com", smtpMessage.getHeaderValue("To"));
- }
+ List messages = wiser.getMessages();
+ assertEquals(1, messages.size());
- static SimpleSmtpServer startSmtpServer(int port) {
- /*
- * SimpleSmtpServer.start(int) blocks the calling thread until the server socket is created.
- * If the socket is created too quickly (happens on Linux and Mac) then the notification is
- * sent too early and the calling thread blocks forever.
- *
- * The code below corresponds to SimpleSmtpServer.start(int) except that the thread is
- * started inside of the synchronized block.
- */
- SimpleSmtpServer server = new SimpleSmtpServer(port);
- Thread serverThread = new Thread(server);
-
- // Block until the server socket is created
- synchronized (server) {
- serverThread.start();
- try {
- server.wait(10 * 1000);
- }
- catch (InterruptedException e) {
- // Ignore don't care.
- }
- }
- return server;
+ WiserMessage message = (WiserMessage) messages.get(0);
+ MimeMessage email = message.getMimeMessage();
+ assert Arrays.equals(InternetAddress.parse("grandma(a)dalton.com"), email.getRecipients(RecipientType.TO));
}
public static class MyAddressResolver implements AddressResolver {
Modified: jbpm3/branches/jbpm-3.2-soa/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/pom.xml 2010-04-26 17:01:15 UTC (rev 6279)
+++ jbpm3/branches/jbpm-3.2-soa/pom.xml 2010-04-27 04:49:17 UTC (rev 6280)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-parent</artifactId>
- <version>1.0.2</version>
+ <version>1.0.3-SNAPSHOT</version>
</parent>
<!-- Modules -->
@@ -47,12 +47,11 @@
<desmoj.version>2.1.1</desmoj.version>
<dom4j.version>1.6.1</dom4j.version>
<drools.version>4.0.7</drools.version>
- <dumbster.version>1.6</dumbster.version>
<hibernate.version>3.2.4.sp1</hibernate.version>
<jackrabbit.version>1.4.5</jackrabbit.version>
<jasper.reports.version>3.5.3</jasper.reports.version>
<javax.el.version>1.2</javax.el.version>
- <javax.jcr.version>1.0.1</javax.jcr.version>
+ <javax.jcr.version>1.0</javax.jcr.version>
<javax.mail.version>1.4</javax.mail.version>
<javax.servlet.version>2.5</javax.servlet.version>
<jaxen.version>1.1.1</jaxen.version>
@@ -66,6 +65,7 @@
<mvel.version>1.3.1-java1.4</mvel.version>
<richfaces.ui.version>3.2.1.GA</richfaces.ui.version>
<sun.facelets.version>1.1.15</sun.facelets.version>
+ <wiser.version>1.2</wiser.version>
<xerces.version>2.6.2</xerces.version>
<!-- Database Driver Versions -->
@@ -77,6 +77,7 @@
<mysql.connector.version>5.0.7</mysql.connector.version>
<ojdbc.version>10.2.0.4</ojdbc.version>
<postgresql.version>8.2-504.jdbc3</postgresql.version>
+ <retrotranslator.version>1.2.7</retrotranslator.version>
</properties>
<!-- DependencyManagement -->
@@ -164,6 +165,16 @@
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
<version>${drools.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>xercesImpl</artifactId>
+ <groupId>xerces</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>xml-apis</artifactId>
+ <groupId>xml-apis</groupId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.drools</groupId>
@@ -171,11 +182,6 @@
<version>${drools.version}</version>
</dependency>
<dependency>
- <groupId>dumbster</groupId>
- <artifactId>dumbster</artifactId>
- <version>${dumbster.version}</version>
- </dependency>
- <dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<version>${javax.el.version}</version>
@@ -241,6 +247,11 @@
<version>${javax.mail.version}</version>
</dependency>
<dependency>
+ <groupId>net.sf.retrotranslator</groupId>
+ <artifactId>retrotranslator-runtime</artifactId>
+ <version>${retrotranslator.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui</artifactId>
<version>${richfaces.ui.version}</version>
@@ -250,6 +261,24 @@
<artifactId>servlet-api</artifactId>
<version>${javax.servlet.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.subethamail</groupId>
+ <artifactId>subethasmtp-smtp</artifactId>
+ <version>${wiser.version}</version>
+ <classifier>java14</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.subethamail</groupId>
+ <artifactId>subethasmtp-wiser</artifactId>
+ <version>${wiser.version}</version>
+ <classifier>java14</classifier>
+ <exclusions>
+ <exclusion>
+ <groupId>org.subethamail</groupId>
+ <artifactId>subethasmtp-smtp</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
<!-- Database Drivers -->
<dependency>
@@ -457,7 +486,7 @@
<jdbc.hsqldb.database>jbpm3</jdbc.hsqldb.database>
<jdbc.hsqldb.url>jdbc:hsqldb:mem:${jdbc.hsqldb.database}</jdbc.hsqldb.url>
<jdbc.hsqldb.username>sa</jdbc.hsqldb.username>
- <jdbc.hsqldb.password></jdbc.hsqldb.password>
+ <jdbc.hsqldb.password />
<jdbc.hsqldb.driver>org.hsqldb.jdbcDriver</jdbc.hsqldb.driver>
</properties>
<dependencies>
@@ -517,7 +546,7 @@
<jdbc.hsqldb.database>jbpm3</jdbc.hsqldb.database>
<jdbc.hsqldb.url>jdbc:hsqldb:mem:${jdbc.hsqldb.database}</jdbc.hsqldb.url>
<jdbc.hsqldb.username>sa</jdbc.hsqldb.username>
- <jdbc.hsqldb.password></jdbc.hsqldb.password>
+ <jdbc.hsqldb.password />
<jdbc.hsqldb.driver>org.hsqldb.jdbcDriver</jdbc.hsqldb.driver>
</properties>
<dependencies>
Modified: projects/jsf-console/branches/jsf-console-3.2-soa/pom.xml
===================================================================
--- projects/jsf-console/branches/jsf-console-3.2-soa/pom.xml 2010-04-26 17:01:15 UTC (rev 6279)
+++ projects/jsf-console/branches/jsf-console-3.2-soa/pom.xml 2010-04-27 04:49:17 UTC (rev 6280)
@@ -37,7 +37,7 @@
<commons.fileupload.version>1.2.1</commons.fileupload.version>
<commons.io.version>1.4</commons.io.version>
<commons.logging.version>1.1.1</commons.logging.version>
- <javax.el.version>1.2</javax.el.version>
+ <javax.el.version>1.0</javax.el.version>
<javax.faces.version>1.2_13</javax.faces.version>
<javax.servlet.version>2.5</javax.servlet.version>
<jbpm.version>3.2.8</jbpm.version>
Modified: projects/parent/trunk/pom.xml
===================================================================
--- projects/parent/trunk/pom.xml 2010-04-26 17:01:15 UTC (rev 6279)
+++ projects/parent/trunk/pom.xml 2010-04-27 04:49:17 UTC (rev 6280)
@@ -7,7 +7,7 @@
<groupId>org.jbpm</groupId>
<artifactId>jbpm-parent</artifactId>
<packaging>pom</packaging>
- <version>1.0.2</version>
+ <version>1.0.3-SNAPSHOT</version>
<!-- Organization -->
<organization>
@@ -32,7 +32,7 @@
<!-- Continuous Integration Management -->
<ciManagement>
<system>hudson</system>
- <url>http://hudson.qa.jboss.com/hudson</url>
+ <url>http://hudson.jboss.org/hudson</url>
</ciManagement>
<!-- Licenses -->
@@ -78,63 +78,26 @@
<!-- Plugin Management -->
<pluginManagement>
<plugins>
- <plugin>
- <groupId>com.sun.tools.jxc.maven2</groupId>
- <artifactId>maven-jaxb-schemagen-plugin</artifactId>
- <version>1.2</version>
- <dependencies>
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- <version>2.1.7</version>
- </dependency>
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-xjc</artifactId>
- <version>2.1.7</version>
- </dependency>
- </dependencies>
- </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
- <version>1.1</version>
+ <version>1.5</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
- <version>1.0-beta-1</version>
+ <version>1.0-beta-4</version>
</plugin>
<plugin>
<groupId>net.sourceforge.maven-taglib</groupId>
<artifactId>maven-taglib-plugin</artifactId>
- <version>2.3</version>
+ <version>2.4</version>
</plugin>
</plugins>
</pluginManagement>
-
- <extensions>
- <!-- Allow to deploy releases in SVN -->
- <extension>
- <groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-scm</artifactId>
- <version>1.0-beta-6</version>
- </extension>
- <extension>
- <groupId>org.apache.maven.scm</groupId>
- <artifactId>maven-scm-manager-plexus</artifactId>
- <version>1.0</version>
- </extension>
- <extension>
- <groupId>org.apache.maven.scm</groupId>
- <artifactId>maven-scm-provider-svnexe</artifactId>
- <version>1.0</version>
- </extension>
- </extensions>
-
</build>
<!-- Reporting -->
@@ -153,84 +116,18 @@
</plugins>
</reporting>
- <!-- Repositories -->
- <repositories>
- <repository>
- <id>maven2.java.net</id>
- <url>http://download.java.net/maven/2/</url>
- </repository>
-
- <repository>
- <id>repository.jboss.org</id>
- <url>http://repository.jboss.org/maven2</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
-
- <repository>
- <id>snapshots.jboss.org</id>
- <url>http://snapshots.jboss.org/maven2</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
-
- <repository>
- <id>repository.codehaus.org</id>
- <url>http://repository.codehaus.org</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
-
- <repository>
- <id>gwt-maven</id>
- <url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/</url>
- </repository>
- </repositories>
-
- <!-- Plugin Repositories -->
- <pluginRepositories>
- <pluginRepository>
- <id>maven2.java.net</id>
- <url>http://download.java.net/maven/2/</url>
- </pluginRepository>
-
- <pluginRepository>
- <id>repository.jboss.org</id>
- <url>http://repository.jboss.org/maven2</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </pluginRepository>
-
- <pluginRepository>
- <id>snapshots.jboss.org</id>
- <url>http://snapshots.jboss.org/maven2</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </pluginRepository>
-
- <pluginRepository>
- <id>gwt-maven</id>
- <url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/</url>
- </pluginRepository>
- </pluginRepositories>
-
<!-- Distribution Management -->
<distributionManagement>
<repository>
- <id>repository.jboss.org</id>
- <name>JBoss Release Repository</name>
- <url>scm:svn:https://svn.jboss.org/repos/repository.jboss.org/maven2</url>
+ <id>jboss-releases-repository</id>
+ <name>JBoss Releases Repository</name>
+ <url>https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/</url>
</repository>
<snapshotRepository>
- <id>snapshots.jboss.org</id>
- <name>JBoss Snapshot Repository</name>
- <url>dav:https://snapshots.jboss.org/maven2</url>
+ <id>jboss-snapshots-repository</id>
+ <name>JBoss Snapshots Repository</name>
+ <url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
</project>
14 years
JBoss JBPM SVN: r6279 - in jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal: wire and 1 other directory.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-04-26 13:01:15 -0400 (Mon, 26 Apr 2010)
New Revision: 6279
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/BasicEnvironment.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java
Log:
JBPM-2844: refine the manner in which WireContext delegates a get(Class) call to the environment
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/BasicEnvironment.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/BasicEnvironment.java 2010-04-24 00:18:37 UTC (rev 6278)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/BasicEnvironment.java 2010-04-26 17:01:15 UTC (rev 6279)
@@ -21,14 +21,12 @@
*/
package org.jbpm.pvm.internal.env;
-import java.util.ArrayList;
-import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.Map;
import org.jbpm.api.JbpmException;
import org.jbpm.internal.log.Log;
-
/**
* @author Tom Baeyens
*/
@@ -39,19 +37,11 @@
private static final Log log = Log.getLog(BasicEnvironment.class.getName());
protected String authenticatedUserId;
- protected Map<String, Context> contexts;
- protected ArrayList<String> defaultSearchOrderList;
- protected String[] defaultSearchOrder;
+ protected Map<String, Context> contexts = new LinkedHashMap<String, Context>();
protected Throwable exception;
protected transient ClassLoader classLoader;
- public BasicEnvironment() {
- contexts = new HashMap<String, Context>();
- defaultSearchOrderList = new ArrayList<String>();
- defaultSearchOrder = null;
- }
-
// context methods ////////////////////////////////////////////////////////////
public Context getContext(String contextName) {
@@ -59,11 +49,7 @@
}
public void setContext(Context context) {
- String key = context.getName();
- if (contexts.put(key, context)==null) {
- defaultSearchOrderList.add(key);
- }
- defaultSearchOrder = null;
+ contexts.put(context.getName(), context);
}
public Context removeContext(Context context) {
@@ -71,12 +57,7 @@
}
public Context removeContext(String contextName) {
- Context removedContext = contexts.remove(contextName);
- if (removedContext!=null) {
- defaultSearchOrderList.remove(contextName);
- defaultSearchOrder = null;
- }
- return removedContext;
+ return contexts.remove(contextName);
}
public Context getEnvironmentFactoryContext() {
@@ -117,33 +98,51 @@
if (searchOrder==null) {
searchOrder = getDefaultSearchOrder();
}
- for (int i=0; i<searchOrder.length; i++){
- Context context = contexts.get(searchOrder[i]);
- if (context.has(name)) {
- return context.get(name);
- }
+ for (String contextName : searchOrder) {
+ Context context = contexts.get(contextName);
+ if (context.has(name)) return context.get(name);
}
return null;
}
public <T> T get(Class<T> type) {
- return get(type, null);
+ return get(type, (String[]) null);
}
public <T> T get(Class<T> type, String[] searchOrder) {
if (searchOrder==null) {
searchOrder = getDefaultSearchOrder();
}
- for (int i=0; i<searchOrder.length; i++){
- Context context = contexts.get(searchOrder[i]);
- T o = context.get(type);
- if (o!=null) {
- return o;
+ for (String contextName : searchOrder) {
+ Context context = contexts.get(contextName);
+ T object = context.get(type);
+ if (object != null) return object;
+ }
+ return null;
+ }
+
+ /**
+ * searches an object based on type in the default search order.
+ * if this environment contains the given context, the search skips
+ * contexts registered after it.
+ */
+ public <T> T get(Class<T> type, Context requester) {
+ String[] searchOrder = getDefaultSearchOrder();
+ int searchPosition = 0;
+ for (int i = 0; i < searchOrder.length; i++) {
+ if (contexts.get(searchOrder[i]) == requester) {
+ searchPosition = i + 1;
+ break;
}
}
+ for (int i = searchPosition; i < searchOrder.length; i++) {
+ Context context = contexts.get(searchOrder[i]);
+ T object = context.get(type);
+ if (object != null) return object;
+ }
return null;
}
-
+
// close ////////////////////////////////////////////////////////////////////
public void close() {
@@ -158,13 +157,14 @@
// private methods //////////////////////////////////////////////////////////
protected String[] getDefaultSearchOrder() {
- if (defaultSearchOrder==null) {
- int size = defaultSearchOrderList.size();
- defaultSearchOrder = (String[]) new String[size];
- for (int i=0; i<size; i++) {
- defaultSearchOrder[i] = defaultSearchOrderList.get(size-1-i);
- }
+ int size = contexts.size();
+ String[] defaultSearchOrder = new String[size];
+
+ int index = size;
+ for (String contextName : contexts.keySet()) {
+ defaultSearchOrder[--index] = contextName;
}
+
return defaultSearchOrder;
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java 2010-04-24 00:18:37 UTC (rev 6278)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java 2010-04-26 17:01:15 UTC (rev 6279)
@@ -31,6 +31,7 @@
import org.jbpm.api.activity.ActivityBehaviour;
import org.jbpm.internal.log.Log;
+import org.jbpm.pvm.internal.env.BasicEnvironment;
import org.jbpm.pvm.internal.env.Context;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.model.ProcessElementImpl;
@@ -707,26 +708,15 @@
}
// check if we can find it in the environment (if one is available)
EnvironmentImpl environment = EnvironmentImpl.getCurrent();
- if (environment != null) {
- Context processEngineContext = environment.getContext(CONTEXTNAME_PROCESS_ENGINE);
- if (processEngineContext != this) {
- Context transactionContext = environment.getContext(CONTEXTNAME_TRANSACTION);
- if (transactionContext != this) {
- return environment.get(type);
- }
- // try process engine context
- if (processEngineContext != null) {
- return processEngineContext.get(type);
- }
- }
+ if (environment instanceof BasicEnvironment) {
+ BasicEnvironment basicEnvironment = (BasicEnvironment) environment;
+ return basicEnvironment.get(type, this);
}
return null;
}
protected boolean hasException(String objectName) {
- return ( (exceptions!=null)
- && (exceptions.containsKey(objectName))
- );
+ return exceptions!=null && exceptions.containsKey(objectName);
}
protected void addException(Descriptor descriptor, Exception exception) {
14 years