Package org.camunda.bpm.engine

Examples of org.camunda.bpm.engine.ProcessEngineConfiguration


    when(engine.getCaseService()).thenReturn(caseService);
    when(engine.getFilterService()).thenReturn(filterService);
  }

  protected void mockProcessEngineConfiguration(ProcessEngine engine) {
    ProcessEngineConfiguration configuration = mock(ProcessEngineConfiguration.class);
    when(configuration.getValueTypeResolver()).thenReturn(mockValueTypeResolver());
    when(engine.getProcessEngineConfiguration()).thenReturn(configuration);
  }
View Full Code Here


      assertTextPresent("no activiti tables in db", e.getMessage());
    }
  }

  public void testDefaultRetries() {
    ProcessEngineConfiguration configuration = ProcessEngineConfiguration
      .createProcessEngineConfigurationFromResource("org/camunda/bpm/engine/test/standalone/initialization/defaultretries.camunda.cfg.xml");

    assertEquals(JobEntity.DEFAULT_RETRIES, configuration.getDefaultNumberOfRetries());
  }
View Full Code Here

    assertEquals(JobEntity.DEFAULT_RETRIES, configuration.getDefaultNumberOfRetries());
  }

  public void testCustomDefaultRetries() {
    ProcessEngineConfiguration configuration = ProcessEngineConfiguration
      .createProcessEngineConfigurationFromResource("org/camunda/bpm/engine/test/standalone/initialization/customdefaultretries.camunda.cfg.xml");

    assertEquals(5, configuration.getDefaultNumberOfRetries());
  }
View Full Code Here

    return processEngineConfiguration.getCommandExecutorTxRequired().execute(new AcquireJobsCmd(jobExecutor));
  }

  private String deployAndInstantiateWithNewEngineConfiguration(String resource) {
    // 1. create another process engine confguration
    ProcessEngineConfiguration otherProcessEngineConfiguration = null;
    try {
      otherProcessEngineConfiguration = ProcessEngineConfiguration
          .createProcessEngineConfigurationFromResource("camunda.cfg.xml")
          .setJobExecutorDeploymentAware(true);
    } catch (RuntimeException ex) {
      if (ex.getCause() != null && ex.getCause() instanceof FileNotFoundException) {
        otherProcessEngineConfiguration = ProcessEngineConfiguration
            .createProcessEngineConfigurationFromResource("activiti.cfg.xml")
            .setJobExecutorDeploymentAware(true);
      } else {
        throw ex;
      }
    }
    ProcessEngine otherEngine = otherProcessEngineConfiguration.buildProcessEngine();

    // 2. deploy again
    RepositoryService otherRepositoryService = otherEngine.getRepositoryService();

    String deploymentId = otherRepositoryService.createDeployment()
View Full Code Here

    assertEquals(new TreeSet<String>(expectedMessages), new TreeSet<String>(messages));
  }

  public void testJobExecutorHintConfiguration() {
    ProcessEngineConfiguration engineConfig1 =
        ProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration();

    assertTrue("default setting is true", engineConfig1.isHintJobExecutor());

    ProcessEngineConfiguration engineConfig2 =
        ProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration().setHintJobExecutor(false);

    assertFalse(engineConfig2.isHintJobExecutor());

    ProcessEngineConfiguration engineConfig3 =
        ProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration().setHintJobExecutor(true);

    assertTrue(engineConfig3.isHintJobExecutor());
  }
View Full Code Here

  /**
   * 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(MAIL_SERVER_PORT_PROP, "42");
    propertiesToSet.put(JDBC_URL_PROP, "someUrl");
   
    PropertyHelper.applyProperties(engineConfiguration, propertiesToSet);
   
    Assert.assertTrue(engineConfiguration.isJobExecutorDeploymentAware());
    Assert.assertEquals(42, engineConfiguration.getMailServerPort());
    Assert.assertEquals("someUrl", engineConfiguration.getJdbcUrl());
  }
View Full Code Here

   
    Assert.assertTrue(engineConfiguration.isDbIdentityUsed());
  }
 
  public void testNonExistingPropertyForProcessEngineConfiguration() {
    ProcessEngineConfiguration engineConfiguration = new StandaloneProcessEngineConfiguration();
    Map<String, String> propertiesToSet = new HashMap<String, String>();
    propertiesToSet.put("aNonExistingProperty", "someValue");
   
    try {
      PropertyHelper.applyProperties(engineConfiguration, propertiesToSet);
View Full Code Here

    ProcessEngine processEngine = BpmPlatform.getProcessEngineService().getProcessEngine("embeddedEngine");
    assertNotNull(processEngine);
    assertEquals("embeddedEngine", processEngine.getName());

    ProcessEngineConfiguration configuration = ((ProcessEngineImpl) processEngine).getProcessEngineConfiguration();

    // assert engine properties specified
    assertEquals(true, configuration.isJobExecutorDeploymentAware());
    assertEquals(5, configuration.getJdbcMaxActiveConnections());

    processApplication.undeploy();

  }
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.ProcessEngineConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.