01: /*
02: * Copyright (c) 2002-2003 by OpenSymphony
03: * All rights reserved.
04: */
05: package com.opensymphony.workflow.spi.hibernate3;
06:
07: import com.opensymphony.workflow.Workflow;
08: import com.opensymphony.workflow.config.Configuration;
09: import com.opensymphony.workflow.spi.AbstractFunctionalWorkflowTest;
10: import com.opensymphony.workflow.util.DatabaseHelper;
11:
12: import org.springframework.beans.factory.xml.XmlBeanFactory;
13:
14: import org.springframework.core.io.ClassPathResource;
15:
16: /**
17: * White Box semi-functional test case that uses Spring's managed Hibernate as Store
18: *
19: * @author Luca Masini (l.masini@infogroup.it)
20: */
21: public class SpringHibernateFunctionalWorkflowTestCase extends
22: AbstractFunctionalWorkflowTest {
23: //~ Constructors ///////////////////////////////////////////////////////////
24:
25: public SpringHibernateFunctionalWorkflowTestCase(String s) {
26: super (s);
27: }
28:
29: //~ Methods ////////////////////////////////////////////////////////////////
30:
31: protected void setUp() throws Exception {
32: super .setUp();
33: DatabaseHelper.runScript("", "jdbc/CreateDS");
34:
35: XmlBeanFactory beanFactory = new XmlBeanFactory(
36: new ClassPathResource(
37: "osworkflow-spring-hibernate3.xml"));
38:
39: workflow = (Workflow) beanFactory.getBean("workflow");
40: workflow.setConfiguration((Configuration) beanFactory
41: .getBean("osworkflowConfiguration"));
42: }
43:
44: protected String getWorkflowName() {
45: return "example";
46: }
47:
48: protected void tearDown() throws Exception {
49: DatabaseHelper.runScript(getClass().getResource(
50: "/scripts/jdbc/dropschema.sql"), "jdbc/DefaultDS");
51: }
52: }
|