Java Code Examples for org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration#setJdbcUrl()

The following examples show how to use org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration#setJdbcUrl() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HistoryLevelTest.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
protected ProcessEngineConfigurationImpl createConfig() {
  StandaloneInMemProcessEngineConfiguration configuration = new StandaloneInMemProcessEngineConfiguration();
  configuration.setProcessEngineName("process-engine-HistoryTest");
  configuration.setDbMetricsReporterActivate(false);
  configuration.setJdbcUrl("jdbc:h2:mem:HistoryTest");
  return configuration;
}
 
Example 2
Source File: DatabaseHistoryPropertyAutoTest.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 3
Source File: TelemetryConfigurationTest.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
@Test
public void shouldHaveDisabledTelemetryByDefault() {
  // given
  processEngineConfiguration = new StandaloneInMemProcessEngineConfiguration();
  processEngineConfiguration
                            .setJdbcUrl("jdbc:h2:mem:camunda" + getClass().getSimpleName());

  // when
  processEngineConfiguration.buildProcessEngine();

  // then
  assertThat(processEngineConfiguration.isInitializeTelemetry()).isFalse();
  assertThat(processEngineConfiguration.getManagementService().isTelemetryEnabled()).isFalse();
}
 
Example 4
Source File: DetermineHistoryLevelCmdTest.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 5
Source File: CamundaEngineHelper.java    From flowing-retail-old with Apache License 2.0 4 votes vote down vote up
public static ProcessEngine startUpEngineAndInit() {
  Server h2Server = null;

  StandaloneInMemProcessEngineConfiguration config = new StandaloneInMemProcessEngineConfiguration();
  config.setHistoryLevel(HistoryLevel.HISTORY_LEVEL_FULL);
  config.setJdbcUsername("sa");
  config.setJdbcPassword("sa");

  // if the DB was already started (by another engine in another Microservice)
  // connect to this DB instead of starting an own one
  if (isH2DbAlreadyRunning()) {
    config.setJdbcUrl(h2DbJdbcUrl);
    config.setDatabaseSchemaUpdate("false");
  } else {
    // use in memory DB, but expose as server
    config.setJdbcUrl(h2DbServerJdbcUrl);
    h2Server = startH2Server();
  }
  ProcessEngine engine = config.buildProcessEngine();

  // create Demo users and add enterprise license (if existent in file
  // ~/.camunda/build.properties)
  LicenseHelper.setLicense(engine);
  UserGenerator.createDefaultUsers(engine);
      
  final Server h2 = h2Server;
  Runtime.getRuntime().addShutdownHook(new Thread() {
    @Override
    public void run() {
      try {
        engine.close();
        if (h2!=null) {
          h2.stop();
        }
      } catch (Exception e) {
        throw new RuntimeException("Could not disconnect: " + e.getMessage(), e);
      }
    }
  });
  
  return engine;
}
 
Example 6
Source File: CamundaEngineHelper.java    From flowing-retail-old with Apache License 2.0 4 votes vote down vote up
public static ProcessEngine startUpEngineAndInit() {
  Server h2Server = null;

  StandaloneInMemProcessEngineConfiguration config = new StandaloneInMemProcessEngineConfiguration();
  config.setHistoryLevel(HistoryLevel.HISTORY_LEVEL_FULL);
  config.setJdbcUsername("sa");
  config.setJdbcPassword("sa");

  // if the DB was already started (by another engine in another Microservice)
  // connect to this DB instead of starting an own one
  if (isH2DbAlreadyRunning()) {
    config.setJdbcUrl(h2DbJdbcUrl);
    config.setDatabaseSchemaUpdate("false");
  } else {
    // use in memory DB, but expose as server
    config.setJdbcUrl(h2DbServerJdbcUrl);
    h2Server = startH2Server();
  }
  ProcessEngine engine = config.buildProcessEngine();

  // create Demo users and add enterprise license (if existent in file
  // ~/.camunda/build.properties)
  LicenseHelper.setLicense(engine);
  UserGenerator.createDefaultUsers(engine);
      
  final Server h2 = h2Server;
  Runtime.getRuntime().addShutdownHook(new Thread() {
    @Override
    public void run() {
      try {
        engine.close();
        if (h2!=null) {
          h2.stop();
        }
      } catch (Exception e) {
        throw new RuntimeException("Could not disconnect: " + e.getMessage(), e);
      }
    }
  });
  
  return engine;
}
 
Example 7
Source File: MultiEngineCommandContextTest.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
private ProcessEngine createProcessEngine(String name) {
  StandaloneInMemProcessEngineConfiguration processEngineConfiguration = new StandaloneInMemProcessEngineConfiguration();
  processEngineConfiguration.setProcessEngineName(name);
  processEngineConfiguration.setJdbcUrl(String.format("jdbc:h2:mem:%s", name));
  return processEngineConfiguration.buildProcessEngine();
}