private ObjectStoreWriter getUserProfile() { if (alias == null) { throw new BuildException("objectStoreWriter attribute is not set"); } if (userprofile == null) { System .out.println("Connecting to db: " + alias); try { userprofile = ObjectStoreWriterFactory.getObjectStoreWriter(alias); } catch (ObjectStoreException e) { throw new BuildException("Could not connect to object store", e); } } return userprofile; }
private ObjectStoreWriter getUserProfile() { if (alias == null) { throw new BuildException("objectStoreWriter attribute is not set"); } if (userprofile == null) { System .out.println("Connecting to db: " + alias); try { userprofile = ObjectStoreWriterFactory.getObjectStoreWriter(alias); } catch (ObjectStoreException e) { throw new BuildException("Could not connect to object store", e); } } return userprofile; }
/** * Run the task * @throws org.apache.tools.ant.BuildException if a problem occurs */ public void execute() { ObjectStoreWriter osw = null; try { osw = ObjectStoreWriterFactory.getObjectStoreWriter(osName); Class c = Class.forName(clsName); if (!PostProcessor.class.isAssignableFrom(c)) { throw new IllegalArgumentException("Class (" + clsName + ") is not a subclass" + "of org.intermine.postprocess.PostProcessor!"); } Constructor m = c.getConstructor(new Class[] {ObjectStoreWriter.class}); PostProcessor pp = (PostProcessor) m.newInstance(new Object[] {osw}); configureDynamicAttributes(pp); pp.postProcess(); } catch (Exception e) { throw new BuildException(e); } }
/** * Run the task * @throws org.apache.tools.ant.BuildException if a problem occurs */ public void execute() { ObjectStoreWriter osw = null; try { osw = ObjectStoreWriterFactory.getObjectStoreWriter(osName); Class c = Class.forName(clsName); if (!PostProcessor.class.isAssignableFrom(c)) { throw new IllegalArgumentException("Class (" + clsName + ") is not a subclass" + "of org.intermine.postprocess.PostProcessor!"); } Constructor m = c.getConstructor(new Class[] {ObjectStoreWriter.class}); PostProcessor pp = (PostProcessor) m.newInstance(new Object[] {osw}); configureDynamicAttributes(pp); pp.postProcess(); } catch (Exception e) { throw new BuildException(e); } }
/** * Returns the ProfileManager configured in webapp.userprofile.os.alias. * * @return a ProfileManager */ public static ProfileManager getProfileManager() { if (profileManager == null) { try { String userProfileAlias = getProperties().getProperty("webapp.userprofile.os.alias"); ObjectStoreWriter userProfileOs = ObjectStoreWriterFactory .getObjectStoreWriter(userProfileAlias); profileManager = new ProfileManager(getObjectStore(), userProfileOs); } catch (ObjectStoreException e) { throw new IllegalArgumentException("Error creating profile manager", e); } } return profileManager; }
/** * Returns the ProfileManager configured in webapp.userprofile.os.alias. * * @return a ProfileManager */ public static ProfileManager getProfileManager() { if (profileManager == null) { try { String userProfileAlias = getProperties().getProperty("webapp.userprofile.os.alias"); ObjectStoreWriter userProfileOs = ObjectStoreWriterFactory .getObjectStoreWriter(userProfileAlias); profileManager = new ProfileManager(getObjectStore(), userProfileOs); } catch (ObjectStoreException e) { throw new IllegalArgumentException("Error creating profile manager", e); } } return profileManager; }
public void testNull() throws Exception { try { ObjectStoreWriterFactory.getObjectStoreWriter(null); fail("Expected: NullPointerException"); } catch (NullPointerException e) { } }
public void testEmpty() throws Exception { try { ObjectStoreWriterFactory.getObjectStoreWriter(""); fail("Expected: IllegalArgumentException"); } catch (IllegalArgumentException e) { } }
public void testInvalid() throws Exception { try { ObjectStoreWriterFactory.getObjectStoreWriter("db.unittest"); fail("Expected: ObjectStoreException"); } catch (ObjectStoreException e) { } } }
@Before public void setup() { try { osw = ObjectStoreWriterFactory.getObjectStoreWriter(ALIAS); } catch (ObjectStoreException e) { LOG.error("Could not initialise object-store", e); return; } }
@Before public void setup() throws ObjectStoreException { osw = ObjectStoreWriterFactory.getObjectStoreWriter("osw.unittest"); }
@Before public void setup() throws ObjectStoreException { osw = ObjectStoreWriterFactory.getObjectStoreWriter("osw.unittest"); }
@Before public void setup() throws ObjectStoreException { osw = ObjectStoreWriterFactory.getObjectStoreWriter("osw.unittest"); }
protected void setUp() throws Exception { super.setUp(); uosw = ObjectStoreWriterFactory.getObjectStoreWriter("osw.userprofile-test"); if (uosw instanceof ObjectStoreWriterInterMineImpl) { con = ((ObjectStoreWriterInterMineImpl) uosw).getConnection(); } trackQueue = new ArrayBlockingQueue<Track>(count); //create the table if doesn't exist LoginTracker.getInstance(con, trackQueue); }
@Before public void setup() throws ObjectStoreException { osw = ObjectStoreWriterFactory.getObjectStoreWriter("osw.unittest"); MainHelper.RangeConfig.rangeHelpers.put(EmploymentPeriod.class, new EmploymentPeriodHelper()); }
public void setUp() throws Exception { InputStream is = getClass().getClassLoader().getResourceAsStream("FullParserTest.xml"); List<org.intermine.xml.full.Item> xmlItems = FullParser.parse(is); osw = ObjectStoreWriterFactory.getObjectStoreWriter("osw.fulldatatest"); itemWriter = new ObjectStoreItemWriter(osw); Iterator iter = xmlItems.iterator(); while (iter.hasNext()) { items.add((Item) ItemHelper.convert((org.intermine.xml.full.Item) iter.next())); } iter = items.iterator(); while (iter.hasNext()) { itemWriter.store((Item) iter.next()); } itemWriter.close(); }
public void testValid() throws Exception { ObjectStoreWriter osw = ObjectStoreWriterFactory.getObjectStoreWriter("osw.unittest"); assertNotNull(osw); osw.close(); }
@BeforeClass public static void oneTimeSetUp() throws Exception { oneTimeSetUp(ObjectStoreWriterFactory.getObjectStoreWriter("osw.notxmlunittest")); }
@BeforeClass public static void oneTimeSetUp() throws Exception { oneTimeSetUp(ObjectStoreWriterFactory.getObjectStoreWriter("osw.truncunittest")); }
@BeforeClass public static void oneTimeSetUp() throws Exception { oneTimeSetUp(ObjectStoreWriterFactory.getObjectStoreWriter("osw.flatmodeunittest")); }