1 20 26 package org.openi.project; 27 28 import junit.framework.TestCase; 29 import org.apache.log4j.PropertyConfigurator; 30 import org.openi.test.Util; 31 import org.openi.xml.BeanStorage; 32 33 34 public class JdbcDatasourceTest extends TestCase { 35 private BeanStorage storage; 36 37 protected void setUp() throws Exception { 38 super.setUp(); 39 this.storage = new BeanStorage(); 40 PropertyConfigurator.configure(Util.findTestDirectory() 41 + "/log4jtest.properties"); 42 } 43 44 public void testJdbcDatasourceCreate() throws Exception { 45 JdbcDatasource config = new JdbcDatasource(); 46 config.setDriverClassName("net.sourceforge.jtds.jdbc.Driver"); 47 config.setUrl("jdbc:jtds:sqlserver://moosehead.openi.local/mo_load"); 48 config.setUsername("sa"); 49 config.setPassword("foobar"); 50 this.storage.saveBeanToFile(Util.findTestDirectory() 51 + "/loaddatabaseconfig.xml", config); 52 } 53 } 54 | Popular Tags |