File tree 1 file changed +6
-10
lines changed
android-plugin/src/test/java/org/sonar/plugins/groovy
1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change 43
43
public class GroovySonarWayProfileTest {
44
44
45
45
@ Test
46
- public void shouldCreateSonarWayProfile () {
46
+ public void shouldCreateSonarWayProfile () throws ParserConfigurationException , IOException , SAXException {
47
47
ValidationMessages messages = ValidationMessages .create ();
48
48
49
49
GroovySonarWayProfile profileDef = new GroovySonarWayProfile ();
@@ -57,15 +57,11 @@ public void shouldCreateSonarWayProfile() {
57
57
File profile_default = new File ("src/main/resources/org/sonar/plugins/groovy/rules.xml" );
58
58
DocumentBuilderFactory dbf = DocumentBuilderFactory .newInstance ();
59
59
DocumentBuilder db ;
60
- try {
61
- db = dbf .newDocumentBuilder ();
62
- Document doc = db .parse (profile_default );
63
- doc .getDocumentElement ().normalize ();
64
- NodeList rule = doc .getElementsByTagName ("rule" );
65
- assertThat (activeRules ).as ("Expected number of rules in profile" ).hasSize (rule .getLength ());
66
- } catch (ParserConfigurationException | SAXException | IOException e ) {
67
- e .printStackTrace ();
68
- }
60
+ db = dbf .newDocumentBuilder ();
61
+ Document doc = db .parse (profile_default );
62
+ doc .getDocumentElement ().normalize ();
63
+ NodeList ruleList = doc .getElementsByTagName ("rule" );
64
+ assertThat (activeRules ).as ("Expected number of rules in profile" ).hasSize (ruleList .getLength ());
69
65
assertThat (profile .name ()).isEqualTo (Groovy .PROFILE_NAME );
70
66
71
67
// Check that we use severity from the read rule and not default one.
You can’t perform that action at this time.
0 commit comments