Best design to organize HttpUnit+junit as standalone app.

I have a task to write a set of http unit tests, which should be deployed and started as single threaded application on external server. After some investigation and reading of documentation I came to following application structure: public static void main(String... args) throws Exception { Class[] testCases = { LoginTest.class, Test2.class, Test3.class }; TestSuite suite = new TestSuite(testCases); TestResult result = new TestResult(); suite.run(result); displayResults(result); } And testcase looks like: public class LoginPageTest extends TestCase { public void testLogin() throws IOException, SAXException { WebConversation wc = new WebConversation(); //Some HttpUnit init code here loginForm.setParameter("j_username", login); loginForm.setParameter("j_password", pass); loginForm.submit(); String expected = String.format("/%s/action/logon.do", endpoint); assertEquals(wc.getCurrentPage().getURL().getPath(), expected); } } Has anyone made similar tasks ? Have you some advices than can improve this structure? How can I implement dependency between testcases (e.g. almost everything needs that user should be authenticated -> loginTestCase must be called) ? Any advice greatly appreciated ! Thanks in advance.

以上就是Best design to organize HttpUnit+junit as standalone app.的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