????λ?????????? >> ??????????
???JUnit??????Java?????е???
???????????? ???????[ 2014/7/10 11:11:57 ] ????????JUnit ??????????
????????????дBDD????????
@Test
public void shouldGetExceptionWhenAgeLessThan0() {
// given
Person person = new Person();
// when
when(person).setAge(-1);
// then
then(caughtException())
.isInstanceOf(IllegalArgumentException.class)
.hasMessage("age is invalid")
.hasNoCause();
}
|
??????????Hamcrest??????????????catch-exception??????????Matcher API??
@Test
public void shouldGetExceptionWhenAgeLessThan0() {
// given
Person person = new Person();
// when
when(person).setAge(-1);
// then
assertThat(caughtException()?? allOf(
instanceOf(IllegalArgumentException.class)
?? hasMessage("age is invalid")
??hasNoCause()));
}
|
??????????????????????????????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
JUnit????????????Junit???????????Junit???????е??????Android?μ?Junit????Android?????Junit???е??????JUnit??д??????????????С??Junit??????????github?????JUnit???????????????????????JUnit3.8??Spring 4.0 JUnit????Controller??????????Junit????????Myeclipse???JUnit???е??????Maven???Junit???е??????Linux??Junit????????????????????????Junit Test Suite?????????????Jenkins+Ant+Java+Junit+SVN??????SpringMVC????Junit????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????