Search in sources :

Example 11 with StandaloneInMemProcessEngineConfiguration

use of org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration in project camunda-bpm-platform by camunda.

the class MultiEngineCommandContextTest method createProcessEngine.

private ProcessEngine createProcessEngine(String name) {
    StandaloneInMemProcessEngineConfiguration processEngineConfiguration = new StandaloneInMemProcessEngineConfiguration();
    processEngineConfiguration.setProcessEngineName(name);
    processEngineConfiguration.setJdbcUrl(String.format("jdbc:h2:mem:%s", name));
    return processEngineConfiguration.buildProcessEngine();
}
Also used : StandaloneInMemProcessEngineConfiguration(org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration)

Example 12 with StandaloneInMemProcessEngineConfiguration

use of org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration in project camunda-bpm-platform by camunda.

the class DatabaseHistoryPropertyAutoTest method config.

private static ProcessEngineConfigurationImpl config(final String schemaUpdate, final String historyLevel) {
    StandaloneInMemProcessEngineConfiguration engineConfiguration = new StandaloneInMemProcessEngineConfiguration();
    engineConfiguration.setProcessEngineName(UUID.randomUUID().toString());
    engineConfiguration.setDatabaseSchemaUpdate(schemaUpdate);
    engineConfiguration.setHistory(historyLevel);
    engineConfiguration.setDbMetricsReporterActivate(false);
    engineConfiguration.setJdbcUrl("jdbc:h2:mem:DatabaseHistoryPropertyAutoTest");
    return engineConfiguration;
}
Also used : StandaloneInMemProcessEngineConfiguration(org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration)

Example 13 with StandaloneInMemProcessEngineConfiguration

use of org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration in project camunda-bpm-platform by camunda.

the class ForceCloseMybatisConnectionPoolTest method testForceCloseMybatisConnectionPoolTrue.

@Test
public void testForceCloseMybatisConnectionPoolTrue() {
    // given
    // that the process engine is configured with forceCloseMybatisConnectionPool = true
    ProcessEngineConfigurationImpl configurationImpl = new StandaloneInMemProcessEngineConfiguration().setJdbcUrl("jdbc:h2:mem:camunda-forceclose").setProcessEngineName("engine-forceclose").setForceCloseMybatisConnectionPool(true);
    ProcessEngine processEngine = configurationImpl.buildProcessEngine();
    PooledDataSource pooledDataSource = (PooledDataSource) configurationImpl.getDataSource();
    PoolState state = pooledDataSource.getPoolState();
    // then
    // if the process engine is closed
    processEngine.close();
    // the idle connections are closed
    Assert.assertTrue(state.getIdleConnectionCount() == 0);
}
Also used : PoolState(org.apache.ibatis.datasource.pooled.PoolState) ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl) StandaloneInMemProcessEngineConfiguration(org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration) ProcessEngine(org.camunda.bpm.engine.ProcessEngine) PooledDataSource(org.apache.ibatis.datasource.pooled.PooledDataSource) Test(org.junit.Test)

Example 14 with StandaloneInMemProcessEngineConfiguration

use of org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration in project camunda-bpm-platform by camunda.

the class DatabaseTableSchemaTest method testCreateConfigurationWithMissingDotInSchemaAndPrefix.

public void testCreateConfigurationWithMissingDotInSchemaAndPrefix() {
    try {
        StandaloneInMemProcessEngineConfiguration configuration = new StandaloneInMemProcessEngineConfiguration();
        configuration.setDatabaseSchema("foo");
        configuration.setDatabaseTablePrefix("foo");
        configuration.buildProcessEngine();
        fail("Should throw exception");
    } catch (ProcessEngineException e) {
        // as expected
        assertTrue(e.getMessage().contains("When setting a schema the prefix has to be schema + '.'"));
    }
}
Also used : StandaloneInMemProcessEngineConfiguration(org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException)

Example 15 with StandaloneInMemProcessEngineConfiguration

use of org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration in project camunda-bpm-platform by camunda.

the class DmnDisabledTest method createProcessEngineImpl.

protected static ProcessEngineImpl createProcessEngineImpl(boolean dmnEnabled) {
    StandaloneInMemProcessEngineConfiguration config = (StandaloneInMemProcessEngineConfiguration) new CustomStandaloneInMemProcessEngineConfiguration().setProcessEngineName("database-dmn-test-engine").setDatabaseSchemaUpdate("false").setHistory(ProcessEngineConfiguration.HISTORY_FULL).setJdbcUrl("jdbc:h2:mem:DatabaseDmnTest");
    config.setDmnEnabled(dmnEnabled);
    return (ProcessEngineImpl) config.buildProcessEngine();
}
Also used : StandaloneInMemProcessEngineConfiguration(org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration) ProcessEngineImpl(org.camunda.bpm.engine.impl.ProcessEngineImpl)

Aggregations

StandaloneInMemProcessEngineConfiguration (org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration)16 Test (org.junit.Test)8 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)6 ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)6 StandaloneProcessEngineConfiguration (org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration)4 Calendar (java.util.Calendar)3 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)3 PoolState (org.apache.ibatis.datasource.pooled.PoolState)2 PooledDataSource (org.apache.ibatis.datasource.pooled.PooledDataSource)2 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)2 ObjectValue (org.camunda.bpm.engine.variable.value.ObjectValue)2 TaskService (org.camunda.bpm.engine.TaskService)1 ProcessEngineImpl (org.camunda.bpm.engine.impl.ProcessEngineImpl)1 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)1 Task (org.camunda.bpm.engine.task.Task)1 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)1