schema = new DatabaseSchema(osModel, truncatedClasses, noNotXml, missingTables, FORMAT_VERSION); } catch (ClassCastException e) {
schema = new DatabaseSchema(osModel, truncatedClasses, noNotXml, missingTables, FORMAT_VERSION); } catch (ClassCastException e) {
public void testInvalidTruncatedList() throws Exception { List truncated = new ArrayList(); truncated.add(model.getClassDescriptorByName("org.intermine.model.testmodel.Employee")); truncated.add(model.getClassDescriptorByName("org.intermine.model.testmodel.Manager")); try { new DatabaseSchema(model, truncated, false, Collections.EMPTY_SET, 1); fail("Expected: IllegalArgumentException"); } catch (IllegalArgumentException e) { } }
DatabaseSchema schema = new DatabaseSchema(osModel, truncatedClasses, noNotXml, missingTables, formatVersion); os = new ObjectStoreInterMineImpl(database, schema);
DatabaseSchema schema = new DatabaseSchema(osModel, truncatedClasses, noNotXml, missingTables, formatVersion); os = new ObjectStoreInterMineImpl(database, schema);
public void testInvalidClass() throws Exception { Query q = new Query(); QueryClass c1 = new QueryClass(Company.class); q.addFrom(c1); q.addToSelect(c1); DatabaseSchema s = new DatabaseSchema(new Model("nothing", "", new HashSet()), Collections.EMPTY_LIST, false, Collections.EMPTY_SET, 1); try { SqlGenerator.generate(q, 0, Integer.MAX_VALUE, s, db, new HashMap()); fail("Expected: ObjectStoreException"); } catch (ObjectStoreException e) { assertEquals("interface org.intermine.model.testmodel.Company is not in the model", e.getMessage()); } try { SqlGenerator.findTableNames(q, s, false); fail("Expected: ObjectStoreException"); } catch (ObjectStoreException e) { assertEquals("interface org.intermine.model.testmodel.Company is not in the model", e.getMessage()); } }
truncated.add(manager); truncated.add(employee); DatabaseSchema schema = new DatabaseSchema(model, truncated, true, Collections.singleton("intermineobject"), 1); truncated.add(employee); truncated.add(importantPerson); schema = new DatabaseSchema(model, truncated, true, Collections.singleton("intermineobject"), 1);
truncated.add(manager); truncated.add(employee); DatabaseSchema schema = new DatabaseSchema(model, truncated, false, Collections.EMPTY_SET, 1); truncated.add(employee); truncated.add(importantPerson); schema = new DatabaseSchema(model, truncated, false, Collections.EMPTY_SET, 1);