EasyTest - 一個Java數據驅動測試框架
EasyTest 是一個JUnit擴展,它能夠采用注釋執行數據驅動測試。提供了許多JUnit做不到的功能。
以下EasyTest的一些亮點:
- EasyTest supports passing method parameters to the methods annotated with JUnit's @Test annotation. (Isn't that what we always wanted in the first place.)
- EasyTest supports passing input test data(in different formats like CSV, Excel, XML or Custom Loaders) to the Test class using annotations (for eg. @DataLoader)
- EasyTest supports passing input test data(in different formats like CSV, Excel, XML or Custom Loaders) to the Test method as well using annotations (@DataLoader).
- EasyTest has inbuilt support for Java PropertyEditors. This means that a user can reuse the classes to get concrete user defined objects as part of the test parameters. In case of standard primitive types(like int , long, String etc) you don't even have to register any property editors as they are supported by default.
- EasyTest also supports custom converters, in cases where PropertyEditor support is not enough.
- EasyTest supports custom loaders for parsing user defined input test data file in case our existing data loader support is not enough. So a user can provide its input test data in, lets say JSON format and then write its own loader to load the test data. This gives a lot of flexibility to the end users.
- EasyTest also supports returning output data from the test method and capturing it in the same file from which the input was provided.
- EasyTest supports a mechanism where you can intercept calls to your class under test and do things before or after the method has been tested. This is extremely useful in cases where for example you want to measure the time taken by your test method. EasyTest supports it by default and if you enable @Intercept annotation then it will write the performance measurements in a log file. Obviously, you can provide your own custom implementation of the interceptor and use that instead of the one provided by EasyTest.
- EasyTest supports generating test reports (using Jasper behind the scenes) for your test classes. Reports can be generated in PDF or other formats and can be put at any place in your file system.
- EasyTest supports Spring Integration Testing. Now you can write Data Driven Integration tests using EasyTest's support classes for Spring.
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!