Ejemplo n.º 1
0
 private CatchExceptionTest createTest() {
   if (!Helper.IS_THOROUGH) {
     return new CatchExceptionTest(
         TestCase.CONSTRUCTORS.get(constructor++).get(), Helper.RNG.nextBoolean(), args, dropArgs);
   } else {
     if (isVararg) {
       isVararg = false;
       return new CatchExceptionTest(
           TestCase.CONSTRUCTORS.get(constructor++).get(), isVararg, args, dropArgs);
     } else {
       isVararg = true;
       return new CatchExceptionTest(
           TestCase.CONSTRUCTORS.get(constructor).get(), isVararg, args, dropArgs);
     }
   }
 }
Ejemplo n.º 2
0
 private static List<CatchExceptionTest> createTests(int argsCount, int catchDrops) {
   if (catchDrops > argsCount || argsCount < 0 || catchDrops < 0) {
     throw new IllegalArgumentException(
         "argsCount = " + argsCount + ", catchDrops = " + catchDrops);
   }
   List<CatchExceptionTest> result = new ArrayList<>(TestCase.CONSTRUCTORS.size());
   for (Supplier<TestCase> constructor : TestCase.CONSTRUCTORS) {
     result.add(
         new CatchExceptionTest(constructor.get(), /* isVararg = */ true, argsCount, catchDrops));
     result.add(
         new CatchExceptionTest(constructor.get(), /* isVararg = */ false, argsCount, catchDrops));
   }
   return result;
 }
Ejemplo n.º 3
0
  public TestFactory() {
    if (Helper.IS_THOROUGH) {
      maxArgs = maxDrops = CatchExceptionTest.MAX_ARITY;
    } else {
      maxArgs =
          MIN_TESTED_ARITY
              + Helper.RNG.nextInt(CatchExceptionTest.MAX_ARITY - MIN_TESTED_ARITY)
              + 1;
      maxDrops = MIN_TESTED_ARITY + Helper.RNG.nextInt(maxArgs - MIN_TESTED_ARITY) + 1;
      args = 1;
    }

    if (Helper.IS_VERBOSE) {
      System.out.printf("maxArgs = %d%nmaxDrops = %d%n", maxArgs, maxDrops);
    }
    constructorSize = TestCase.CONSTRUCTORS.size();
  }