public static ProcessEngineConfiguration createStandaloneProcessEngineConfiguration() { return new StandaloneProcessEngineConfiguration(); }
public static ProcessEngineConfiguration createStandaloneProcessEngineConfiguration() { return new StandaloneProcessEngineConfiguration(); }
protected static ProcessEngine createProcessEngine(javax.sql.DataSource datasource, Properties properties) { ProcessEngineConfigurationImpl processEngineConfiguration = new StandaloneProcessEngineConfiguration(); processEngineConfiguration.setDataSource(datasource); processEngineConfiguration.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE); processEngineConfiguration.setHistory(properties.getProperty("historyLevel")); processEngineConfiguration.setJdbcBatchProcessing(Boolean.valueOf(properties.getProperty("jdbcBatchProcessing"))); // load plugins String processEnginePlugins = properties.getProperty("processEnginePlugins", ""); for (String pluginName : processEnginePlugins.split(",")) { if(pluginName.length() > 1) { Object pluginInstance = ReflectUtil.instantiate(pluginName); if(!(pluginInstance instanceof ProcessEnginePlugin)) { throw new PerfTestException("Plugin "+pluginName +" is not an instance of ProcessEnginePlugin"); } else { List<ProcessEnginePlugin> plugins = processEngineConfiguration.getProcessEnginePlugins(); if(plugins == null) { plugins = new ArrayList<ProcessEnginePlugin>(); processEngineConfiguration.setProcessEnginePlugins(plugins); } plugins.add((ProcessEnginePlugin) pluginInstance); } } } return processEngineConfiguration.buildProcessEngine(); }
public void testNonExistingPropertyForProcessEngineConfiguration() { ProcessEngineConfiguration engineConfiguration = new StandaloneProcessEngineConfiguration(); Map<String, String> propertiesToSet = new HashMap<String, String>(); propertiesToSet.put("aNonExistingProperty", "someValue"); try { PropertyHelper.applyProperties(engineConfiguration, propertiesToSet); Assert.fail(); } catch (Exception e) { // happy path } }
@Test public void testAutoIsDefault() { assertEquals(ProcessEngineConfiguration.AUTHORIZATION_CHECK_REVOKE_AUTO, new StandaloneProcessEngineConfiguration().getAuthorizationCheckRevokes()); }
/** * Assures that property names are matched on the setter name according to java beans conventions * and not on the field name. */ public void testConfigurationPropertiesWithMismatchingFieldAndSetter() { ProcessEngineConfigurationImpl engineConfiguration = new StandaloneProcessEngineConfiguration(); Map<String, String> propertiesToSet = new HashMap<String, String>(); propertiesToSet.put(DB_IDENTITY_USED_PROP, "false"); PropertyHelper.applyProperties(engineConfiguration, propertiesToSet); Assert.assertFalse(engineConfiguration.isDbIdentityUsed()); propertiesToSet.put(DB_IDENTITY_USED_PROP, "true"); PropertyHelper.applyProperties(engineConfiguration, propertiesToSet); Assert.assertTrue(engineConfiguration.isDbIdentityUsed()); }
protected void initIdGenerator() { if (idGenerator == null) { CommandExecutor idGeneratorCommandExecutor = null; if (idGeneratorDataSource != null) { ProcessEngineConfigurationImpl processEngineConfiguration = new StandaloneProcessEngineConfiguration(); processEngineConfiguration.setDataSource(idGeneratorDataSource); processEngineConfiguration.setDatabaseSchemaUpdate(DB_SCHEMA_UPDATE_FALSE); processEngineConfiguration.init(); idGeneratorCommandExecutor = processEngineConfiguration.getCommandExecutorTxRequiresNew(); } else if (idGeneratorDataSourceJndiName != null) { ProcessEngineConfigurationImpl processEngineConfiguration = new StandaloneProcessEngineConfiguration(); processEngineConfiguration.setDataSourceJndiName(idGeneratorDataSourceJndiName); processEngineConfiguration.setDatabaseSchemaUpdate(DB_SCHEMA_UPDATE_FALSE); processEngineConfiguration.init(); idGeneratorCommandExecutor = processEngineConfiguration.getCommandExecutorTxRequiresNew(); } else { idGeneratorCommandExecutor = commandExecutorTxRequiresNew; } DbIdGenerator dbIdGenerator = new DbIdGenerator(); dbIdGenerator.setIdBlockSize(idBlockSize); dbIdGenerator.setCommandExecutor(idGeneratorCommandExecutor); idGenerator = dbIdGenerator; } }
protected void initIdGenerator() { if (idGenerator == null) { CommandExecutor idGeneratorCommandExecutor = null; if (idGeneratorDataSource != null) { ProcessEngineConfigurationImpl processEngineConfiguration = new StandaloneProcessEngineConfiguration(); processEngineConfiguration.setDataSource(idGeneratorDataSource); processEngineConfiguration.setDatabaseSchemaUpdate(DB_SCHEMA_UPDATE_FALSE); processEngineConfiguration.init(); idGeneratorCommandExecutor = processEngineConfiguration.getCommandExecutorTxRequiresNew(); } else if (idGeneratorDataSourceJndiName != null) { ProcessEngineConfigurationImpl processEngineConfiguration = new StandaloneProcessEngineConfiguration(); processEngineConfiguration.setDataSourceJndiName(idGeneratorDataSourceJndiName); processEngineConfiguration.setDatabaseSchemaUpdate(DB_SCHEMA_UPDATE_FALSE); processEngineConfiguration.init(); idGeneratorCommandExecutor = processEngineConfiguration.getCommandExecutorTxRequiresNew(); } else { idGeneratorCommandExecutor = commandExecutorTxRequiresNew; } DbIdGenerator dbIdGenerator = new DbIdGenerator(); dbIdGenerator.setIdBlockSize(idBlockSize); dbIdGenerator.setCommandExecutor(idGeneratorCommandExecutor); idGenerator = dbIdGenerator; } }
/** * Assert that String, int and boolean properties can be set. */ public void testProcessEngineConfigurationProperties() { ProcessEngineConfiguration engineConfiguration = new StandaloneProcessEngineConfiguration(); Map<String, String> propertiesToSet = new HashMap<String, String>(); propertiesToSet.put(JOB_EXECUTOR_DEPLOYMENT_AWARE_PROP, "true"); propertiesToSet.put(JOB_EXECUTOR_PREFER_TIMER_JOBS, "true"); propertiesToSet.put(JOB_EXECUTOR_ACQUIRE_BY_DUE_DATE, "true"); propertiesToSet.put(MAIL_SERVER_PORT_PROP, "42"); propertiesToSet.put(JDBC_URL_PROP, "someUrl"); PropertyHelper.applyProperties(engineConfiguration, propertiesToSet); Assert.assertTrue(engineConfiguration.isJobExecutorDeploymentAware()); Assert.assertTrue(engineConfiguration.isJobExecutorPreferTimerJobs()); Assert.assertTrue(engineConfiguration.isJobExecutorAcquireByDueDate()); Assert.assertEquals(42, engineConfiguration.getMailServerPort()); Assert.assertEquals("someUrl", engineConfiguration.getJdbcUrl()); }
public static ProcessEngineConfiguration createStandaloneProcessEngineConfiguration() { return new StandaloneProcessEngineConfiguration(); }
public StandaloneProcessEngineConfiguration getConfiguration() { StandaloneProcessEngineConfiguration conf = new StandaloneProcessEngineConfiguration(); conf.setDataSource(dataSource); conf.setDatabaseSchemaUpdate(databaseSchemaUpdate); conf.setJobExecutorActivate(jobExecutorActivate); return conf; }
public void testNonExistingPropertyForProcessEngineConfiguration() { ProcessEngineConfiguration engineConfiguration = new StandaloneProcessEngineConfiguration(); Map<String, String> propertiesToSet = new HashMap<String, String>(); propertiesToSet.put("aNonExistingProperty", "someValue"); try { PropertyHelper.applyProperties(engineConfiguration, propertiesToSet); Assert.fail(); } catch (Exception e) { // happy path } }
ProcessEngine processEngine = new StandaloneProcessEngineConfiguration() .setProcessEngineName("reboot-test") .setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_FALSE) processEngine = new StandaloneProcessEngineConfiguration() .setProcessEngineName("reboot-test") .setDatabaseSchemaUpdate(org.camunda.bpm.engine.ProcessEngineConfiguration.DB_SCHEMA_UPDATE_FALSE)
public void testDeployRevisedProcessAfterDeleteOnOtherProcessEngine() { ProcessEngine processEngine1 = new StandaloneProcessEngineConfiguration() .setProcessEngineName("reboot-test-schema") .setDatabaseSchemaUpdate(org.camunda.bpm.engine.ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE) RepositoryService repositoryService1 = processEngine1.getRepositoryService(); ProcessEngine processEngine2 = new StandaloneProcessEngineConfiguration() .setProcessEngineName("reboot-test") .setDatabaseSchemaUpdate(org.camunda.bpm.engine.ProcessEngineConfiguration.DB_SCHEMA_UPDATE_FALSE)
@Test public void testAutoIsDefault() { assertEquals(ProcessEngineConfiguration.AUTHORIZATION_CHECK_REVOKE_AUTO, new StandaloneProcessEngineConfiguration().getAuthorizationCheckRevokes()); }
/** * Assures that property names are matched on the setter name according to java beans conventions * and not on the field name. */ public void testConfigurationPropertiesWithMismatchingFieldAndSetter() { ProcessEngineConfigurationImpl engineConfiguration = new StandaloneProcessEngineConfiguration(); Map<String, String> propertiesToSet = new HashMap<String, String>(); propertiesToSet.put(DB_IDENTITY_USED_PROP, "false"); PropertyHelper.applyProperties(engineConfiguration, propertiesToSet); Assert.assertFalse(engineConfiguration.isDbIdentityUsed()); propertiesToSet.put(DB_IDENTITY_USED_PROP, "true"); PropertyHelper.applyProperties(engineConfiguration, propertiesToSet); Assert.assertTrue(engineConfiguration.isDbIdentityUsed()); }
protected void initIdGenerator() { if (idGenerator == null) { CommandExecutor idGeneratorCommandExecutor = null; if (idGeneratorDataSource != null) { ProcessEngineConfigurationImpl processEngineConfiguration = new StandaloneProcessEngineConfiguration(); processEngineConfiguration.setDataSource(idGeneratorDataSource); processEngineConfiguration.setDatabaseSchemaUpdate(DB_SCHEMA_UPDATE_FALSE); processEngineConfiguration.init(); idGeneratorCommandExecutor = processEngineConfiguration.getCommandExecutorTxRequiresNew(); } else if (idGeneratorDataSourceJndiName != null) { ProcessEngineConfigurationImpl processEngineConfiguration = new StandaloneProcessEngineConfiguration(); processEngineConfiguration.setDataSourceJndiName(idGeneratorDataSourceJndiName); processEngineConfiguration.setDatabaseSchemaUpdate(DB_SCHEMA_UPDATE_FALSE); processEngineConfiguration.init(); idGeneratorCommandExecutor = processEngineConfiguration.getCommandExecutorTxRequiresNew(); } else { idGeneratorCommandExecutor = commandExecutorTxRequiresNew; } DbIdGenerator dbIdGenerator = new DbIdGenerator(); dbIdGenerator.setIdBlockSize(idBlockSize); dbIdGenerator.setCommandExecutor(idGeneratorCommandExecutor); idGenerator = dbIdGenerator; } }
/** * Assert that String, int and boolean properties can be set. */ public void testProcessEngineConfigurationProperties() { ProcessEngineConfiguration engineConfiguration = new StandaloneProcessEngineConfiguration(); Map<String, String> propertiesToSet = new HashMap<String, String>(); propertiesToSet.put(JOB_EXECUTOR_DEPLOYMENT_AWARE_PROP, "true"); propertiesToSet.put(JOB_EXECUTOR_PREFER_TIMER_JOBS, "true"); propertiesToSet.put(JOB_EXECUTOR_ACQUIRE_BY_DUE_DATE, "true"); propertiesToSet.put(MAIL_SERVER_PORT_PROP, "42"); propertiesToSet.put(JDBC_URL_PROP, "someUrl"); PropertyHelper.applyProperties(engineConfiguration, propertiesToSet); Assert.assertTrue(engineConfiguration.isJobExecutorDeploymentAware()); Assert.assertTrue(engineConfiguration.isJobExecutorPreferTimerJobs()); Assert.assertTrue(engineConfiguration.isJobExecutorAcquireByDueDate()); Assert.assertEquals(42, engineConfiguration.getMailServerPort()); Assert.assertEquals("someUrl", engineConfiguration.getJdbcUrl()); }
ProcessEngine processEngine = new StandaloneProcessEngineConfiguration() .setProcessEngineName("reboot-test") .setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_FALSE) processEngine = new StandaloneProcessEngineConfiguration() .setProcessEngineName("reboot-test") .setDatabaseSchemaUpdate(org.camunda.bpm.engine.ProcessEngineConfiguration.DB_SCHEMA_UPDATE_FALSE)
public void testDeployRevisedProcessAfterDeleteOnOtherProcessEngine() { ProcessEngine processEngine1 = new StandaloneProcessEngineConfiguration() .setProcessEngineName("reboot-test-schema") .setDatabaseSchemaUpdate(org.camunda.bpm.engine.ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE) RepositoryService repositoryService1 = processEngine1.getRepositoryService(); ProcessEngine processEngine2 = new StandaloneProcessEngineConfiguration() .setProcessEngineName("reboot-test") .setDatabaseSchemaUpdate(org.camunda.bpm.engine.ProcessEngineConfiguration.DB_SCHEMA_UPDATE_FALSE)