Unit testing JSPs in embedded mode

后端 未结 2 1957
半阙折子戏
半阙折子戏 2021-01-03 08:19

I am in process of building up a small framework that does unit testing for JSPs. These JSPs have some custom tags, otherwise they are not any special.

Although ther

相关标签:
2条回答
  • 2021-01-03 08:59

    Take a look at HttpUnit - http://httpunit.sourceforge.net/. It comes bundled with ServletUnit which is an in memory servlet engine that will handle JSPs. This should usually only be used to test the View portion of a properly factored MVC application or to do some Integration/Acceptance tests.

    Business logic should be tested directly from the POJOs.

    0 讨论(0)
  • 2021-01-03 09:10

    Here is a example project that run Jettys ServletTester with jsps.

    https://github.com/genthaler/jetty-jsp-unit-test-simple/

    0 讨论(0)
提交回复
热议问题