【问题标题】:Spring autowire anotation in jmeterjmeter中的Spring自动装配注释
【发布时间】:2013-09-30 21:10:17
【问题描述】:

我正在尝试使用 jmeter 在 Spring 应用程序上运行一些性能测试用例。 我知道在 jmeter 中,spring 注释不起作用,例如

@ContextConfiguration and @Autowired

我是通过获取 ApplicationContext 然后获取 Bean 来完成的。

但是,还有其他解决方法吗,因为我有一个非常大的 Base 类,其中包含很多

@Autowired instance variables and lot of dependencies.

提前致谢。

【问题讨论】:

    标签: java spring jmeter junit4 performance-testing


    【解决方案1】:

    我对 JMeter 不熟悉,但我认为您可以将 JMeter 测试用例视为一个独立的 Spring 应用程序,您可以在其中加载 ApplicationContext 一次,然后您的所有 Spring Bean 都将可用。

    看到这个踏板:Using Spring 3 autowire in a standalone Java application

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 2011-03-10
      • 2014-06-30
      • 1970-01-01
      • 1970-01-01
      • 2012-08-03
      • 2015-04-27
      • 1970-01-01
      • 2015-05-27
      • 1970-01-01
      相关资源
      最近更新 更多