    1   package test.net.sourceforge.pmd.jsp.rules;
    2
    3   import net.sourceforge.pmd.Rule;
    4   import net.sourceforge.pmd.SourceType;
    5   import net.sourceforge.pmd.jsp.rules.NoInlineStyleInformation;
    6   import test.net.sourceforge.pmd.testframework.SimpleAggregatorTst;
    7   import test.net.sourceforge.pmd.testframework.TestDescriptor;
    8
    9   public class NoInlineStyleInformationTest extends SimpleAggregatorTst {
    10
    11      public void testAll() {
    12          Rule rule = new NoInlineStyleInformation();
    13          runTests(new TestDescriptor[]{
    14              new TestDescriptor(JSP_VIOLATION1, "A <B> element.", 1, rule),
    15              new TestDescriptor(JSP_VIOLATION2, "A font and align attribute.", 2, rule),
    16              new TestDescriptor(JSP_NO_VIOLATION1, "No violations.", 0, rule),
    17          }, SourceType.JSP);
    18      }
    19
    20      private static final String JSP_VIOLATION1 =
    21              "<html><body><b>text</b></body></html>";
    22
    23      private static final String JSP_VIOLATION2 =
    24              "<html><body><p font='arial' align='center'>text</p></body></html>";
    25
    26      private static final String JSP_NO_VIOLATION1 =
    27              "<html><body><p>text</p></body></html>";
    28  }