????????????????????ò????·
???????????? ???????[ 2015/11/26 14:09:50 ] ??????????????? ???????
?????????????ж????????????????в????????????????????controller?е????????????
?????????????????????
???????????????????????????????÷??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????е?????????????????????У????????????????????????????????????в???????????????????????????????????????????????????????????????У??????????????????????????????????????????????????????????????????????Э????
??????Java?????У?Spring?????Java EE?????????????????????????????????????????API?????????JDBC????????????????????Spring??Java EE???п???????ó???????????????У???????????н??в???????????????????????????????????????????????С?
???????????????????У????????????????в?????????????в????
????Spring????????????autowiring?????????????????
??????model?ж?PetType????????populatePetTypes()????
????URL???????????controller????????????????@RequestMapping
??????HTTP???ж?Pet????????????@SessionAttributes("pet")???
?????????????
????????????????????“?????????”??????????????????Щ??????????????????????Spring????????????????????????????????????Java EE????????????????Arquillian???????????????????????С???????Java EE????ó????д??????????????????????CDI????Arquillian????????????Щ????????????????Щ??????????????????????????????Pet Clinic?????????????????????Щ????????????????
????Spring?е?JUnit????
????????JUnit???????????????????????????????????????Spring?????????????JUnit???????????????????????????Spring??????????????????????@RunWith?????????????
????@RunWith(SpringJUnit4ClassRunner.class)
????public class PetControllerIT { ... }Spring????????????????????????????????????XML?????????????????е?Java“????”??????????????????????????????????????????????????????????????????????????????????????????Щ?????????????????????@ContextConfiguration??????????á?
????@ContextConfiguration("classpath:spring/business-config.xml")
????public class PetControllerIT { ... }??Spring????????????????????ó???Χ??????????????????Щ?????????м????????????????????????????????????????????????@ActiveProfile??????ɡ?
????@ActiveProfiles("jdbc")
????public class PetControllerIT { ... }????JUnit????????Spring bean???????????????????????????Spring MVC controller?????????????и?????????
????Spring?е????web??????
????????web??ó????????Spring??????????????????????????????????е??-???????????е???????web????????controller????????????????????????????а????????????????????????????????repository???????????????????????????????????@ContextHierarchy??????????????????????????????????@ContextConfiguration?????
?????????????????????У?business-config.xml???????????mvc-core-config.xml??????????
????@ContextHierarchy({
????@ContextConfiguration("classpath:spring/business-config.xml")??
????@ContextConfiguration("classpath:spring/mvc-core-config.xml")
????})?????????????@WebAppConfiguration?????????????WebApplicationContext?????????????????????ApplicationContext??
????????controller
??????????а???????????????????ú?web???????????????????????controller???MockMvc???????????е???????????а??????????????
???????Request????????????????Fake??????
???????Request???????????controller???????е???
???????Result???????????????????????????
????MockMvc??????????????MockMvcBuilders?????????????????????????????????????????????controller?????????????????????????????????ó?????????????????????£?????????WebApplicationContext?????????????????????????????????????????ж?????????????????autowire???ɡ?
????@RunWith(SpringJUnit4ClassRunner.class)
????public class PetControllerIT {
????@Autowired
????private WebApplicationContext context;
????}???????????perform(RequestBuilder)??????о????????MockMvc???????????RequestBuilder????????????????MockMvcRequestBuilders?е???????????????????????????????????????????HTTP???????????
?????????£???????????????′???????????/owners/1/pets/new·????GET???á?
????MockMvc mockMvc = MockMvcBuilders.standaloneSetup(PetController.class).build();
????RequestBuilder getNewPet = MockMvcRequestBuilders.get("/owners/1/pets/new");
????mockMvc.perform(getNewPet);??Spring?????ResultMatcher???????????????????????????MockMvc??fluent API??????cookie???????塢???????HTTP??????????Щ???????????м??????????????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
iOS???????mocha??chai??sinon??istanbul???????????????????????????????????????д?????Java????????7??????Android?????????Robolectric3.0????(?)???Kiwi?????????????????????????????????Python?????????????????????????????????????Controller????????д?????????10???????????????????Angular????????????Component??Directive??Pipe ???ServiceAndroid????????????????????????????????--Mockito??????iOS UnitTest???????Vue?????????????????
???·???
??????????????????
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 ??????