测试工具中的设计模式实例谈 - 适配器模式(Adapter)

还是以TestLInk为例,这次要介绍的是Kinow写的testlink-java-api这套API。它通过Adapter模式,把原先需要应用XML-RPC接口进行通讯,通过map方式来组织入参的方式转换成了非常纯粹的JAVA 类/方法的调用,极大地降低了接口调用的复杂程度。
再配合上门面模式,就可以在一套API中完成所有的Test Link的操作了(当然很多功能其实未开放)

Another important thing is that behind the scenes we are using xml-rpc to communicate with TestLink. However you won't see any xml or even a Map/HashMap when using TestLink Java API (ok, maybe in only one method :-).

https://github.com/kinow/testlink-java-api/blob/master/src/main/java/br/eti/kinoshita/testlinkjavaapi/TestPlanService.java

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容