View Javadoc

1   /**
2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3    */
4   package net.sourceforge.pmd.renderers;
5   
6   import junit.framework.Assert;
7   import net.sourceforge.pmd.Report;
8   import net.sourceforge.pmd.ReportTest;
9   import net.sourceforge.pmd.RuleContext;
10  import net.sourceforge.pmd.RuleViolation;
11  import net.sourceforge.pmd.lang.java.rule.JavaRuleViolation;
12  
13  import org.junit.Test;
14  
15  /**
16   * @author Andreas Dangel
17   *
18   */
19  public class XSLTRendererTest {
20  
21      @Test
22      public void testDefaultStylesheet() throws Exception {
23          XSLTRenderer renderer = new XSLTRenderer();
24          Report report = new Report();
25          RuleViolation rv = new JavaRuleViolation(new ReportTest.FooRule(), new RuleContext(),
26                  ReportTest.getNode(1, 1, "some scope"),
27                  "violation message");
28          report.addRuleViolation(rv);
29          String result = ReportTest.render(renderer, report);
30          Assert.assertTrue(result.contains("violation message"));
31      }
32  }