Testing 使用JMeter对Camel路由的JUnit测试用例进行负载测试

Testing 使用JMeter对Camel路由的JUnit测试用例进行负载测试,testing,junit,jmeter,apache-camel,routes,Testing,Junit,Jmeter,Apache Camel,Routes,我正在扩展org.apache.camel.test.junit4.CamelSpringTestSupport.CamelSpringTestSupport,为camel路由编写单元测试;它们作为maven构建的一部分运行。现在我想使用JMeter对它们进行负载测试。有什么好的指针吗?确保将必要的jar放在lib中,测试jar文件应该放在lib中 jmeter/lib/junit而不是/lib目录文件夹 阅读: 当使用JUnit 4时,类不需要扩展TestCase,如您所见: 我注意到我通过扩

我正在扩展org.apache.camel.test.junit4.CamelSpringTestSupport.CamelSpringTestSupport,为camel路由编写单元测试;它们作为maven构建的一部分运行。现在我想使用JMeter对它们进行负载测试。有什么好的指针吗?

确保将必要的jar放在lib中,测试jar文件应该放在lib中 jmeter/lib/junit而不是/lib目录文件夹

阅读:

当使用JUnit 4时,类不需要扩展TestCase,如您所见:


我注意到我通过扩展org.apache.camel.test.junit4.CamelSpringTestSupport编写的JUnit测试用例没有加载到JUnitRequest采样器中。为了进行测试,我编写了一个JUnit测试类,扩展了JUnit.framework.TestCase,它成功地加载了它。这里有什么好的指针吗?jmeter.log文件中没有错误,但我看到了安装程序,从扩展junit.framework.TestCase的测试用例中删除了方法日志。我还从你分享的链接中读到了“1”。它不使用Jmeter的测试接口,而是扫描jar文件以查找扩展junit的TestCase类的类。因此我认为这可能是JMeter不支持扩展org.apache.camel.test.junit4.CamelSpringTestSupport的其他测试用例的原因,因为该类不扩展junit.framework.testcase在测试类中是否使用注释这里是导入和测试类摘录,抱歉,没有正确的缩进:import org.apache.camel.Exchange;导入org.apache.camel.test.junit4.CamelSpringTestSupport;导入org.junit.Before;导入org.junit.Test;导入org.springframework.context.support.AbstractApplicationContext;导入org.springframework.context.support.ClassPathXmlApplicationContext;公共类RouteTest扩展了SpringTestSupport{…}更新您的问题,我没有看到任何注释