本文整理了Java中org.intermine.metadata.Model.getProblems()
方法的一些代码示例,展示了Model.getProblems()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Model.getProblems()
方法的具体详情如下:
包路径:org.intermine.metadata.Model
类名称:Model
方法名:getProblems
[英]Return a list of problems with the model or an empty list.
[中]返回模型问题列表或空列表。
代码示例来源:origin: intermine/intermine
public void testRevereseReferenceNotReciprocal() throws Exception {
// rfd1 points to Class2 but has reverse-reference that points to another field in Class1
ReferenceDescriptor rfd1 = new ReferenceDescriptor("rfd1", "package.name.Class2", "rfd2");
ReferenceDescriptor rfdOther1 = new ReferenceDescriptor("rfdOther1", "package.name.Class2", "rfd2");
ReferenceDescriptor rfd2 = new ReferenceDescriptor("rfd2", "package.name.Class1", "rfdOther1");
Set<ReferenceDescriptor> refs1 = new HashSet<ReferenceDescriptor>(Arrays.asList(rfd1, rfdOther1));
Set<ReferenceDescriptor> refs2 = Collections.singleton(rfd2);
ClassDescriptor cld1 = new ClassDescriptor("package.name.Class1", null, false,
ClassDescriptorFactory.NO_ATTRS, refs1, ClassDescriptorFactory.NO_COLLS);
ClassDescriptor cld2 = new ClassDescriptor("package.name.Class2", null, false,
ClassDescriptorFactory.NO_ATTRS, refs2, ClassDescriptorFactory.NO_COLLS);
Model model = new Model("model", "package.name", Arrays.asList(cld1, cld2));
// this no longer throws an exception , instead creates the model but adds a problem
assertEquals(1, model.getProblems().size());
}
代码示例来源:origin: intermine/intermine
if (newModel.hasProblems()) {
throw new ModelMergerException("There were problems merging the model: "
+ newModel.getProblems());
代码示例来源:origin: intermine/intermine
public void testRevereseReferenceWrongType() throws Exception {
// rfd1 points to Class2 but has reverse-reference rfd2 which exists but is a refernece to Class3
ReferenceDescriptor rfd1 = new ReferenceDescriptor("rfd1", "package.name.Class2", "rfd2");
ReferenceDescriptor rfd2 = new ReferenceDescriptor("rfd2", "package.name.Class3", "rfd1");
ReferenceDescriptor rfd3 = new ReferenceDescriptor("rfd1", "package.name.Class2", "rfd2");
//ReferenceDescriptor rfdOther2 = new ReferenceDescriptor("rfdOther2", "package.name.Class1", "rfd2");
Set<ReferenceDescriptor> refs1 = Collections.singleton(rfd1);
Set<ReferenceDescriptor> refs2 = Collections.singleton(rfd2);
Set<ReferenceDescriptor> refs3 = Collections.singleton(rfd3);
ClassDescriptor cld1 = new ClassDescriptor("package.name.Class1", null, false,
ClassDescriptorFactory.NO_ATTRS, refs1, ClassDescriptorFactory.NO_COLLS);
ClassDescriptor cld2 = new ClassDescriptor("package.name.Class2", null, false,
ClassDescriptorFactory.NO_ATTRS, refs2, ClassDescriptorFactory.NO_COLLS);
ClassDescriptor cld3 = new ClassDescriptor("package.name.Class3", null, false,
ClassDescriptorFactory.NO_ATTRS, refs3, ClassDescriptorFactory.NO_COLLS);
Model model = new Model("model", "package.name", Arrays.asList(cld1, cld2, cld3));
assertEquals(1, model.getProblems().size());
}
代码示例来源:origin: org.intermine/intermine-objectstore
if (newModel.hasProblems()) {
throw new ModelMergerException("There were problems merging the model: "
+ newModel.getProblems());
内容来源于网络,如有侵权,请联系作者删除!