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.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 NewSpringHibernateFunctionalWorkflowTestCase extends
22: AbstractFunctionalWorkflowTest {
23: //~ Constructors ///////////////////////////////////////////////////////////
24:
25: public NewSpringHibernateFunctionalWorkflowTestCase(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("new-osworkflow-spring.xml"));
37:
38: workflow = (Workflow) beanFactory.getBean("workflow");
39: workflow.setConfiguration((Configuration) beanFactory
40: .getBean("osworkflowConfiguration"));
41: }
42:
43: protected String getWorkflowName() {
44: return "example";
45: }
46:
47: protected void tearDown() throws Exception {
48: DatabaseHelper.runScript(getClass().getResource(
49: "/scripts/jdbc/dropschema.sql"), "jdbc/DefaultDS");
50: }
51: }
|