    1   package test.net.sourceforge.pmd.jsp.rules;
    2
    3   import net.sourceforge.pmd.Rule;
    4   import net.sourceforge.pmd.RuleSetFactory;
    5   import net.sourceforge.pmd.SourceType;
    6   import test.net.sourceforge.pmd.testframework.SimpleAggregatorTst;
    7   import test.net.sourceforge.pmd.testframework.TestDescriptor;
    8
    9   /***
    10   * Test the "NoJspForward" rule.
    11   *
    12   * @author pieter_van_raemdonck - Application Engineers NV/SA - www.ae.be
    13   */
    14  public class NoJspForwardTest extends SimpleAggregatorTst {
    15
    16      public void testViolation() throws Exception {
    17          Rule rule = new RuleSetFactory().createSingleRuleSet("rulesets/basic-jsp.xml").getRuleByName("NoJspForward");
    18          runTests(new TestDescriptor[]{
    19              new TestDescriptor(VIOLATION, "A violation.", 1, rule)
    20          }, SourceType.JSP);
    21      }
    22
    23
    24      private static final String VIOLATION
    25              = "<jsp:forward page='UnderConstruction.jsp'/>";
    26  }