use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class BatchMigrationTest method testMigrationJobsExecutionByJobExecutorWithAuthorizationEnabledAndTenant.
@Test
public void testMigrationJobsExecutionByJobExecutorWithAuthorizationEnabledAndTenant() {
ProcessEngineConfigurationImpl processEngineConfiguration = engineRule.getProcessEngineConfiguration();
processEngineConfiguration.setAuthorizationEnabled(true);
try {
Batch batch = helper.migrateProcessInstancesAsyncForTenant(10, "someTenantId");
helper.executeSeedJob(batch);
testRule.waitForJobExecutorToProcessAllJobs();
// then all process instances where migrated
assertEquals(0, helper.countSourceProcessInstances());
assertEquals(10, helper.countTargetProcessInstances());
} finally {
processEngineConfiguration.setAuthorizationEnabled(false);
}
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class BatchMigrationTest method testDefaultBatchConfiguration.
@Test
public void testDefaultBatchConfiguration() {
ProcessEngineConfigurationImpl configuration = engineRule.getProcessEngineConfiguration();
assertEquals(100, configuration.getBatchJobsPerSeed());
assertEquals(1, configuration.getInvocationsPerBatchJob());
assertEquals(30, configuration.getBatchPollTime());
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class BatchMigrationTest method restoreEngineSettings.
@After
public void restoreEngineSettings() {
ProcessEngineConfigurationImpl configuration = engineRule.getProcessEngineConfiguration();
configuration.setBatchJobsPerSeed(defaultBatchJobsPerSeed);
configuration.setInvocationsPerBatchJob(defaultInvocationsPerBatchJob);
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class SentryScenarioTest method createCaseSentryPartQuery.
// queries /////////////////////////////////
protected CaseSentryPartQueryImpl createCaseSentryPartQuery() {
ProcessEngine processEngine = rule.getProcessEngine();
ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) processEngine.getProcessEngineConfiguration();
CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutorTxRequiresNew();
return new CaseSentryPartQueryImpl(commandExecutor);
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class JobMigrationScenario method triggerEntryCriterion.
@DescribesScenario("createJob")
public static ScenarioSetup triggerEntryCriterion() {
return new ScenarioSetup() {
public void execute(ProcessEngine engine, final String scenarioName) {
final ProcessEngineConfigurationImpl engineConfiguration = (ProcessEngineConfigurationImpl) engine.getProcessEngineConfiguration();
CommandExecutor commandExecutor = engineConfiguration.getCommandExecutorTxRequired();
// create a job with the scenario name as id and a null suspension state
commandExecutor.execute(new Command<Void>() {
public Void execute(CommandContext commandContext) {
Connection connection = null;
Statement statement = null;
ResultSet rs = null;
try {
SqlSession sqlSession = commandContext.getDbSqlSession().getSqlSession();
connection = sqlSession.getConnection();
statement = connection.createStatement();
statement.executeUpdate("INSERT INTO ACT_RU_JOB(ID_, REV_, RETRIES_, TYPE_, EXCLUSIVE_, HANDLER_TYPE_) " + "VALUES (" + "'" + scenarioName + "'," + "1," + "3," + "'timer'," + DbSqlSessionFactory.databaseSpecificTrueConstant.get(engineConfiguration.getDatabaseType()) + "," + "'" + TimerStartEventJobHandler.TYPE + "'" + ")");
connection.commit();
statement.close();
} catch (SQLException e) {
throw new RuntimeException(e);
} finally {
try {
if (statement != null) {
statement.close();
}
if (rs != null) {
rs.close();
}
if (connection != null) {
connection.close();
}
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
return null;
}
});
}
};
}
Aggregations