java??????????void?????
???????????? ???????[ 2013/1/21 10:40:54 ] ????????
???????д??????????????????????????Щ????void?????????????????????Щ???????У??о????????????????????????????????????????????????????????緽????????throws???????????????????void??????????????????
????????????????????д??????????void???????е????????
1. @Test
2. public void testServeResource() throws Exception {
3. MockWebServer mockWebServer = new MockWebServer();
4. mockWebServer.init();
5. MockResourceRequest request = new MockResourceRequest();
6. request.setParameter("id"?? "4");
7. request.setParameter("name"?? "walmart");
8. MockResourceResponse response = new MockResourceResponse();
9. MockPortletPreferences preferences = new MockPortletPreferences();
10. preferences.setValue(RSLaunchConstants.RS_LAUNCH_PORTLET_PREFERENCE_REST_WS_URL?? "http://localhost:28080/");
11. request.setPreferences(preferences);
12.
13. try{
14. rsLaunchPortlet.serveResource(request?? response);
15. mockWebServer.destory();
16. assertTrue(true);
17. }catch(Exception ex){
18. //normally??the execution should never reach here ??so if reach here ?? we fail this UT
19. assertTrue(false);
20. }
21.}
??????????????????????????13??20??????????????try???????????????????Σ??????????β??????assertTrue(true)??????catch???м???assertTrue(false)????????????????????????????????????У????????????????try???е????е????????????assertTrue(true)???????????????????????????в?????????????14????15???????????????catch???У????????е?19?У??????????????????ɡ?
??????
???·???
??????????????????
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