Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
开发团队
Flowable Engine
提交
a54386e3
F
Flowable Engine
项目概览
开发团队
/
Flowable Engine
通知
9
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Flowable Engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a54386e3
编写于
11月 03, 2015
作者:
J
Joram Barrez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ACT-4080: more tests (nested call activities)
上级
c47be44c
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
668 addition
and
0 deletion
+668
-0
modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/event/end/TerminateEndEventTest.java
...iti/engine/test/bpmn/event/end/TerminateEndEventTest.java
+70
-0
modules/activiti-engine/src/test/resources/org/activiti/engine/test/bpmn/event/end/TerminateEndEventTest.testNestedCallActivities.bpmn20.xml
...TerminateEndEventTest.testNestedCallActivities.bpmn20.xml
+299
-0
modules/activiti-engine/src/test/resources/org/activiti/engine/test/bpmn/event/end/TerminateEndEventTest.testNestedCallActivitiesTerminateAll.bpmn20.xml
...EventTest.testNestedCallActivitiesTerminateAll.bpmn20.xml
+299
-0
未找到文件。
modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/event/end/TerminateEndEventTest.java
浏览文件 @
a54386e3
...
...
@@ -16,6 +16,7 @@ import static org.hamcrest.CoreMatchers.instanceOf;
import
static
org
.
hamcrest
.
CoreMatchers
.
is
;
import
static
org
.
junit
.
Assert
.
assertThat
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -676,6 +677,75 @@ public class TerminateEndEventTest extends PluggableActivitiTestCase {
taskService
.
complete
(
task
.
getId
());
assertProcessEnded
(
processInstance
.
getId
());
}
@Deployment
public
void
testNestedCallActivities
()
{
ProcessInstance
processInstance
=
runtimeService
.
startProcessInstanceByKey
(
"TestNestedCallActivities"
);
// Verify the tasks
List
<
Task
>
tasks
=
assertTaskNames
(
processInstance
,
Arrays
.
asList
(
"B"
,
"B"
,
"B"
,
"B"
,
"Before A"
,
"Before A"
,
"Before A"
,
"Before A"
,
"Before B"
,
"Before C"
));
// Completing 'before c'
taskService
.
complete
(
tasks
.
get
(
9
).
getId
());
tasks
=
assertTaskNames
(
processInstance
,
Arrays
.
asList
(
"After C"
,
"B"
,
"B"
,
"B"
,
"B"
,
"Before A"
,
"Before A"
,
"Before A"
,
"Before A"
,
"Before B"
));
// Completing 'before A' of one instance
Task
task
=
taskService
.
createTaskQuery
().
taskName
(
"task_subprocess_1"
).
singleResult
();
assertNull
(
task
);
taskService
.
complete
(
tasks
.
get
(
5
).
getId
());
// Multi instance call activity is sequential, so expecting 5 more times the same task
for
(
int
i
=
0
;
i
<
6
;
i
++)
{
task
=
taskService
.
createTaskQuery
().
taskName
(
"subprocess1_task"
).
singleResult
();
assertNotNull
(
"Task is null for index "
+
i
,
task
);
taskService
.
complete
(
task
.
getId
());
}
tasks
=
assertTaskNames
(
processInstance
,
Arrays
.
asList
(
"After A"
,
"After C"
,
"B"
,
"B"
,
"B"
,
"B"
,
"Before A"
,
"Before A"
,
"Before A"
,
"Before B"
));
}
@Deployment
public
void
testNestedCallActivitiesTerminateAll
()
{
ProcessInstance
processInstance
=
runtimeService
.
startProcessInstanceByKey
(
"TestNestedCallActivities"
);
// Verify the tasks
List
<
Task
>
tasks
=
assertTaskNames
(
processInstance
,
Arrays
.
asList
(
"B"
,
"B"
,
"B"
,
"B"
,
"Before A"
,
"Before A"
,
"Before A"
,
"Before A"
,
"Before B"
,
"Before C"
));
// Completing 'Before B' should lead to process instance termination
taskService
.
complete
(
tasks
.
get
(
8
).
getId
());
assertProcessEnded
(
processInstance
.
getId
());
// Completing 'Before C' too
processInstance
=
runtimeService
.
startProcessInstanceByKey
(
"TestNestedCallActivities"
);
tasks
=
assertTaskNames
(
processInstance
,
Arrays
.
asList
(
"B"
,
"B"
,
"B"
,
"B"
,
"Before A"
,
"Before A"
,
"Before A"
,
"Before A"
,
"Before B"
,
"Before C"
));
taskService
.
complete
(
tasks
.
get
(
9
).
getId
());
assertProcessEnded
(
processInstance
.
getId
());
// Now the tricky one. 'Before A' leads to 'callActivity A', which calls subprocess02 which terminates
processInstance
=
runtimeService
.
startProcessInstanceByKey
(
"TestNestedCallActivities"
);
tasks
=
assertTaskNames
(
processInstance
,
Arrays
.
asList
(
"B"
,
"B"
,
"B"
,
"B"
,
"Before A"
,
"Before A"
,
"Before A"
,
"Before A"
,
"Before B"
,
"Before C"
));
taskService
.
complete
(
tasks
.
get
(
5
).
getId
());
Task
task
=
taskService
.
createTaskQuery
().
taskName
(
"subprocess1_task"
).
singleResult
();
assertNotNull
(
task
);
taskService
.
complete
(
task
.
getId
());
assertProcessEnded
(
processInstance
.
getId
());
}
private
List
<
Task
>
assertTaskNames
(
ProcessInstance
processInstance
,
List
<
String
>
taskNames
)
{
List
<
Task
>
tasks
=
taskService
.
createTaskQuery
().
processInstanceId
(
processInstance
.
getId
()).
orderByTaskName
().
asc
().
list
();
for
(
int
i
=
0
;
i
<
taskNames
.
size
();
i
++)
{
assertEquals
(
"Task name at index "
+
i
+
" does not match"
,
taskNames
.
get
(
i
),
tasks
.
get
(
i
).
getName
());
}
return
tasks
;
}
public
void
testParseTerminateEndEventDefinitionWithExtensions
()
{
org
.
activiti
.
engine
.
repository
.
Deployment
deployment
=
repositoryService
.
createDeployment
().
addClasspathResource
(
"org/activiti/engine/test/bpmn/event/end/TerminateEndEventTest.parseExtensionElements.bpmn20.xml"
).
deploy
();
...
...
modules/activiti-engine/src/test/resources/org/activiti/engine/test/bpmn/event/end/TerminateEndEventTest.testNestedCallActivities.bpmn20.xml
0 → 100644
浏览文件 @
a54386e3
此差异已折叠。
点击以展开。
modules/activiti-engine/src/test/resources/org/activiti/engine/test/bpmn/event/end/TerminateEndEventTest.testNestedCallActivitiesTerminateAll.bpmn20.xml
0 → 100644
浏览文件 @
a54386e3
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录