Skip to content

Kepler-Framework/Kepler-Test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

  • 作用:
    • 尽可能提供可测试的RPC接口,减少测试成本

  • 准备工作
    • JDK依赖
      • JDK1.7及以上
    • 运行依赖
  • 测试原理
    • 通过解析JSON构建请求参数,并将响应输出为JSON

  • 如何安装
  • 如何使用
     <dependency>
     	<groupId>com.kepler</groupId>
     	<artifactId>kepler-test-demo-interface</artifactId>
     	<version>1.0-SNAPSHOT</version>
     </dependency>
    
     {
     	"service": "com.kepler.TestApp",
     	"version": "0.0.1-test",
     	"method": "test",
     	"profile": "",
     	"catalog": "",
     	"args": 
     	[
     		{
     			"name": "apply",
     			"clazz": "com.kepler.Apply"
     		}
     	]
     }
    
     {
     	"desc": "THIS TEST",
     	"dept": 
     	{
     		"name": "dept",
     		"createAt": "2016-04-23 01:02:03"
     	},
     
     	"user": 
     	{
     		"name": "kim",
     		"level": "0"
     	}
     }
    
    • 执行测试

      • cd kepler-test/modules/client
      • mvn clean test -Dcom.kepler.test.maintest.in=[...]/modules/client/case/3/case
        • 执行case.json对应测试([...]需要替换为实际路径)
      • 服务响应将(默认)输出至[...]/modules/client/case/3/case-out.json
    • 内置测试 需启动kepler-test-demo/service

      • mvn clean test -Dcom.kepler.test.maintest.in=[...]/modules/client/case/1/case

      • mvn clean test -Dcom.kepler.test.maintest.in=[...]/modules/client/case/2/case

      • mvn clean test -Dcom.kepler.test.maintest.in=[...]/modules/client/case/3/case

      • mvn clean test -Dcom.kepler.test.maintest.in=[...]/modules/client/case/4/case

  • 参数配置
    • 用例路径
      • com.kepler.test.MainTest.in
        String型。测试用请求服务部分(Json)的加载路径。@See[加载路径的支持格式]
      • com.kepler.test.MainTest.out
        String型。测试用服务响应部分(Json)的输出加载路径。默认为com.kepler.test.MainTest.in同级目录
      • com.kepler.test.MainTest.stuffix_in
        String型。com.kepler.test.MainTest.in加载路径对应文件后缀名。默认为.json
      • com.kepler.test.MainTest.stuffix_out
        String型。com.kepler.test.MainTest.out加载路径对应文件后缀名。默认为-out.json
    • JSON
      • com.kepler.test.MainTest.date_format
        String型。JSON中的日期格式。默认为yyyy-MM-dd HH:mm:ss

About

Kepler Test Framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published