public void testInvocationWhenServiceNA() throws Throwable {
// service n/a
ServiceReference reference = new MockServiceReference() {
public Bundle getBundle() {
return null;
}
};
interceptor = new ServiceStaticInterceptor(new MockBundleContext(), reference);
Object target = new Object();
Method m = target.getClass().getDeclaredMethod("hashCode", null);
MethodInvocation invocation = new MockMethodInvocation(m);
try {
interceptor.invoke(invocation);
fail("should have thrown exception");
}
catch (ServiceUnavailableException ex) {
// expected
}
}
OsgiServiceStaticInterceptorTest.java 文件源码
java
阅读 24
收藏 0
点赞 0
评论 0
项目:gemini.blueprint
作者:
评论列表
文章目录