try { ModelMerger.mergeModel(model, additionClds); fail("Expected ModelMergerException"); } catch (ModelMergerException e) { }
    public void testConflictingReferences() throws Exception {        String modelStr = "<model name=\"testmodel\" namespace=\"http://www.intermine.org/model/testmodel#\"><class name=\"org.intermine.model.testmodel.Company\" is-interface=\"true\"><collection name=\"departments\" referenced-type=\"org.intermine.model.testmodel.Department\" ordered=\"true\" reverse-reference=\"company\"/></class><class name=\"org.intermine.model.testmodel.Department\" is-interface=\"false\"><reference name=\"company\" referenced-type=\"org.intermine.model.testmodel.Company\" reverse-reference=\"departments\"/></class></model>";        Model model = parser.process(new StringReader(modelStr));        // referenced-type wrong - Department.company        String addition = "<model name=\"testmodel\" namespace=\"testmodel#\"><class name=\"org.intermine.model.testmodel.Department\" is-interface=\"false\"><reference name=\"company\" referenced-type=\"org.intermine.model.testmodel.Department\" reverse-reference=\"departments\"/></class></model>";        Set additionClds = parser.generateClassDescriptors(new StringReader(addition));        try {            ModelMerger.mergeModel(model, additionClds);            fail("Expected ModelMergerException");        } catch (ModelMergerException e) {        }        // reverse reference wrong - Department.company        addition = "<model name=\"testmodel\" namespace=\"testmodel#\"><class name=\"org.intermine.model.testmodel.Department\" is-interface=\"false\"><reference name=\"company\" referenced-type=\"org.intermine.model.testmodel.Company\" reverse-reference=\"incorrect\"/></class></model>";        additionClds = parser.generateClassDescriptors(new StringReader(addition));        model = parser.process(new StringReader(modelStr));        //try {            //ModelMerger.mergeModel(model, additionClds);            //fail("Expected ModelMergerException");        //} catch (ModelMergerException e) {        //}    }