    1   package test.net.sourceforge.pmd;
    2
    3   import junit.framework.TestCase;
    4   import net.sourceforge.pmd.SimpleRuleSetNameMapper;
    5
    6   public class SimpleRuleSetNameMapperTest extends TestCase {
    7
    8       public void testMultipleSimple() {
    9           SimpleRuleSetNameMapper s = new SimpleRuleSetNameMapper("unusedcode,basic");
    10          assertEquals("rulesets/unusedcode.xml,rulesets/basic.xml", s.getRuleSets());
    11      }
    12
    13      public void testOneSimple() {
    14          SimpleRuleSetNameMapper s = new SimpleRuleSetNameMapper("basic");
    15          assertEquals("rulesets/basic.xml", s.getRuleSets());
    16      }
    17
    18      public void testMultipleRegular() {
    19          SimpleRuleSetNameMapper s = new SimpleRuleSetNameMapper("rulesets/unusedcode.xml,rulesets/basic.xml");
    20          assertEquals("rulesets/unusedcode.xml,rulesets/basic.xml", s.getRuleSets());
    21      }
    22
    23      public void testOneRegular() {
    24          SimpleRuleSetNameMapper s = new SimpleRuleSetNameMapper("rulesets/unusedcode.xml");
    25          assertEquals("rulesets/unusedcode.xml", s.getRuleSets());
    26      }
    27
    28      public void testMix() {
    29          SimpleRuleSetNameMapper s = new SimpleRuleSetNameMapper("rulesets/unusedcode.xml,basic");
    30          assertEquals("rulesets/unusedcode.xml,rulesets/basic.xml", s.getRuleSets());
    31      }
    32
    33      public void testUnknown() {
    34          SimpleRuleSetNameMapper s = new SimpleRuleSetNameMapper("favorites.xml");
    35          assertEquals("favorites.xml", s.getRuleSets());
    36      }
    37
    38      public void testUnknownAndSimple() {
    39          SimpleRuleSetNameMapper s = new SimpleRuleSetNameMapper("basic,favorites.xml");
    40          assertEquals("rulesets/basic.xml,favorites.xml", s.getRuleSets());
    41      }
    42  }