@RunWith(ParallelParameterized.class)
public class RoutingResponseShortRegressionOneByOne {
private int numberOfProcessedRequests;
private Object currentRequestIndexLock = new Object();
@Test
public void compareNewResponseToBaselineReturnsNoLargeDifferences() throws IOException {
int currentRequestIndex;
synchronized (currentRequestIndexLock) {
//currentRequestIndex = e2EResultShort.completeRoutingResponses.size();
currentRequestIndex = numberOfProcessedRequests;
numberOfProcessedRequests++;
}
我尝试运行此代码
我在每次运行中都看到numberOfProcessedRequests == 0
,并且没有像我期望的那样增加。
它是ParallelParameterized Test
。
为什么要为每个输入创建一个新的Test Class实例?
我看到ctor只被召唤一次。
是否有不同的方法为每个输入并行运行测试并仍然按输入顺序维护结果的顺序?