/*
 * Created on Feb 5, 2004
 *
 * To change the template for this generated file go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */


/*
  The Broad Institute
  SOFTWARE COPYRIGHT NOTICE AGREEMENT
  This software and its documentation are copyright (2006) by the
  Broad Institute/Massachusetts Institute of Technology. All rights are
  reserved.

  This software is supplied without any warranty or guaranteed support
  whatsoever. Neither the Broad Institute nor MIT can be responsible for its
  use, misuse, or functionality.
*/

package calhoun.gebo.internal.db;

import junit.framework.TestCase;
import calhoun.gebo.util.U;

/**
 * @author reinhard@broad.mit.edu
 *
 * 
 */
public class CalhounDbConnectTest extends TestCase {

	/**
	 * @param arg0
	 */
	public CalhounDbConnectTest(String name) {
		super(name);
		m_calhounCM = CalhounConnectionManager.getInstance();
		m_calhounCM.setMachine("francium.broad.mit.edu:1521");
		
        m_calhounCM.setPassword("mem7look");
		m_calhounCM.setSid("annoprod");
       m_calhounCM.setUsername("reinhard");
  //   m_calhounCM.setPassword("Saa4owf");
	//	m_calhounCM.setUsername("annotdbo");
		m_calhounCM.setQueryPrinted(true);
		try {
			m_calhounCM.connect();
		} catch (Exception e) {
			U.trace();
			U.println("Unable to connect to oracle database:" + e);
		}
		m_calhounTM = CalhounTrackManager.getInstance();
		m_calhounSM = CalhounSequenceManager.getInstance();
		if (m_calhounCM.isConnected()) {
			m_calhounTM.getTracks();
		}
		m_calhounFF = CalhounFeatureFinder.getInstance();
	}

	protected CalhounFeature getCF(String id) throws Exception{
		String[] ids = new String[]{id};
		return (CalhounFeature)m_calhounFF.getFeatures(ids)[0];
	}

    protected calhoun.util.DbSession getDbSession(){
        return m_calhounCM.getInstance().getDbSession();
    }
    
	protected CalhounConnectionManager m_calhounCM;
	protected CalhounSequenceManager m_calhounSM;
	protected CalhounTrackManager m_calhounTM;
	protected CalhounFeatureFinder m_calhounFF;

}
