private ObjectStore getObjectStore() throws Exception { if (os != null) { return os; } if (osAlias == null) { throw new BuildException("objectStoreWriter attribute is not set"); } if (os == null) { System .out.println("Connecting to db: " + osAlias); os = ObjectStoreFactory.getObjectStore(osAlias); } return os; }
private ObjectStore getObjectStore() throws Exception { if (os != null) { return os; } if (osAlias == null) { throw new BuildException("objectStoreWriter attribute is not set"); } if (os == null) { System .out.println("Connecting to db: " + osAlias); os = ObjectStoreFactory.getObjectStore(osAlias); } return os; }
public void setUp() throws Exception { os = (ObjectStoreInterMineImpl) ObjectStoreFactory.getObjectStore("os.unittest"); }
public void testConfigure() throws Exception { ObjectStore os1 = ObjectStoreFactory.getObjectStore("os.unittest"); ObjectStore os2 = ObjectStoreFactory.getObjectStore("os.unittest"); // These should be exactly the same object assertTrue(os1 == os2); }
public void testValid() throws Exception { ObjectStore os = ObjectStoreFactory.getObjectStore("os.unittest"); assertNotNull(os); }
public void testInvalid() throws Exception { try { ObjectStoreFactory.getObjectStore("db.unittest"); fail("Expected: ObjectStoreException"); } catch (ObjectStoreException e) { } } }
public static void oneTimeSetUp( String osName, String osWriterName, String modelName, String itemsXmlFilename) throws Exception { os = (ObjectStoreInterMineImpl)ObjectStoreFactory.getObjectStore(osName); ObjectStoreAbstractImplTestCase.oneTimeSetUp(os, osWriterName, modelName, itemsXmlFilename); }
protected DatabaseSchema getSchema() throws Exception { DatabaseSchema schema = ((ObjectStoreInterMineImpl) ObjectStoreFactory.getObjectStore("os.notxmlunittest")).getSchema(); return schema; } public String getRegisterOffset1() {
public void testNull() throws Exception { try { ObjectStoreFactory.getObjectStore(null); fail("Expected: NullPointerException"); } catch (NullPointerException e) { } }
public void testEmpty() throws Exception { try { ObjectStoreFactory.getObjectStore(""); fail("Expected: IllegalArgumentException"); } catch (IllegalArgumentException e) { } }
protected DatabaseSchema getSchema() throws Exception { return ((ObjectStoreInterMineImpl) ObjectStoreFactory.getObjectStore("os.flatmodeunittest")).getSchema(); }
public void setUp() throws Exception { super.setUp(); os = ObjectStoreFactory.getObjectStore("os.unittest"); }
public void setUp() throws Exception { super.setUp(); translator = new ItemToObjectTranslator(Model.getInstanceByName("testmodel"), null); translator.setObjectStore(ObjectStoreFactory.getObjectStore("os.unittest")); translator.idToNamespace.put(new Integer(0), "fish"); translator.namespaceToId.put("fish", new Integer(0)); }
@Test public void testIgnore() throws Exception { ObjectStore os = ObjectStoreFactory.getObjectStore("os.unittest"); Properties config = new Properties(); config.put("max.field.value", "10"); config.put("ignore.counts", "org.intermine.model.testmodel.Employee.age"); ObjectStoreSummary oss = new ObjectStoreSummary(os, config); Assert.assertNull(oss.getFieldValues("org.intermine.model.testmodel.Employee", "age")); }
public void setUp() throws Exception { super.setUp(); os = ObjectStoreFactory.getObjectStore("os.unittest"); userProfileOSW = ObjectStoreWriterFactory.getObjectStoreWriter("osw.userprofile-test"); userProfileOS = userProfileOSW.getObjectStore(); pm = new NonCheckingProfileManager(os, userProfileOSW); }
@Test public void testGetCount() throws Exception { ObjectStore os = ObjectStoreFactory.getObjectStore("os.unittest"); ObjectStoreSummary oss = new ObjectStoreSummary(os, new Properties()); Assert.assertEquals(2, oss.getClassCount("org.intermine.model.testmodel.Company")); }
protected void setUp() throws Exception { super.setUp(); uosw = ObjectStoreWriterFactory.getObjectStoreWriter("osw.userprofile-test"); os = ObjectStoreFactory.getObjectStore("os.unittest"); initQueries(); initWebConfig(); initData(); }
@BeforeClass public static void oneTimeSetUp() throws Exception { ObjectStoreAbstractImpl os = (ObjectStoreAbstractImpl)ObjectStoreFactory.getObjectStore("os.unittest"); oneTimeSetUp(os, "osw.unittest", "testmodel", "testmodel_data.xml"); osFastCollections = new ObjectStoreFastCollectionsImpl(os); }
@Test public void testPropertiesRoundTrip() throws Exception { Properties config = new Properties(); config.put("max.field.values", "10"); ObjectStore os = ObjectStoreFactory.getObjectStore("os.unittest"); ObjectStoreSummary oss = new ObjectStoreSummary(os, config); Properties out = oss.toProperties(); ObjectStoreSummary ossFromProps = new ObjectStoreSummary(out); Assert.assertEquals(out, ossFromProps.toProperties()); Assert.assertEquals(10, oss.maxValues); Assert.assertEquals(10, ossFromProps.maxValues); } }
@BeforeClass public static void oneTimeSetUp() throws Exception { os = new ObjectStoreTranslatingImpl( Model.getInstanceByName("testmodel"), ObjectStoreFactory.getObjectStore("os.unittest"), new DummyTranslator()); ObjectStoreTestCase.oneTimeSetUp(os, "osw.unittest", "testmodel", "testmodel_data.xml"); }