网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

IntroductiononUsingHamcrestUnitTestFramework

 Hamcrest is a unit test framework, the assert function assertThat of hamcrest is more human readable comparing to the assert function of Junit, therefore, Junit4 has already adopted and integrated the hamcrest framework from version 4.4 on. Please check following screenshot.

创新互联是一家集网站建设,增城企业网站建设,增城品牌网站建设,网站定制,增城网站建设报价,网络营销,网络优化,增城网站推广为一体的创新建站企业,帮助传统企业提升企业形象加强企业竞争力。可充分满足这一群体相比中小企业更为丰富、高端、多元的互联网需求。同时我们时刻保持专业、时尚、前沿,时刻以成就客户成长自我,坚持不断学习、思考、沉淀、净化自己,让我们为更多的企业打造出实用型网站。

 Introduction on Using Hamcrest Unit Test Framework

 But Junit4 integrates only the core features of hamcrest, in order to facilitate our test automation work, we should add the hamcrest JAR library with all features into our test project.

-         Hamcrest-all-xx.jar          : Contains all feature of hamcrest

-         Hamcreset-core-xx.jar : Contains core feature of hamcrest

We could download hamcrest by following this link:

http://search.maven.org/#search|ga|1|g%3Aorg.hamcrest

Following description would illustrate how to use hamcrest-all in our test project.

Step 1:Drag&drop the hamcrest-all jar package to the libs(Create one if not exist)folder of the project

Introduction on Using Hamcrest Unit Test Framework

Step 2: Import hamcrest modules into test script

Introduction on Using Hamcrest Unit Test Framework

“importstatic org.hamcrest.MatcherAssert.assertThat”:in order to use the function“assertThat”

-  “import static org.hamcrest.Matchers.*”:in order to use the matcher of“is”,”notNullValue”,”equalTo” and so on.

Step 3:Use hamcrest feature in our test script

 Introduction on Using Hamcrest Unit Test Framework

Following are the link on the syntax of asserThat function of hamcrest.

http://langgufu.iteye.com/blog/1893927

-----------------------------------------TheEnd--------------------------------------


新闻名称:IntroductiononUsingHamcrestUnitTestFramework
网站URL:http://bjjierui.cn/article/piojsc.html

其他资讯