Jakarta ee Arquillian-ContiPerf集成
我已经成功地在ContiPerf 2上开发了一个玩具单元测试。 当我尝试在Arquillian单元测试上执行同样的操作时,ContiPerf注释Jakarta ee Arquillian-ContiPerf集成,jakarta-ee,automated-tests,performance-testing,jboss-arquillian,contiperf,Jakarta Ee,Automated Tests,Performance Testing,Jboss Arquillian,Contiperf,我已经成功地在ContiPerf 2上开发了一个玩具单元测试。 当我尝试在Arquillian单元测试上执行同样的操作时,ContiPerf注释@PerfTest似乎不起作用,而注释@Required运行正常。 我的测试课看起来像 @RunWith(Arquillian.class) public class PerformanceFacadeBeanTest { @Rule public ContiPerfRule i = new ContiPerfRule();
@PerfTest
似乎不起作用,而注释@Required
运行正常。
我的测试课看起来像
@RunWith(Arquillian.class)
public class PerformanceFacadeBeanTest {
@Rule
public ContiPerfRule i = new ContiPerfRule();
@EJB
private PerformanceFacadeRemote performanceRemote;
@Deployment
public static Archive<EnterpriseArchive> createArchive() {
...
}
@Test
@InSequence(value=1)
@PerfTest(invocations = 100, threads = 5)
@Required(max = 1200, average = 250)
public void testPerformanceOnCacheLocal() {
testPerformanceOnCache(performanceLocal);
}
private void testPerformanceOnCache(PerformanceFacade performanceFacade) {
performanceFacade.performOnCache();
}
}
有什么想法吗?
如果需要,我可以发布我的pom.xml。目前,您不能将ContiPerf2与Arquillian一起使用。目前,Arquillian使用
ThreadLocal
实例进行簿记,而ContiPerf规则生成的线程无法使用这些实例。因此,NullPointerException
,因为Arquillian testrunner可能无法在除一个线程之外的所有线程中找到ThreadLocal实例。Arquillian的这种行为可能会在未来的版本中发生变化;但在这方面没有承诺
我建议现在就使用,因为据报道,通过自定义Arquillian扩展,它可以正常工作。基于
org.databene.contiperf.PerfTestExecutionError: org.junit.internal.runners.model.MultipleFailureException: There were 2 errors:
java.lang.NullPointerException(null)
java.lang.NullPointerException(null)
at org.databene.contiperf.util.ContiPerfUtil.executionError(ContiPerfUtil.java:66)
at org.databene.contiperf.junit.JUnitInvoker.invoke(JUnitInvoker.java:54)
at org.databene.contiperf.util.InvokerProxy.invoke(InvokerProxy.java:46)
at org.databene.contiperf.PerformanceTracker.invoke(PerformanceTracker.java:97)
at org.databene.contiperf.CountRunner.run(CountRunner.java:52)
at java.lang.Thread.run(Thread.java:722)