01: /*
02: * Copyright (c) 2002-2003 by OpenSymphony
03: * All rights reserved.
04: */
05: package com.opensymphony.workflow.spi.hibernate;
06:
07: import com.opensymphony.workflow.config.Configuration;
08: import com.opensymphony.workflow.spi.AbstractFunctionalWorkflowTest;
09: import com.opensymphony.workflow.util.DatabaseHelper;
10:
11: import org.springframework.beans.factory.xml.XmlBeanFactory;
12:
13: import org.springframework.core.io.ClassPathResource;
14:
15: /**
16: * @author Quake Wang
17: * @since 2004-5-2
18: *
19: **/
20: public class SpringHibernateFunctionalWorkflowTestCase extends
21: AbstractFunctionalWorkflowTest {
22: //~ Constructors ///////////////////////////////////////////////////////////
23:
24: public SpringHibernateFunctionalWorkflowTestCase(String s) {
25: super (s);
26: }
27:
28: //~ Methods ////////////////////////////////////////////////////////////////
29:
30: protected void setUp() throws Exception {
31: try {
32: super .setUp();
33: DatabaseHelper.runScript("", "jdbc/CreateDS");
34:
35: XmlBeanFactory beanFactory = new XmlBeanFactory(
36: new ClassPathResource("osworkflow-spring.xml"));
37:
38: //workflow = (AbstractWorkflow) beanFactory.getBean("workflow");
39: workflow.setConfiguration((Configuration) beanFactory
40: .getBean("osworkflowConfiguration"));
41: } catch (Exception e) {
42: log.error(e);
43: }
44: }
45:
46: protected String getWorkflowName() {
47: return "example";
48: }
49:
50: protected void tearDown() throws Exception {
51: DatabaseHelper.runScript(getClass().getResource(
52: "/scripts/jdbc/dropschema.sql"), "jdbc/DefaultDS");
53: }
54: }
|