1 5 package com.opensymphony.workflow.spi.hibernate; 6 7 import com.opensymphony.workflow.config.Configuration; 8 import com.opensymphony.workflow.config.DefaultConfiguration; 9 import com.opensymphony.workflow.spi.BaseFunctionalWorkflowTest; 10 import com.opensymphony.workflow.spi.DatabaseHelper; 11 12 import net.sf.hibernate.SessionFactory; 13 14 15 22 public class HibernateFunctionalWorkflowTestCase extends BaseFunctionalWorkflowTest { 23 25 private SessionFactory factory; 26 27 29 public HibernateFunctionalWorkflowTestCase(String s) { 30 super(s); 31 } 32 33 35 protected void setUp() throws Exception { 36 super.setUp(); 37 DatabaseHelper.createDatabase(""); 38 39 factory = DatabaseHelper.createHibernateSessionFactory(); 40 41 Configuration config = new DefaultConfiguration(); 42 config.load(getClass().getResource("/osworkflow-hibernate.xml")); 43 workflow.setConfiguration(config); 44 workflow.getConfiguration().getPersistenceArgs().put("sessionFactory", factory); 45 } 46 47 protected void tearDown() throws Exception { 48 factory.close(); 49 } 50 } 51 | Popular Tags |