×

Loading...
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。

So far, with all others' advice, my final goal is to have a automatic integration test with JBoss and Maven. Please click into it for details.

I have developed a small client based on Junit to simulate and generate
multithreaded requests to target server.

There are several potential options:
1. In Maven integration test phase, using Maven plugin cargo to deploy/start
/test/stop/undeploy in Jboss.

2. Using Cactus framework to have in-container test.

3. Develop sophisticated mock objects to simulate real container.

I prefer to option 1 as it is easy and save my time as I only have two weeks
for my commitment. Option 2 bring me a new framework and there is learning
curve. I was told the Cactus configuration is not easy. So far, I do not
consider option 3 as the time dose not fit me.

Does anyone has more suggestions? Great thanks in advanced.
Report

Replies, comments and Discussions:

  • 工作学习 / 学科技术讨论 / 请教高手如何用JUnit模拟真实的Servlet容器 (e.g. Jboss里的tomcat), 具体需求请进
    1. 用Junit模拟多线程Servlet访问
    2. 模拟真实Servlet容器处理多线程Servlet访问但不依赖容器
    大概就是模拟完全production环境。

    请问各位高手们有什么建议? 谢谢。
    • 我是眼高手低 可以用easymock 或者 spring mock去做 外部环境的模拟
      • ysysning谢谢你的建议,这是目前最贴近真实环境的模拟方式,但是要模拟真实的容器方案比较复杂,请问有没有详细的实施建议。先谢谢。
        • junit的目的是在最简单的可以预知环境下测试最简单的部件 倘若你要最接近的复杂环境 干脆就用真实容器好了 为什么又要贴近真实? 大概你要的不是unit test
          • 你说的没错,我要做的是要在unit test中模拟最真实环境甚至要把真实容器拉进来测试。这是我的试用期第一件工作,请各位为小弟出点主意。
      • 由于时间关系(只有两个星期)我现在想用Cactus模拟in-container,同时把jboss拉进来测试。因为要用mock objects (out-container方法)去模拟完整的container需时长复杂度高。大家有什么看法?
      • So far, with all others' advice, my final goal is to have a automatic integration test with JBoss and Maven. Please click into it for details.
        I have developed a small client based on Junit to simulate and generate
        multithreaded requests to target server.

        There are several potential options:
        1. In Maven integration test phase, using Maven plugin cargo to deploy/start
        /test/stop/undeploy in Jboss.

        2. Using Cactus framework to have in-container test.

        3. Develop sophisticated mock objects to simulate real container.

        I prefer to option 1 as it is easy and save my time as I only have two weeks
        for my commitment. Option 2 bring me a new framework and there is learning
        curve. I was told the Cactus configuration is not easy. So far, I do not
        consider option 3 as the time dose not fit me.

        Does anyone has more suggestions? Great thanks in advanced.