From 4564aecb5c1d694591feef433ce067d74e36d823 Mon Sep 17 00:00:00 2001 From: Rick Giles Date: Mon, 16 Dec 2002 00:22:14 +0000 Subject: [PATCH] Changed configuration XML element "config" to "module". Dropped suffix "Check" in Check configurations. --- docs/checkstyle_checks.xml | 138 +++++++++--------- .../tools/checkstyle/ConfigurationLoader.java | 4 +- .../tools/checkstyle/configuration_1_0.dtd | 6 +- .../checkstyle/configs/checkstyle_checks.xml | 36 ++--- .../configs/empty_configuration.xml | 6 +- .../configs/missing_config_name.xml | 6 +- .../configs/missing_config_parent.xml | 2 +- .../configs/missing_property_name.xml | 6 +- .../configs/missing_property_value.xml | 6 +- .../checkstyle/ConfigurationLoaderTest.java | 20 +-- 10 files changed, 115 insertions(+), 115 deletions(-) diff --git a/docs/checkstyle_checks.xml b/docs/checkstyle_checks.xml index 0674dc6fb..a2e9ccb57 100644 --- a/docs/checkstyle_checks.xml +++ b/docs/checkstyle_checks.xml @@ -1,99 +1,99 @@ - - + - + - + - - - - - - - + + + + + + + - + - - - - - - - + + + + + + + - - + + - + - + - - - + + + - - + + - - - - - - - - + + + + + + + + - - + + - - + + - + - + - + - - - + + + - - - - - - - + + + + + + + - - - - + + + + - - - + + + - - - - - - - - - + + + + + + + + + diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/ConfigurationLoader.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/ConfigurationLoader.java index 6f33f32e0..6ac8acce6 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/ConfigurationLoader.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/ConfigurationLoader.java @@ -93,7 +93,7 @@ class ConfigurationLoader throws SAXException { // TODO: debug logging for support puposes - if (aQName.equals("config")) { + if (aQName.equals("module")) { //create configuration final String name = aAtts.getValue("name"); final DefaultConfiguration conf = new DefaultConfiguration(name); @@ -134,7 +134,7 @@ class ConfigurationLoader String aLocalName, String aQName) { - if (aQName.equals("config")) { + if (aQName.equals("module")) { mConfigStack.pop(); } } diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/configuration_1_0.dtd b/src/checkstyle/com/puppycrawl/tools/checkstyle/configuration_1_0.dtd index f06c1bc4d..d1d8ae27d 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/configuration_1_0.dtd +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/configuration_1_0.dtd @@ -2,14 +2,14 @@ - - + + - - + - - - + + + - + - - - - - + + + + + - - + + - - - - - \ No newline at end of file + + + + + \ No newline at end of file diff --git a/src/testinputs/com/puppycrawl/tools/checkstyle/configs/empty_configuration.xml b/src/testinputs/com/puppycrawl/tools/checkstyle/configs/empty_configuration.xml index f24f486c2..beaac0ab8 100644 --- a/src/testinputs/com/puppycrawl/tools/checkstyle/configs/empty_configuration.xml +++ b/src/testinputs/com/puppycrawl/tools/checkstyle/configs/empty_configuration.xml @@ -1,8 +1,8 @@ - - - + + diff --git a/src/testinputs/com/puppycrawl/tools/checkstyle/configs/missing_config_name.xml b/src/testinputs/com/puppycrawl/tools/checkstyle/configs/missing_config_name.xml index 274b1c430..4f554b173 100644 --- a/src/testinputs/com/puppycrawl/tools/checkstyle/configs/missing_config_name.xml +++ b/src/testinputs/com/puppycrawl/tools/checkstyle/configs/missing_config_name.xml @@ -1,9 +1,9 @@ - - + - + diff --git a/src/testinputs/com/puppycrawl/tools/checkstyle/configs/missing_config_parent.xml b/src/testinputs/com/puppycrawl/tools/checkstyle/configs/missing_config_parent.xml index adf572567..bec219ab9 100644 --- a/src/testinputs/com/puppycrawl/tools/checkstyle/configs/missing_config_parent.xml +++ b/src/testinputs/com/puppycrawl/tools/checkstyle/configs/missing_config_parent.xml @@ -1,6 +1,6 @@ - diff --git a/src/testinputs/com/puppycrawl/tools/checkstyle/configs/missing_property_name.xml b/src/testinputs/com/puppycrawl/tools/checkstyle/configs/missing_property_name.xml index f644c4c45..446ef243a 100644 --- a/src/testinputs/com/puppycrawl/tools/checkstyle/configs/missing_property_name.xml +++ b/src/testinputs/com/puppycrawl/tools/checkstyle/configs/missing_property_name.xml @@ -1,9 +1,9 @@ - - + - + diff --git a/src/testinputs/com/puppycrawl/tools/checkstyle/configs/missing_property_value.xml b/src/testinputs/com/puppycrawl/tools/checkstyle/configs/missing_property_value.xml index b059e11f8..36a936f5f 100644 --- a/src/testinputs/com/puppycrawl/tools/checkstyle/configs/missing_property_value.xml +++ b/src/testinputs/com/puppycrawl/tools/checkstyle/configs/missing_property_value.xml @@ -1,9 +1,9 @@ - - + - + diff --git a/src/tests/com/puppycrawl/tools/checkstyle/ConfigurationLoaderTest.java b/src/tests/com/puppycrawl/tools/checkstyle/ConfigurationLoaderTest.java index 5ce6ae18c..e5edd23f1 100644 --- a/src/tests/com/puppycrawl/tools/checkstyle/ConfigurationLoaderTest.java +++ b/src/tests/com/puppycrawl/tools/checkstyle/ConfigurationLoaderTest.java @@ -33,7 +33,7 @@ public class ConfigurationLoaderTest extends TestCase { final DefaultConfiguration config = (DefaultConfiguration) loadConfiguration("empty_configuration.xml"); - verifyConfigNode(config, "configuration", 0, new Properties()); + verifyConfigNode(config, "Checker", 0, new Properties()); } public void testMissingPropertyName() @@ -68,13 +68,13 @@ public class ConfigurationLoaderTest extends TestCase { try { loadConfiguration("missing_config_name.xml"); - fail("missing config name"); + fail("missing module name"); } catch (CheckstyleException ex) { assertTrue( ex.getMessage().endsWith( "Attribute \"name\" is required and must be specified " - + "for element type \"config\".")); + + "for element type \"module\".")); } } @@ -82,13 +82,13 @@ public class ConfigurationLoaderTest extends TestCase { try { loadConfiguration("missing_config_parent.xml"); - fail("missing config parent"); + fail("missing module parent"); } catch (CheckstyleException ex) { assertTrue( ex.getMessage().endsWith( "Document root element \"property\", must match DOCTYPE " - + "root \"config\".")); + + "root \"module\".")); } } @@ -105,15 +105,15 @@ public class ConfigurationLoaderTest extends TestCase final Properties atts = new Properties(); atts.put("tabWidth", "4"); atts.put("basedir", "basedir"); - verifyConfigNode(config, "configuration", 3, atts); + verifyConfigNode(config, "Checker", 3, atts); //verify children final Configuration[] children = config.getChildren(); atts.clear(); verifyConfigNode( - (DefaultConfiguration) children[1], "PackageHtmlCheck", 0, atts); + (DefaultConfiguration) children[1], "PackageHtml", 0, atts); verifyConfigNode( - (DefaultConfiguration) children[2], "TranslationCheck", 0, atts); + (DefaultConfiguration) children[2], "Translation", 0, atts); atts.put("testName", "testValue"); verifyConfigNode( (DefaultConfiguration) children[0], @@ -132,7 +132,7 @@ public class ConfigurationLoaderTest extends TestCase atts.put("format", "System.out.println"); verifyConfigNode( (DefaultConfiguration) grandchildren[grandchildren.length - 1], - "GenericIllegalRegexpCheck", + "GenericIllegalRegexp", 0, atts); atts.clear(); @@ -140,7 +140,7 @@ public class ConfigurationLoaderTest extends TestCase atts.put("allowLineBreaks", "true"); verifyConfigNode( (DefaultConfiguration) grandchildren[6], - "NoWhitespaceAfterCheck", + "NoWhitespaceAfter", 0, atts); }