2010-01-28 4 views

답변

0

나는 그렇게 생각합니다. 컨트롤러에 대한 jUnit 테스트를 작성한 적이 있습니까? 요청과 응답을 조롱하면이를 수행하는 한 가지 방법이됩니다.
또 다른 방법은 브라우저를 HttpClient를 사용하여 시뮬레이션입니다 :

GetMethod get = new GetMethod("http://httpcomponents.apache.org"); 
    // execute method and handle any error responses. 
    ... 
    InputStream in = get.getResponseBodyAsStream(); 
    // Process the data from the input stream. 
    get.releaseConnection(); 

이 코드는이 page에서입니다.

관련 문제