Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
开发团队
Flowable Engine
提交
4420b00c
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,发现更多精彩内容 >>
提交
4420b00c
编写于
11月 22, 2012
作者:
F
Frederik Heremans
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ACT-1023: Retain order of enum-formproperty values as defined in xml
上级
1fde43c9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
2 deletion
+15
-2
modules/activiti-engine/src/main/java/org/activiti/engine/impl/form/FormTypes.java
...rc/main/java/org/activiti/engine/impl/form/FormTypes.java
+3
-1
modules/activiti-engine/src/test/java/org/activiti/engine/test/api/form/FormServiceTest.java
...va/org/activiti/engine/test/api/form/FormServiceTest.java
+12
-1
未找到文件。
modules/activiti-engine/src/main/java/org/activiti/engine/impl/form/FormTypes.java
浏览文件 @
4420b00c
...
...
@@ -14,6 +14,7 @@
package
org.activiti.engine.impl.form
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
import
org.activiti.engine.impl.bpmn.parser.BpmnParse
;
...
...
@@ -42,7 +43,8 @@ public class FormTypes {
formType
=
new
DateFormType
(
datePatternText
);
}
else
if
(
"enum"
.
equals
(
typeText
))
{
Map
<
String
,
String
>
values
=
new
HashMap
<
String
,
String
>();
// ACT-1023: Using linked hashmap to preserve the order in which the entries are defined
Map
<
String
,
String
>
values
=
new
LinkedHashMap
<
String
,
String
>();
for
(
Element
valueElement:
formPropertyElement
.
elementsNS
(
BpmnParser
.
ACTIVITI_BPMN_EXTENSIONS_NS
,
"value"
))
{
String
valueId
=
valueElement
.
attribute
(
"id"
);
String
valueName
=
valueElement
.
attribute
(
"name"
);
...
...
modules/activiti-engine/src/test/java/org/activiti/engine/test/api/form/FormServiceTest.java
浏览文件 @
4420b00c
...
...
@@ -15,8 +15,11 @@ package org.activiti.engine.test.api.form;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
org.activiti.engine.ActivitiException
;
import
org.activiti.engine.form.FormProperty
;
...
...
@@ -267,11 +270,19 @@ public class FormServiceTest extends PluggableActivitiTestCase {
assertEquals
(
"enum"
,
property
.
getType
().
getName
());
Map
<
String
,
String
>
values
=
(
Map
<
String
,
String
>)
property
.
getType
().
getInformation
(
"values"
);
Map
<
String
,
String
>
expectedValues
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
expectedValues
=
new
Linked
HashMap
<
String
,
String
>();
expectedValues
.
put
(
"left"
,
"Go Left"
);
expectedValues
.
put
(
"right"
,
"Go Right"
);
expectedValues
.
put
(
"up"
,
"Go Up"
);
expectedValues
.
put
(
"down"
,
"Go Down"
);
// ACT-1023: check if ordering is retained
Iterator
<
Entry
<
String
,
String
>>
expectedValuesIterator
=
expectedValues
.
entrySet
().
iterator
();
for
(
Entry
<
String
,
String
>
entry
:
values
.
entrySet
())
{
Entry
<
String
,
String
>
expectedEntryAtLocation
=
expectedValuesIterator
.
next
();
assertEquals
(
expectedEntryAtLocation
.
getKey
(),
entry
.
getKey
());
assertEquals
(
expectedEntryAtLocation
.
getValue
(),
entry
.
getValue
());
}
assertEquals
(
expectedValues
,
values
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录