1. JUnit依赖
功能测试使用到了JUnit
junit
junit
4.12
在pom.xml中添加上方的依赖 2.测试前准备
(1).定义接口JUnitTestInterface
arg1 arg2
customObject
arg1 arg2
threadId
定义了用于测试的方法
(2).实现接口JUnitTestInterface
arg1 arg2
arg1 arg2
customObject
object customObject
customObject
object
arg1 arg2
arg1 arg2
e
e
e
e
threadId
threadId
实现了用于测试的方法 (3).定义自定义类型JUnitTestCustomObject
string
i
string i
string string
i i
string
string
string string
i
i
i i
obj
object
obj
object obj
stringobjectstring i objecti
**.定义自定义异常JUnitTestCustomException** serialVersionUID
**3.功能测试 (1).JUnitServerTest**
*
jUnitTestInterfaceImpl
rpcServer
jUnitTestInterfaceImpl
rpcServer
args
测试结果:
正常启动RPC服务器(维持服务器开启状态,后续功能测试和性能测试需要服务器在线)
(2).JUnitFunctionTest
在pom.xml中添加上方的依赖 0在pom.xml中添加上方的依赖 1测试结果:
测试全部通过
(3).JUnitMultiThreadSafeTest
为验证RPC客户端是否是线程安全的,进行线程安全测试
在pom.xml中添加上方的依赖 2在pom.xml中添加上方的依赖 3测试结果:
测试通过
(4).RpcPerformanceTest
在pom.xml中添加上方的依赖 4在pom.xml中添加上方的依赖 5测试结果:
测试环境:酷睿i5-2410m 4G内存 64位Windows7操作系统
在pom.xml中添加上方的依赖 6完整的代码提交在:https://github.com/maigo-uestc/Maigo-RPC




还没有评论,来说两句吧...