???????д??????????????????????????Щ????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?У??????????????????ɡ?