use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class TransactionIsolationLevelTest method testTransactionIsolationLevelOnConnection.
@Test
public void testTransactionIsolationLevelOnConnection() {
ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) processEngine.getProcessEngineConfiguration();
SqlSession sqlSession = processEngineConfiguration.getDbSqlSessionFactory().getSqlSessionFactory().openSession();
try {
int transactionIsolation = sqlSession.getConnection().getTransactionIsolation();
assertEquals("TransactionIsolationLevel for connection is " + transactionIsolation + " instead of " + Connection.TRANSACTION_READ_COMMITTED, Connection.TRANSACTION_READ_COMMITTED, transactionIsolation);
} catch (SQLException e) {
e.printStackTrace();
}
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class TestJobExecutorActivateFalse_JBOSS method shouldNotActiateJobExecutor.
@Test
public void shouldNotActiateJobExecutor() {
ProcessEngine processEngine = processEngineService.getProcessEngine("jobExecutorActivate-FALSE-engine");
ProcessEngineConfiguration configuration = processEngine.getProcessEngineConfiguration();
JobExecutor jobExecutor = ((ProcessEngineConfigurationImpl) configuration).getJobExecutor();
assertFalse(jobExecutor.isActive());
processEngine = processEngineService.getProcessEngine("jobExecutorActivate-UNDEFINED-engine");
configuration = processEngine.getProcessEngineConfiguration();
jobExecutor = ((ProcessEngineConfigurationImpl) configuration).getJobExecutor();
assertTrue(jobExecutor.isActive());
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class DetermineHistoryLevelCmdTest method failWhenExistingHistoryLevelIsNotRegistered.
@Test
public void failWhenExistingHistoryLevelIsNotRegistered() {
// init the db with custom level
HistoryLevel customLevel = new HistoryLevel() {
@Override
public int getId() {
return 99;
}
@Override
public String getName() {
return "custom";
}
@Override
public boolean isHistoryEventProduced(HistoryEventType eventType, Object entity) {
return false;
}
};
ProcessEngineConfigurationImpl config = config("true", "custom");
config.setCustomHistoryLevels(Arrays.asList(customLevel));
processEngineImpl = (ProcessEngineImpl) config.buildProcessEngine();
thrown.expect(ProcessEngineException.class);
thrown.expectMessage("The configured history level with id='99' is not registered in this config.");
config.getCommandExecutorSchemaOperations().execute(new DetermineHistoryLevelCmd(Collections.<HistoryLevel>emptyList()));
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class DetermineHistoryLevelCmdTest method readLevelFullfromDB.
@Test
public void readLevelFullfromDB() throws Exception {
final ProcessEngineConfigurationImpl config = config("true", ProcessEngineConfiguration.HISTORY_FULL);
// init the db with level=full
processEngineImpl = (ProcessEngineImpl) config.buildProcessEngine();
HistoryLevel historyLevel = config.getCommandExecutorSchemaOperations().execute(new DetermineHistoryLevelCmd(config.getHistoryLevels()));
assertThat(historyLevel, CoreMatchers.equalTo(HistoryLevel.HISTORY_LEVEL_FULL));
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class SpinProcessEnginePluginTest method testPluginRegistersXmlSerializerIfPresentInClasspath.
public void testPluginRegistersXmlSerializerIfPresentInClasspath() {
DataFormats.loadDataFormats(null);
ProcessEngineConfigurationImpl mockConfig = Mockito.mock(ProcessEngineConfigurationImpl.class);
Mockito.when(mockConfig.getVariableSerializers()).thenReturn(processEngineConfiguration.getVariableSerializers());
new SpinProcessEnginePlugin().registerSerializers(mockConfig);
assertTrue(processEngineConfiguration.getVariableSerializers().getSerializerByName(XmlValueType.TYPE_NAME) instanceof XmlValueSerializer);
}
Aggregations