本文整理匯總了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());
}