当前位置: 首页>>代码示例>>Java>>正文


Java CommonUtils.EMPTY_STRING_ARRAY属性代码示例

本文整理汇总了Java中com.puppycrawl.tools.checkstyle.utils.CommonUtils.EMPTY_STRING_ARRAY属性的典型用法代码示例。如果您正苦于以下问题:Java CommonUtils.EMPTY_STRING_ARRAY属性的具体用法?Java CommonUtils.EMPTY_STRING_ARRAY怎么用?Java CommonUtils.EMPTY_STRING_ARRAY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.puppycrawl.tools.checkstyle.utils.CommonUtils的用法示例。


在下文中一共展示了CommonUtils.EMPTY_STRING_ARRAY属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testValidArrayInitDefaultIndentWithChecker

@Test
public void testValidArrayInitDefaultIndentWithChecker()
        throws Exception {
    final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class);

    checkConfig.addAttribute("arrayInitIndent", "4");
    checkConfig.addAttribute("basicOffset", "4");
    checkConfig.addAttribute("braceAdjustment", "0");
    checkConfig.addAttribute("caseIndent", "4");
    checkConfig.addAttribute("forceStrictCondition", "false");
    checkConfig.addAttribute("lineWrappingIndentation", "4");
    checkConfig.addAttribute("tabWidth", "4");
    checkConfig.addAttribute("throwsIndent", "4");
    final String fileName = getPath("InputIndentationValidArrayInitDefaultIndent.java");
    final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
    verifyWarns(checkConfig, fileName, expected);
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:17,代码来源:IndentationCheckTest.java

示例2: testInvalidInvalidAnonymousClass

@Test
public void testInvalidInvalidAnonymousClass() throws Exception {
    final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class);

    checkConfig.addAttribute("arrayInitIndent", "4");
    checkConfig.addAttribute("basicOffset", "4");
    checkConfig.addAttribute("braceAdjustment", "0");
    checkConfig.addAttribute("caseIndent", "4");
    checkConfig.addAttribute("forceStrictCondition", "false");
    checkConfig.addAttribute("lineWrappingIndentation", "4");
    checkConfig.addAttribute("tabWidth", "4");
    checkConfig.addAttribute("throwsIndent", "4");
    final String fileName = getPath("InputIndentationInvalidAnonymousClassIndent.java");
    final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
    verifyWarns(checkConfig, fileName, expected);
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:16,代码来源:IndentationCheckTest.java

示例3: testBundlesWithSameNameButDifferentPaths

