}
public void testDeployDefinitions() throws Exception {
Resource definitionLocation = new ClassPathResource("org/springmodules/workflow/jbpm31/simpleWorkflow.xml");
ProcessDefinitionFactoryBean definition = new ProcessDefinitionFactoryBean();
definition.setDefinitionLocation(definitionLocation);
definition.afterPropertiesSet();
MockControl sfCtrl = MockControl.createControl(SessionFactory.class);
SessionFactory sf = (SessionFactory) sfCtrl.getMock();
MockControl sCtrl = MockControl.createNiceControl(Session.class);
Session session = (Session) sCtrl.getMock();
MockControl queryCtrl = MockControl.createNiceControl(Query.class);
Query query = (Query) queryCtrl.getMock();
session.getNamedQuery("");
sCtrl.setMatcher(MockControl.ALWAYS_MATCHER);
sCtrl.setReturnValue(query);
sfCtrl.expectAndReturn(sf.openSession(), session);
sfCtrl.replay();
sCtrl.replay();
queryCtrl.replay();
configuration.setProcessDefinitions(new ProcessDefinition[] { (ProcessDefinition) definition.getObject() });
configuration.setConfiguration(configurationResource);
// configuration.setUseSpringObjectFactory(false);
configuration.setSessionFactory(sf);
configuration.afterPropertiesSet();