1 5 package com.opensymphony.workflow.spi.jdbc; 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 java.util.HashMap ; 13 14 15 22 public class JDBCFunctionalWorkflowTestCase extends BaseFunctionalWorkflowTest { 23 25 public JDBCFunctionalWorkflowTestCase(String s) { 26 super(s); 27 } 28 29 31 public void testTrigger() throws Exception { 32 String workflowName = getClass().getResource("/samples/scheduler.xml").toString(); 33 assertTrue("canInitialize for workflow " + workflowName + " is false", workflow.canInitialize(workflowName, 1)); 34 35 long id = workflow.initialize(workflowName, 1, new HashMap ()); 36 Thread.sleep(500); 37 assertEquals("trigger was not fired", "blahblah", workflow.getPropertySet(id).getString("testTrigger")); 38 } 39 40 protected void setUp() throws Exception { 41 super.setUp(); 42 DatabaseHelper.createDatabase(getClass().getResource("/scripts/jdbc/mckoi.sql")); 43 44 Configuration config = new DefaultConfiguration(); 45 config.load(getClass().getResource("/osworkflow-jdbc.xml")); 46 workflow.setConfiguration(config); 47 } 48 } 49 | Popular Tags |