本文整理汇总了Java中com.oracle.testlibrary.jsr292.Helper.assertCalled方法的典型用法代码示例。如果您正苦于以下问题:Java Helper.assertCalled方法的具体用法?Java Helper.assertCalled怎么用?Java Helper.assertCalled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.oracle.testlibrary.jsr292.Helper
的用法示例。
在下文中一共展示了Helper.assertCalled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: assertReturn
import com.oracle.testlibrary.jsr292.Helper; //导入方法依赖的package包/类
public void assertReturn(Object returned, Object arg0, Object arg1,
int catchDrops, Object... args) {
int lag = 0;
if (throwMode == ThrowMode.CAUGHT) {
lag = 1;
}
Helper.assertCalled(lag, callName(), arg0, arg1);
if (throwMode == ThrowMode.NOTHING) {
assertEQ(cast.apply(arg0), returned);
} else if (throwMode == ThrowMode.CAUGHT) {
List<Object> catchArgs = new ArrayList<>(Arrays.asList(args));
// catcher receives an initial subsequence of target arguments:
catchArgs.subList(args.length - catchDrops, args.length).clear();
// catcher also receives the exception, prepended:
catchArgs.add(0, thrown);
Helper.assertCalled("catcher", catchArgs);
assertEQ(cast.apply(catchArgs), returned);
}
Asserts.assertEQ(0, fakeIdentityCount);
}