當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。