我想爲一個java servlet編寫一些功能測試,並且要確保它可以與所有可能會干擾該servlet的過濾器和其他隨機Java web內容一起工作。有沒有一種很好的方法在java中做到這一點?對Java的功能測試
我注意到play framework有一個很好的功能測試方法。
import play.test.*;
import play.mvc.*;
import play.mvc.Http.*;
import org.junit.*;
public class ApplicationTest extends FunctionalTest {
@Test
public void testTheHomePage() {
Response response = GET("/");
assertStatus(200, response);
}
}
http://www.playframework.org/documentation/1.0/test
類似的東西將是巨大的,但我想我得到我的希望。 :)
http://httpunit.sourceforge.net/doc/servletunit-intro.html - >我想是我之後 – benmmurphy 2011-06-16 09:03:17