    1   /***
    2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
    3    */
    4   package test.net.sourceforge.pmd.testframework;
    5
    6   import net.sourceforge.pmd.SourceType;
    7
    8   public class SimpleAggregatorTst extends RuleTst {
    9
    10      public void runTests(TestDescriptor[] tests) {
    11          runTests(tests, DEFAULT_SOURCE_TYPE);
    12      }
    13
    14      /***
    15       * Run a set of tests.
    16       *
    17       * @param tests
    18       */
    19      public void runTests(TestDescriptor[] tests, SourceType sourceType) {
    20          for (int i = 0; i < tests.length; i++) {
    21              try {
    22                  runTestFromString(tests[i].code, tests[i].numberOfProblemsExpected,
    23                          tests[i].rule, sourceType);
    24              } catch (Throwable t) {
    25                  t.printStackTrace();
    26                  throw new RuntimeException("Test \"" + tests[i].description
    27                          + "\" failed");
    28              }
    29          }
    30      }
    31
    32  }