本文整理汇总了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;
}
示例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);
}
示例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());
}