01: /**
02: * <copyright>
03: * Copyright 1997-2002 InfoEther, LLC
04: * under sponsorship of the Defense Advanced Research Projects Agency
05: (DARPA).
06: *
07: * This program is free software; you can redistribute it and/or modify
08: * it under the terms of the Cougaar Open Source License as published
09: by
10: * DARPA on the Cougaar Open Source Website (www.cougaar.org).
11: *
12: * THE COUGAAR SOFTWARE AND ANY DERIVATIVE SUPPLIED BY LICENSOR IS
13: * PROVIDED 'AS IS' WITHOUT WARRANTIES OF ANY KIND, WHETHER EXPRESS OR
14: * IMPLIED, INCLUDING (BUT NOT LIMITED TO) ALL IMPLIED WARRANTIES OF
15: * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND WITHOUT
16: * ANY WARRANTIES AS TO NON-INFRINGEMENT. IN NO EVENT SHALL COPYRIGHT
17: * HOLDER BE LIABLE FOR ANY DIRECT, SPECIAL, INDIRECT OR CONSEQUENTIAL
18: * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE OF DATA OR PROFITS,
19: * TORTIOUS CONDUCT, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20: * PERFORMANCE OF THE COUGAAR SOFTWARE.
21: * </copyright>
22: */package test.net.sourceforge.pmd;
23:
24: import static org.junit.Assert.assertEquals;
25: import net.sourceforge.pmd.ExternalRuleID;
26:
27: import org.junit.Test;
28:
29: public class ExternalRuleIDTest {
30:
31: @Test
32: public void testSimpleRef() {
33: String xrefString = "rulesets/basic.xml/EmptyCatchBlock";
34: ExternalRuleID xref = new ExternalRuleID(xrefString);
35: assertEquals("Filename mismatch!", "rulesets/basic.xml", xref
36: .getFilename());
37: assertEquals("Rule name mismatch!", "EmptyCatchBlock", xref
38: .getRuleName());
39: }
40:
41: public static junit.framework.Test suite() {
42: return new junit.framework.JUnit4TestAdapter(
43: ExternalRuleIDTest.class);
44: }
45: }
|