Issue #2260: Make ConfigurationLoader.loadConfiguration public
This commit is contained in:
parent
3feab62232
commit
cdb6546adb
|
|
@ -219,7 +219,7 @@ public final class ConfigurationLoader {
|
|||
* @return the check configurations
|
||||
* @throws CheckstyleException if an error occurs
|
||||
*/
|
||||
private static Configuration loadConfiguration(InputSource configSource,
|
||||
public static Configuration loadConfiguration(InputSource configSource,
|
||||
PropertyResolver overridePropsResolver, boolean omitIgnoredModules)
|
||||
throws CheckstyleException {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ import java.util.Properties;
|
|||
|
||||
import org.junit.Test;
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.InputSource;
|
||||
|
||||
import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
|
|
@ -410,6 +411,19 @@ public class ConfigurationLoaderTest {
|
|||
assertEquals(0, children[0].getChildren().length);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConfigWithIgnoreUsingInputSource() throws CheckstyleException {
|
||||
|
||||
final DefaultConfiguration config =
|
||||
(DefaultConfiguration) ConfigurationLoader.loadConfiguration(new InputSource(
|
||||
new File("src/test/resources/com/puppycrawl/tools/checkstyle/configs/"
|
||||
+ "config_with_ignore.xml").toURI().toString()),
|
||||
new PropertiesExpander(new Properties()), true);
|
||||
|
||||
final Configuration[] children = config.getChildren();
|
||||
assertEquals(0, children[0].getChildren().length);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConfigCheckerWithIgnore() throws CheckstyleException {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue