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


Java DeclarationSnippet.source方法代码示例

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


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

示例1: assertUnresolvedDependencies1

import jdk.jshell.DeclarationSnippet; //导入方法依赖的package包/类
public DeclarationSnippet assertUnresolvedDependencies1(DeclarationSnippet key, Status status, String name) {
    List<String> unresolved = assertUnresolvedDependencies(key, 1);
    String input = key.source();
    assertEquals(unresolved.size(), 1, "Given input: " + input + ", checking unresolved");
    assertEquals(unresolved.get(0), name, "Given input: " + input + ", checking unresolved: ");
    assertEquals(getState().status(key), status, "Given input: " + input + ", checking status: ");
    return key;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:KullaTesting.java

示例2: assertDeclarationSnippet

import jdk.jshell.DeclarationSnippet; //导入方法依赖的package包/类
public void assertDeclarationSnippet(DeclarationSnippet declarationKey,
        String expectedName,
        Status expectedStatus, SubKind expectedSubKind,
        int unressz, int othersz) {
    assertKey(declarationKey, expectedStatus, expectedSubKind);
    String source = declarationKey.source();
    assertEquals(declarationKey.name(), expectedName,
            "Expected " + source + " to have the name: " + expectedName + ", got: " + declarationKey.name());
    long unresolved = getState().unresolvedDependencies(declarationKey).count();
    assertEquals(unresolved, unressz, "Expected " + source + " to have " + unressz
            + " unresolved symbols, got: " + unresolved);
    long otherCorralledErrorsCount = getState().diagnostics(declarationKey).count();
    assertEquals(otherCorralledErrorsCount, othersz, "Expected " + source + " to have " + othersz
            + " other errors, got: " + otherCorralledErrorsCount);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:16,代码来源:KullaTesting.java

示例3: assertDeclarationSnippet

import jdk.jshell.DeclarationSnippet; //导入方法依赖的package包/类
public void assertDeclarationSnippet(DeclarationSnippet declarationKey,
        String expectedName,
        Status expectedStatus, SubKind expectedSubKind,
        int unressz, int othersz) {
    assertKey(declarationKey, expectedStatus, expectedSubKind);
    String source = declarationKey.source();
    assertEquals(declarationKey.name(), expectedName,
            "Expected " + source + " to have the name: " + expectedName + ", got: " + declarationKey.name());
    List<String> unresolved = getState().unresolvedDependencies(declarationKey);
    assertEquals(unresolved.size(), unressz, "Expected " + source + " to have " + unressz
            + " unresolved symbols, got: " + unresolved.size());
    List<Diag> otherCorralledErrors = getState().diagnostics(declarationKey);
    assertEquals(otherCorralledErrors.size(), othersz, "Expected " + source + " to have " + othersz
            + " other errors, got: " + otherCorralledErrors.size());
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:16,代码来源:KullaTesting.java


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