01-18-2013 08:50 AM
01-18-2013 09:01 AM
01-21-2013 01:20 PM
@Test
public void test() {
// prepare params
Map<String, Object> params = new Hashtable<String, Object>();
params.put( "tempDir", System.getProperty("tempDir", "target") );
params.put( "runningDatabaseFile", LIVE_DB+".h2.db");
// start process
runtimeService.startProcessInstanceByKey(
MONITOR_PROCESS_KEY, "GENERATOR-KEY-1", params).getId();
}
import org.apache.commons.io.*;
import static org.junit.Assert.*;
import java.util.List;
import org.activiti.engine.IdentityService;
import org.activiti.engine.identity.User;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.processmonitor.simulator.*;
// create copy of the running process engine database and set system property to this file
FileUtils.copyFile( FileUtils.getFile(runningDatabaseFile), FileUtils.getFile( tempDir+"/TwoEngines-simulationRunDB"+Thread.currentThread().getId()+".h2.db"))
System.setProperty("_SIM_DB_PATH", tempDir+"/TwoEngines-simulationRunDB"+Thread.currentThread().getId())
ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext("/org/processmonitor/simulator/SimEngine-h2-context.xml")
IdentityService identityService = appContext.getBean("identityService")
IdentityService simIdentityService = appContext.getBean("simIdentityService")
List<User> simUsers = simIdentityService.createUserQuery().list();
List<User> users = identityService.createUserQuery().list();
assertTrue("Copied identity service is not the same as source identity service", simUsers.size() == users.size());
SimulationRun simRun = appContext.getBean(SimulationRun.class)
resultEventList = simRun.execute(new Date(), null)
assertTrue("Simulation result event list is empty", resultEventList.size() > 0);
appContext.close()
assertTrue("Simulation result event list is empty", resultEventList.size() > 0);
01-22-2013 03:26 AM
01-22-2013 04:06 AM
Both tests are passing with activiti-5.10 master branch.
01-22-2013 04:28 AM
01-22-2013 04:48 AM
01-22-2013 05:23 AM
public void setContextReusePossible(boolean isContextReusePossible) {
this.isContextReusePossible = isContextReusePossible;
}
public class StandaloneProcessEngineConfiguration extends ProcessEngineConfigurationImpl {
protected Collection< ? extends CommandInterceptor> getDefaultCommandInterceptorsTxRequired() {
return createDefaultCommandInterceptors(true);
}
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.