Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
开发团队
Flowable Engine
提交
df988731
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,发现更多精彩内容 >>
提交
df988731
编写于
10月 19, 2010
作者:
G
gnt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[ACT-221] Add an integration test for the webservice task solely based on CXF
上级
052d1a38
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
274 addition
and
0 deletion
+274
-0
modules/activiti-cxf/pom.xml
modules/activiti-cxf/pom.xml
+10
-0
modules/activiti-cxf/src/test/java/org/activiti/engine/impl/webservice/Counter.java
...est/java/org/activiti/engine/impl/webservice/Counter.java
+61
-0
modules/activiti-cxf/src/test/java/org/activiti/engine/impl/webservice/CounterImpl.java
...java/org/activiti/engine/impl/webservice/CounterImpl.java
+66
-0
modules/activiti-cxf/src/test/java/org/activiti/engine/impl/webservice/WebServiceTaskTest.java
...g/activiti/engine/impl/webservice/WebServiceTaskTest.java
+64
-0
modules/activiti-cxf/src/test/resources/activiti.properties
modules/activiti-cxf/src/test/resources/activiti.properties
+8
-0
modules/activiti-cxf/src/test/resources/org/activiti/engine/impl/webservice/WebServiceTaskTest.testWebServiceInvocation.bpmn20.xml
...ce/WebServiceTaskTest.testWebServiceInvocation.bpmn20.xml
+50
-0
pom.xml
pom.xml
+15
-0
未找到文件。
modules/activiti-cxf/pom.xml
浏览文件 @
df988731
...
...
@@ -41,6 +41,16 @@
<groupId>
org.apache.cxf
</groupId>
<artifactId>
cxf-rt-frontend-jaxws
</artifactId>
</dependency>
<dependency>
<groupId>
com.h2database
</groupId>
<artifactId>
h2
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.apache.cxf
</groupId>
<artifactId>
cxf-rt-transports-http-jetty
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
<profiles>
...
...
modules/activiti-cxf/src/test/java/org/activiti/engine/impl/webservice/Counter.java
0 → 100644
浏览文件 @
df988731
/* 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.engine.impl.webservice
;
import
javax.jws.WebParam
;
import
javax.jws.WebResult
;
import
javax.jws.WebService
;
/**
* A simple Counter WS that starts the counter in -1
*
* @author Esteban Robles Luna
*/
@WebService
public
interface
Counter
{
/**
* Increase the counter in 1
*/
void
inc
();
/**
* Returns the current count
*
* @return the count
*/
@WebResult
(
name
=
"count"
)
int
getCount
();
/**
* Resets the counter to 0
*/
void
reset
();
/**
* Sets the counter to value
*
* @param value the value of the new counter
*/
void
setTo
(
@WebParam
(
name
=
"value"
)
int
value
);
/**
* Returns a formated string composed of prefix + current count + suffix
*
* @param prefix the prefix
* @param suffix the suffix
* @return the formated string
*/
@WebResult
(
name
=
"prettyPrint"
)
String
prettyPrintCount
(
@WebParam
(
name
=
"prefix"
)
String
prefix
,
@WebParam
(
name
=
"suffix"
)
String
suffix
);
}
modules/activiti-cxf/src/test/java/org/activiti/engine/impl/webservice/CounterImpl.java
0 → 100644
浏览文件 @
df988731
/* 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.engine.impl.webservice
;
import
javax.jws.WebService
;
/**
* An implementation of a Counter WS
*
* @author Esteban Robles Luna
*/
@WebService
(
endpointInterface
=
"org.activiti.engine.impl.webservice.Counter"
,
serviceName
=
"Counter"
)
public
class
CounterImpl
implements
Counter
{
protected
int
count
;
public
CounterImpl
()
{
this
.
count
=
-
1
;
}
/**
* {@inheritDoc}
*/
public
int
getCount
()
{
return
this
.
count
;
}
/**
* {@inheritDoc}
*/
public
void
inc
()
{
this
.
count
++;
}
/**
* {@inheritDoc}
*/
public
void
reset
()
{
this
.
setTo
(
0
);
}
/**
* {@inheritDoc}
*/
public
void
setTo
(
int
value
)
{
this
.
count
=
value
;
}
/**
* {@inheritDoc}
*/
public
String
prettyPrintCount
(
String
prefix
,
String
suffix
)
{
return
prefix
+
this
.
getCount
()
+
suffix
;
}
}
\ No newline at end of file
modules/activiti-cxf/src/test/java/org/activiti/engine/impl/webservice/WebServiceTaskTest.java
0 → 100644
浏览文件 @
df988731
/* 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.engine.impl.webservice
;
import
org.activiti.engine.impl.test.ActivitiInternalTestCase
;
import
org.activiti.engine.test.Deployment
;
import
org.apache.cxf.endpoint.Server
;
import
org.apache.cxf.interceptor.LoggingInInterceptor
;
import
org.apache.cxf.interceptor.LoggingOutInterceptor
;
import
org.apache.cxf.jaxws.JaxWsServerFactoryBean
;
/**
* An integration test for CXF based web services
*
* @author <a href="mailto:gnodet@gmail.com">Guillaume Nodet</a>
*/
public
class
WebServiceTaskTest
extends
ActivitiInternalTestCase
{
private
Counter
counter
;
private
Server
server
;
@Override
protected
void
initializeProcessEngine
()
{
super
.
initializeProcessEngine
();
counter
=
new
CounterImpl
();
JaxWsServerFactoryBean
svrFactory
=
new
JaxWsServerFactoryBean
();
svrFactory
.
setServiceClass
(
Counter
.
class
);
svrFactory
.
setAddress
(
"http://localhost:63081/counter"
);
svrFactory
.
setServiceBean
(
counter
);
svrFactory
.
getInInterceptors
().
add
(
new
LoggingInInterceptor
());
svrFactory
.
getOutInterceptors
().
add
(
new
LoggingOutInterceptor
());
server
=
svrFactory
.
create
();
server
.
start
();
}
@Override
protected
void
tearDown
()
throws
Exception
{
super
.
tearDown
();
server
.
stop
();
}
@Deployment
public
void
testWebServiceInvocation
()
throws
Exception
{
assertEquals
(-
1
,
counter
.
getCount
());
runtimeService
.
startProcessInstanceByKey
(
"webServiceInvocation"
);
waitForJobExecutorToProcessAllJobs
(
10000L
,
250L
);
assertEquals
(
0
,
counter
.
getCount
());
}
}
modules/activiti-cxf/src/test/resources/activiti.properties
0 → 100644
浏览文件 @
df988731
database
=
h2
jdbc.driver
=
org.h2.Driver
jdbc.url
=
jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000
jdbc.username
=
sa
jdbc.password
=
db.schema.strategy
=
create-drop
job.executor.auto.activate
=
off
ws.sync.factory
=
org.activiti.engine.impl.webservice.CxfWebServiceClientFactory
modules/activiti-cxf/src/test/resources/org/activiti/engine/impl/webservice/WebServiceTaskTest.testWebServiceInvocation.bpmn20.xml
0 → 100644
浏览文件 @
df988731
<?xml version="1.0" encoding="UTF-8"?>
<definitions
id=
"definitions"
xmlns=
"http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:activiti=
"http://activiti.org/bpmn-extensions"
targetNamespace=
"http://www.activiti.org/bpmn2.0/examples/webServiceInvocationWithoutDataFlow"
xmlns:tns=
"http://www.activiti.org/bpmn2.0/examples/webServiceInvocationWithoutDataFlow"
xmlns:counter=
"http://webservice.activiti.org/"
>
<import
importType=
"http://schemas.xmlsoap.org/wsdl/"
location=
"http://localhost:63081/counter?wsdl"
namespace=
"http://webservice.activiti.org/"
/>
<process
id=
"webServiceInvocation"
>
<startEvent
id=
"theStart"
/>
<sequenceFlow
id=
"flow1"
sourceRef=
"theStart"
targetRef=
"webService"
/>
<serviceTask
id=
"webService"
name=
"Web service invocation"
implementation=
"##WebService"
operationRef=
"incOperation"
/>
<sequenceFlow
id=
"flow2"
sourceRef=
"webService"
targetRef=
"waitState"
/>
<receiveTask
id=
"waitState"
/>
<sequenceFlow
id=
"flow3"
sourceRef=
"waitState"
targetRef=
"theEnd"
/>
<endEvent
id=
"theEnd"
/>
</process>
<!-- Interface: implementationRef = QName of WSDL Port Type -->
<interface
name=
"Counter Interface"
>
<!-- NEEDED FOR THE PORT -->
<!-- Operation: implementationRef = QName of WSDL Operation -->
<operation
id=
"incOperation"
name=
"Increase Operation"
implementationRef=
"inc"
>
<!-- NEEDED FOR THE OPERATION NAME -->
<inMessageRef>
incRequestMessage
</inMessageRef>
<outMessageRef>
incResponseMessage
</outMessageRef>
</operation>
</interface>
<message
id=
"incRequestMessage"
itemRef=
"incRequestItem"
/>
<message
id=
"incResponseMessage"
itemRef=
"incResponseItem"
/>
<itemDefinition
id=
"incRequestItem"
structureRef=
"inc"
/>
<!-- QName of input element -->
<!-- NEEDED FOR THE ARGUMENTS -->
<itemDefinition
id=
"incResponseItem"
structureRef=
"incResponse"
/>
<!-- QName of output element -->
</definitions>
\ No newline at end of file
pom.xml
浏览文件 @
df988731
...
...
@@ -219,6 +219,21 @@
<artifactId>
cxf-rt-frontend-jaxws
</artifactId>
<version>
2.1.2
</version>
</dependency>
<dependency>
<groupId>
org.apache.cxf
</groupId>
<artifactId>
cxf-rt-transports-http
</artifactId>
<version>
2.1.2
</version>
</dependency>
<dependency>
<groupId>
org.apache.cxf
</groupId>
<artifactId>
cxf-rt-transports-http-jetty
</artifactId>
<version>
2.1.2
</version>
</dependency>
<dependency>
<groupId>
org.apache.cxf
</groupId>
<artifactId>
cxf-rt-bindings-soap
</artifactId>
<version>
2.1.2
</version>
</dependency>
<dependency>
<groupId>
org.mule.transports
</groupId>
<artifactId>
mule-transport-cxf
</artifactId>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录