@Test
public void testBundlesWithSameNameButDifferentPaths() throws Exception {
    final DefaultConfiguration checkConfig = createModuleConfig(TranslationCheck.class);
    checkConfig.addAttribute("requiredTranslations", "de");
    checkConfig.addAttribute("fileExtensions", "properties");
    checkConfig.addAttribute("baseName", "^.*Labels.*");

    final File[] propertyFiles = {
        new File(getPath("MyLabelsI18.properties")),
        new File(getPath("MyLabelsI18_de.properties")),
        new File(getNonCompilablePath("MyLabelsI18.properties")),
        new File(getNonCompilablePath("MyLabelsI18_de.properties")),
    };

    final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;

    verify(
        createChecker(checkConfig),
        propertyFiles,
        getPath(""),
        expected);
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:22,代码来源:TranslationCheckTest.java

示例4: testInvalidOption

@Test
public void testInvalidOption() throws Exception {
    final DefaultConfiguration checkConfig = createModuleConfig(EmptyBlockCheck.class);
    checkConfig.addAttribute("option", "invalid_option");

    try {
        final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;

        verify(checkConfig, getPath("InputEmptyBlockSemantic.java"), expected);
        fail("exception expected");
    }
    catch (CheckstyleException ex) {
        final String messageStart =
            "cannot initialize module com.puppycrawl.tools.checkstyle.TreeWalker - "
                + "Cannot set property 'option' to 'invalid_option' in module";

        assertTrue("Invalid exception message, should start with: " + messageStart,
            ex.getMessage().startsWith(messageStart));
    }
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:20,代码来源:EmptyBlockCheckTest.java

示例5: testValidDotWithChecker

@Test
public void testValidDotWithChecker()
        throws Exception {
    final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class);

    checkConfig.addAttribute("arrayInitIndent", "4");
    checkConfig.addAttribute("basicOffset", "4");
    checkConfig.addAttribute("braceAdjustment", "0");
    checkConfig.addAttribute("caseIndent", "4");
    checkConfig.addAttribute("forceStrictCondition", "false");
    checkConfig.addAttribute("lineWrappingIndentation", "4");
    checkConfig.addAttribute("tabWidth", "4");
    checkConfig.addAttribute("throwsIndent", "4");
    final String fileName = getPath("InputIndentationValidDotIndent.java");
    final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
    verifyWarns(checkConfig, fileName, expected);
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:17,代码来源:IndentationCheckTest.java

示例6: testMaximumDepth

@Test
public void testMaximumDepth()
        throws Exception {
    final DefaultConfiguration checkConfig =
        createModuleConfig(DescendantTokenCheck.class);
    checkConfig.addAttribute("tokens", "LITERAL_SWITCH");
    checkConfig.addAttribute("limitedTokens", "LITERAL_DEFAULT");
    checkConfig.addAttribute("maximumNumber", "0");
    checkConfig.addAttribute("maximumDepth", "1");
    final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
    verify(checkConfig, getPath("InputDescendantTokenIllegalTokens.java"), expected);
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:12,代码来源:DescendantTokenCheckTest.java

示例7: testLabels

@Test
public void testLabels() throws Exception {
    final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class);

    checkConfig.addAttribute("arrayInitIndent", "4");
    checkConfig.addAttribute("basicOffset", "2");
    checkConfig.addAttribute("braceAdjustment", "0");
    checkConfig.addAttribute("caseIndent", "4");
    checkConfig.addAttribute("forceStrictCondition", "false");
    checkConfig.addAttribute("lineWrappingIndentation", "4");
    checkConfig.addAttribute("tabWidth", "4");
    checkConfig.addAttribute("throwsIndent", "4");
    final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
    verifyWarns(checkConfig, getPath("InputIndentationLabels.java"), expected);
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:15,代码来源:IndentationCheckTest.java

示例8: packageInfoAnnotation

@Test
public void packageInfoAnnotation() throws Exception {
    final DefaultConfiguration checkConfig =
        createModuleConfig(JavadocStyleCheck.class);
    final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;

    verify(createChecker(checkConfig),
           getPath("pkginfo" + File.separator + "annotation" + File.separator
               + "package-info.java"),
           expected);
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:11,代码来源:JavadocStyleCheckTest.java

示例9: testDefault

@Test
public void testDefault()
        throws Exception {
    final DefaultConfiguration checkConfig =
        createModuleConfig(ParameterNameCheck.class);
    final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
    verify(checkConfig, getPath("InputParameterName.java"), expected);
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:8,代码来源:ParameterNameCheckTest.java

示例10: testNullPointerException

@Test
public void testNullPointerException() throws Exception {

    final DefaultConfiguration checkConfig =
        createModuleConfig(AbbreviationAsWordInNameCheck.class);
    checkConfig.addAttribute("allowedAbbreviationLength", "2");
    checkConfig.addAttribute("ignoreFinal", "false");
    checkConfig.addAttribute("allowedAbbreviations", null);

    final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;

    verify(checkConfig,
            getPath("InputAbbreviationAsWordInNameAbstractMultisetSetCount.java"),
            expected);
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:15,代码来源:AbbreviationAsWordInNameCheckTest.java

示例11: testCanParse

@Test
public void testCanParse()
        throws Exception {
    final DefaultConfiguration checkConfig =
        createModuleConfig(MemberNameCheck.class);
    final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
    verify(checkConfig, getPath("InputJava7StringSwitch.java"), expected);
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:8,代码来源:Java7StringSwitchTest.java

示例12: testCanParse

@Test
public void testCanParse()
        throws Exception {
    final DefaultConfiguration checkConfig =
        createModuleConfig(MemberNameCheck.class);
    final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
    verify(checkConfig, getPath("InputVararg.java"), expected);
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:8,代码来源:VarargTest.java

示例13: testCanParse

@Test
public void testCanParse()
        throws Exception {
    final DefaultConfiguration checkConfig =
            createModuleConfig(MemberNameCheck.class);
    final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
    verify(checkConfig, getPath("InputDefaultMethods.java"), expected);

}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:9,代码来源:DefaultMethodsTest.java

示例14: testIgnore

@Test
public void testIgnore() throws Exception {
    final DefaultConfiguration checkConfig = createModuleConfig(HeaderCheck.class);
    checkConfig.addAttribute("headerFile", getPath("InputHeaderjava.header"));
    checkConfig.addAttribute("ignoreLines", "2");
    final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
    verify(checkConfig, getPath("InputHeaderjava2.header"), expected);
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:8,代码来源:HeaderCheckTest.java

示例15: testMinimumDepth

@Test
public void testMinimumDepth()
        throws Exception {
    final DefaultConfiguration checkConfig =
        createModuleConfig(DescendantTokenCheck.class);
    checkConfig.addAttribute("tokens", "LITERAL_SWITCH");
    checkConfig.addAttribute("limitedTokens", "LITERAL_DEFAULT");
    checkConfig.addAttribute("maximumNumber", "0");
    checkConfig.addAttribute("minimumDepth", "3");
    final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
    verify(checkConfig, getPath("InputDescendantTokenIllegalTokens.java"), expected);
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:12,代码来源:DescendantTokenCheckTest.java


注:本文中的com.puppycrawl.tools.checkstyle.utils.CommonUtils.EMPTY_STRING_ARRAY属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。