public Result testNotRegisteredException() throws Exception {
/* Initialisation without registering */
MBeanServer server = MBeanServerFactory.createMBeanServer();
ObjectName unitName = new ObjectName("a:b=c");
server.registerMBean(new Unit(), unitName);
RelationService rService = new RelationService(true);
RoleInfo[] rInfo = { new RoleInfo("role", classPath) };
rService.createRelationType("relationType", rInfo);
RoleList unitRoles = new RoleList();
unitRoles.add(new Role("role", Collections.singletonList(unitName)));
/* catch RelationServiceNotRegisteredException */
try {
rService.createRelation("relation", "relationType", unitRoles);
return failed("");
} catch (RelationServiceNotRegisteredException e) {
return passed();
} catch (Throwable t) {
return failed(t.toString());
}
}
StructureTest.java 文件源码
java
阅读 24
收藏 0
点赞 0
评论 0
项目:freeVM
作者:
评论列表
文章目录