Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
开发团队
Flowable Engine
提交
5ecddcfe
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,发现更多精彩内容 >>
提交
5ecddcfe
编写于
11月 22, 2012
作者:
T
Tom Baeyens
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ACT-1333 fixing upgrade script
上级
9c666c73
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
143 addition
and
1 deletion
+143
-1
modules/activiti-upgrade/pom.xml
modules/activiti-upgrade/pom.xml
+14
-0
modules/activiti-upgrade/src/test/java/org/activiti/upgrade/CleanPostgres.java
...ade/src/test/java/org/activiti/upgrade/CleanPostgres.java
+92
-0
modules/activiti-upgrade/src/test/java/org/activiti/upgrade/DatabaseFormatterDb2.java
.../test/java/org/activiti/upgrade/DatabaseFormatterDb2.java
+12
-0
modules/activiti-upgrade/src/test/java/org/activiti/upgrade/DatabaseFormatterMsSqlServer.java
...va/org/activiti/upgrade/DatabaseFormatterMsSqlServer.java
+12
-0
modules/activiti-upgrade/src/test/java/org/activiti/upgrade/DatabaseFormatterPostgres.java
.../java/org/activiti/upgrade/DatabaseFormatterPostgres.java
+12
-0
modules/activiti-upgrade/src/test/java/org/activiti/upgrade/UpgradeTestCase.java
...e/src/test/java/org/activiti/upgrade/UpgradeTestCase.java
+1
-1
未找到文件。
modules/activiti-upgrade/pom.xml
浏览文件 @
5ecddcfe
...
...
@@ -187,6 +187,14 @@
</fileset>
</path>
</sql>
<condition
property=
"isPostgres"
>
<equals
arg1=
"${database}"
arg2=
"postgres"
/>
</condition>
<java
classname=
"org.activiti.upgrade.CleanPostgres"
fork=
"true"
if=
"isPostgres"
>
<classpath>
<path
path=
"${test_classpath}"
/>
</classpath>
</java>
<sql
driver=
"${jdbc.driver}"
url=
"${jdbc.url}"
userid=
"${jdbc.username}"
password=
"${jdbc.password}"
classpath=
"${test_classpath}"
>
<path>
...
...
@@ -257,6 +265,12 @@
</fileset>
</path>
</sql>
<java
classname=
"org.activiti.upgrade.CleanPostgres"
fork=
"true"
>
<arg
line=
"${database}"
/>
<classpath>
<path
path=
"${test_classpath}"
/>
</classpath>
</java>
<sql
driver=
"${jdbc.driver}"
url=
"${jdbc.url}"
userid=
"${jdbc.username}"
password=
"${jdbc.password}"
classpath=
"${test_classpath}"
>
<path>
...
...
modules/activiti-upgrade/src/test/java/org/activiti/upgrade/CleanPostgres.java
0 → 100644
浏览文件 @
5ecddcfe
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.activiti.upgrade
;
import
java.sql.Connection
;
import
java.sql.PreparedStatement
;
import
java.util.logging.Logger
;
import
org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl
;
import
org.activiti.engine.impl.db.DbSqlSession
;
import
org.activiti.engine.impl.interceptor.Command
;
import
org.activiti.engine.impl.interceptor.CommandContext
;
import
org.activiti.engine.impl.interceptor.CommandExecutor
;
public
class
CleanPostgres
{
private
static
Logger
log
=
Logger
.
getLogger
(
CleanPostgres
.
class
.
getName
());
static
String
[]
cleanStatements
=
new
String
[]
{
"drop table ACT_GE_PROPERTY cascade;"
,
"drop table ACT_GE_BYTEARRAY cascade;"
,
"drop table ACT_RE_MODEL cascade;"
,
"drop table ACT_RE_DEPLOYMENT cascade;"
,
"drop table ACT_RE_PROCDEF cascade;"
,
"drop table ACT_RU_IDENTITYLINK cascade;"
,
"drop table ACT_RU_VARIABLE cascade;"
,
"drop table ACT_RU_TASK cascade;"
,
"drop table ACT_RU_EXECUTION cascade;"
,
"drop table ACT_RU_JOB cascade;"
,
"drop table ACT_RU_EVENT_SUBSCR cascade;"
,
"drop table ACT_HI_PROCINST cascade;"
,
"drop table ACT_HI_ACTINST cascade;"
,
"drop table ACT_HI_VARINST cascade;"
,
"drop table ACT_HI_TASKINST cascade;"
,
"drop table ACT_HI_DETAIL cascade;"
,
"drop table ACT_HI_COMMENT cascade;"
,
"drop table ACT_HI_ATTACHMENT cascade;"
,
"drop table ACT_ID_INFO cascade;"
,
"drop table ACT_ID_MEMBERSHIP cascade;"
,
"drop table ACT_ID_GROUP cascade;"
,
"drop table ACT_ID_USER cascade;"
};
public
static
void
main
(
String
[]
args
)
{
try
{
if
(
"postgres"
.
equals
(
args
[
0
]))
{
ProcessEngineConfigurationImpl
processEngineConfiguration
=
UpgradeTestCase
.
createProcessEngineConfiguration
(
"postgres"
);
processEngineConfiguration
.
buildProcessEngine
();
CommandExecutor
commandExecutor
=
processEngineConfiguration
.
getCommandExecutorTxRequired
();
commandExecutor
.
execute
(
new
Command
<
Object
>()
{
public
Object
execute
(
CommandContext
commandContext
)
{
try
{
Connection
connection
=
commandContext
.
getSession
(
DbSqlSession
.
class
).
getSqlSession
().
getConnection
();
connection
.
setAutoCommit
(
false
);
for
(
String
cleanStatement
:
cleanStatements
)
{
try
{
PreparedStatement
preparedStatement
=
connection
.
prepareStatement
(
cleanStatement
);
preparedStatement
.
execute
();
connection
.
commit
();
log
.
info
(
"executed ["
+
cleanStatement
+
"] successfully"
);
}
catch
(
Exception
e
)
{
log
.
info
(
"ERROR WHILE EXECUTING ["
+
cleanStatement
+
"]:"
);
e
.
printStackTrace
();
connection
.
rollback
();
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
});
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
modules/activiti-upgrade/src/test/java/org/activiti/upgrade/DatabaseFormatterDb2.java
浏览文件 @
5ecddcfe
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.activiti.upgrade
;
import
java.util.Date
;
...
...
modules/activiti-upgrade/src/test/java/org/activiti/upgrade/DatabaseFormatterMsSqlServer.java
浏览文件 @
5ecddcfe
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.activiti.upgrade
;
...
...
modules/activiti-upgrade/src/test/java/org/activiti/upgrade/DatabaseFormatterPostgres.java
浏览文件 @
5ecddcfe
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.activiti.upgrade
;
...
...
modules/activiti-upgrade/src/test/java/org/activiti/upgrade/UpgradeTestCase.java
浏览文件 @
5ecddcfe
...
...
@@ -87,7 +87,7 @@ public abstract class UpgradeTestCase extends TestCase {
public
abstract
void
runInTheOldVersion
();
public
static
ProcessEngineConfigurationImpl
createProcessEngineConfiguration
(
String
database
)
throws
IOException
,
FileNotFound
Exception
{
public
static
ProcessEngineConfigurationImpl
createProcessEngineConfiguration
(
String
database
)
throws
Exception
{
ProcessEngineConfigurationImpl
processEngineConfiguration
;
processEngineConfiguration
=
(
ProcessEngineConfigurationImpl
)
ProcessEngineConfiguration
.
createStandaloneProcessEngineConfiguration
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录