Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
开发团队
Flowable Engine
提交
33b3b242
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,发现更多精彩内容 >>
提交
33b3b242
编写于
9月 19, 2014
作者:
J
Josh Long
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
integration bits
上级
140c3d32
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
110 addition
and
24 deletion
+110
-24
modules/activiti-spring-boot/spring-boot-starters/pom.xml
modules/activiti-spring-boot/spring-boot-starters/pom.xml
+2
-1
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starters-basic/src/main/java/org/activiti/spring/boot/BasicProcessEngineAutoConfiguration.java
...viti/spring/boot/BasicProcessEngineAutoConfiguration.java
+3
-3
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starters-integration/pom.xml
...ng-boot-starters/spring-boot-starters-integration/pom.xml
+52
-9
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starters-integration/src/test/resources/processes/gw.bpmn20.xml
...rs-integration/src/test/resources/processes/gw.bpmn20.xml
+24
-0
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starters-rest-api/pom.xml
...pring-boot-starters/spring-boot-starters-rest-api/pom.xml
+0
-5
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starters-rest-api/src/main/java/org/activiti/spring/boot/ProcessEngineRestApiAutoConfiguration.java
...ti/spring/boot/ProcessEngineRestApiAutoConfiguration.java
+0
-1
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starters-rest-api/src/test/java/org/activiti/spring/boot/TestProcessEngineRestApiAutoConfiguration.java
...pring/boot/TestProcessEngineRestApiAutoConfiguration.java
+29
-5
未找到文件。
modules/activiti-spring-boot/spring-boot-starters/pom.xml
浏览文件 @
33b3b242
...
...
@@ -16,8 +16,9 @@
<modules>
<module>
spring-boot-starters-basic
</module>
<module>
spring-boot-starters-rest-api
</module>
<module>
spring-boot-starters-integration
</module>
<!-- <module>spring-boot-starters-actuator</module>
<module>spring-boot-starters-integration</module>
-->
-->
</modules>
<dependencies>
<dependency>
...
...
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starters-basic/src/main/java/org/activiti/spring/boot/BasicProcessEngineAutoConfiguration.java
浏览文件 @
33b3b242
...
...
@@ -61,7 +61,7 @@ public class BasicProcessEngineAutoConfiguration {
@Configuration
public
static
class
DefaultProcessEngineConfiguration
extends
AbstractProcessEngineConfiguration
{
extends
AbstractProcessEngineConfiguration
{
@Bean
public
SpringJobExecutor
springJobExecutor
(
TaskExecutor
taskExecutor
)
{
...
...
@@ -109,10 +109,10 @@ public class BasicProcessEngineAutoConfiguration {
}
@Bean
public
ProcessEngine
processEngine
(
SpringProcessEngineConfiguration
configuration
)
throws
Exception
{
public
ProcessEngine
FactoryBean
processEngine
(
SpringProcessEngineConfiguration
configuration
)
throws
Exception
{
ProcessEngineFactoryBean
processEngineFactoryBean
=
new
ProcessEngineFactoryBean
();
processEngineFactoryBean
.
setProcessEngineConfiguration
(
configuration
);
return
processEngineFactoryBean
.
getObject
()
;
return
processEngineFactoryBean
;
}
@Bean
...
...
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starters-integration/pom.xml
浏览文件 @
33b3b242
<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/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<name>
Activiti - Spring Boot
</name>
<properties>
<spring-integration-java-dsl.version>
1.0.0.M3
</spring-integration-java-dsl.version>
<java.version>
1.8
</java.version>
</properties>
<parent>
<groupId>
org.activiti
</groupId>
<artifactId>
spring-boot-starters
</artifactId>
<version>
5.16.4-SNAPSHOT
</version>
<groupId>
org.activiti
</groupId>
<artifactId>
spring-boot-starters
</artifactId>
<version>
5.16.4-SNAPSHOT
</version>
</parent>
<artifactId>
spring-boot-starters-actuator
</artifactId>
<artifactId>
spring-boot-starters-integration
</artifactId>
<dependencies>
<dependency>
<groupId>
org.activiti
</groupId>
<artifactId>
spring-boot-starters-basic
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-integration
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.integration
</groupId>
<artifactId>
spring-integration-amqp
</artifactId>
<optional>
true
</optional>
</dependency>
<!-- bring in the Java configuration DSL for Spring Integration
-->
<dependency>
<groupId>
org.springframework.integration
</groupId>
<artifactId>
spring-integration-java-dsl
</artifactId>
<version>
${spring-integration-java-dsl.version}
</version>
</dependency>
<dependency>
<groupId>
org.codehaus.groovy
</groupId>
<artifactId>
groovy
</artifactId>
<scope>
test
</scope>
<version>
1.7.5
</version>
</dependency>
<dependency>
<groupId>
com.h2database
</groupId>
<artifactId>
h2
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starters-integration/src/test/resources/processes/gw.bpmn20.xml
0 → 100644
浏览文件 @
33b3b242
<?xml version="1.0" encoding="UTF-8"?>
<definitions
id=
"definitions"
xmlns=
"http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:activiti=
"http://activiti.org/bpmn"
typeLanguage=
"http://www.w3.org/2001/XMLSchema"
expressionLanguage=
"http://www.w3.org/1999/XPath"
targetNamespace=
"http://www.activiti.org/bpmn2.0"
>
<process
id=
"integrationGatewayProcess"
>
<startEvent
id=
"start"
/>
<sequenceFlow
id=
"flow1"
sourceRef=
"start"
targetRef=
"integrationGateway"
/>
<serviceTask
id=
"integrationGateway"
activiti:delegateExpression=
"#{activitiDelegate}"
/>
<sequenceFlow
id=
"scriptFlow"
sourceRef=
"integrationGateway"
targetRef=
"scriptTask"
/>
<scriptTask
id=
"scriptTask"
scriptFormat=
"groovy"
>
<script>
println 'about to finish the script task.'
println 'customerId=' + customerId
println 'spamId=' + spamId
</script>
</scriptTask>
<sequenceFlow
sourceRef=
"scriptTask"
targetRef=
"end"
/>
<endEvent
id=
"end"
/>
</process>
</definitions>
\ No newline at end of file
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starters-rest-api/pom.xml
浏览文件 @
33b3b242
...
...
@@ -17,8 +17,6 @@
<artifactId>
h2
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.activiti
</groupId>
<artifactId>
activiti-rest
</artifactId>
...
...
@@ -34,8 +32,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.activiti
</groupId>
<artifactId>
spring-boot-starters-basic
</artifactId>
...
...
@@ -52,7 +48,6 @@
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-jdbc
</artifactId>
</dependency>
</dependencies>
...
...
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starters-rest-api/src/main/java/org/activiti/spring/boot/ProcessEngineRestApiAutoConfiguration.java
浏览文件 @
33b3b242
...
...
@@ -28,7 +28,6 @@ import org.springframework.context.annotation.Configuration;
/**
*
* Auto-configuration and starter for the Activiti REST APIs.
*
*
* @author Josh Long
*/
...
...
modules/activiti-spring-boot/spring-boot-starters/spring-boot-starters-rest-api/src/test/java/org/activiti/spring/boot/TestProcessEngineRestApiAutoConfiguration.java
浏览文件 @
33b3b242
...
...
@@ -13,13 +13,17 @@ import org.springframework.core.task.SimpleAsyncTaskExecutor;
import
org.springframework.core.task.TaskExecutor
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.client.ClientHttpResponse
;
import
org.springframework.jdbc.datasource.DataSourceTransactionManager
;
import
org.springframework.transaction.PlatformTransactionManager
;
import
org.springframework.web.client.ResponseErrorHandler
;
import
org.springframework.web.client.RestTemplate
;
import
javax.servlet.ServletRegistration
;
import
javax.sql.DataSource
;
import
java.io.IOException
;
import
java.util.Map
;
import
java.util.concurrent.atomic.AtomicBoolean
;
/**
* unit tests for the REST API integration.
...
...
@@ -30,7 +34,8 @@ public class TestProcessEngineRestApiAutoConfiguration {
@Configuration
@EnableAutoConfiguration
public
static
class
SimpleDataSourceConfiguration
{
public
static
class
TestConfiguration
{
@Bean
RestTemplate
restTemplate
()
{
return
new
RestTemplate
();
...
...
@@ -56,6 +61,7 @@ public class TestProcessEngineRestApiAutoConfiguration {
PlatformTransactionManager
dataSourceTransactionManager
(
DataSource
dataSource
)
{
return
new
DataSourceTransactionManager
(
dataSource
);
}
}
private
ConfigurableApplicationContext
applicationContext
;
...
...
@@ -68,7 +74,7 @@ public class TestProcessEngineRestApiAutoConfiguration {
@Before
public
void
setUp
()
{
this
.
applicationContext
=
SpringApplication
.
run
(
SimpleDataSource
Configuration
.
class
);
this
.
applicationContext
=
SpringApplication
.
run
(
Test
Configuration
.
class
);
}
@Test
...
...
@@ -78,10 +84,28 @@ public class TestProcessEngineRestApiAutoConfiguration {
}
String
authenticationChallenge
=
"http://localhost:8080/api/process-definitions"
;
RestTemplate
restTemplate
=
this
.
applicationContext
.
getBean
(
RestTemplate
.
class
);
ResponseEntity
<
Map
>
x
=
restTemplate
.
getForEntity
(
authenticationChallenge
,
Map
.
class
);
org
.
junit
.
Assert
.
assertTrue
(
x
.
getStatusCode
().
equals
(
HttpStatus
.
FORBIDDEN
));
RestTemplate
restTemplate
=
this
.
applicationContext
.
getBean
(
RestTemplate
.
class
);
final
AtomicBoolean
received403
=
new
AtomicBoolean
()
;
received403
.
set
(
false
);
restTemplate
.
setErrorHandler
(
new
ResponseErrorHandler
()
{
@Override
public
boolean
hasError
(
ClientHttpResponse
clientHttpResponse
)
throws
IOException
{
return
true
;
}
@Override
public
void
handleError
(
ClientHttpResponse
clientHttpResponse
)
throws
IOException
{
if
(
clientHttpResponse
.
getStatusCode
().
equals
(
HttpStatus
.
FORBIDDEN
))
received403
.
set
(
true
);
}
});
restTemplate
.
getForEntity
(
authenticationChallenge
,
Map
.
class
);
org
.
junit
.
Assert
.
assertTrue
(
received403
.
get
()
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录