Search in sources :

Example 96 with ProcessEngineConfigurationImpl

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

the class TestHelper method assertAndEnsureNoProcessApplicationsRegistered.

public static String assertAndEnsureNoProcessApplicationsRegistered(ProcessEngine processEngine) {
    ProcessEngineConfigurationImpl engineConfiguration = (ProcessEngineConfigurationImpl) processEngine.getProcessEngineConfiguration();
    ProcessApplicationManager processApplicationManager = engineConfiguration.getProcessApplicationManager();
    if (processApplicationManager.hasRegistrations()) {
        processApplicationManager.clearRegistrations();
        return "There are still process applications registered";
    } else {
        return null;
    }
}
Also used : ProcessApplicationManager(org.camunda.bpm.engine.impl.application.ProcessApplicationManager) ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)

Example 97 with ProcessEngineConfigurationImpl

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

the class TestHelper method assertAndEnsureCleanDeploymentCache.

/**
 * Ensures that the deployment cache is empty after a test. If not the cache
 * will be cleared.
 *
 * @param processEngine the {@link ProcessEngine} to test
 * @param fail if true the method will throw an {@link AssertionError} if the deployment cache is not clean
 * @return the deployment cache summary if fail is set to false or null if deployment cache was clean
 * @throws AssertionError if the deployment cache was not clean and fail is set to true
 */
public static String assertAndEnsureCleanDeploymentCache(ProcessEngine processEngine, boolean fail) {
    StringBuilder outputMessage = new StringBuilder();
    ProcessEngineConfigurationImpl processEngineConfiguration = ((ProcessEngineImpl) processEngine).getProcessEngineConfiguration();
    CachePurgeReport cachePurgeReport = processEngineConfiguration.getDeploymentCache().purgeCache();
    outputMessage.append(cachePurgeReport.getPurgeReportAsString());
    if (outputMessage.length() > 0) {
        outputMessage.insert(0, "Deployment cache not clean:\n");
        LOG.error(outputMessage.toString());
        if (fail) {
            Assert.fail(outputMessage.toString());
        }
        return outputMessage.toString();
    } else {
        LOG.debug("Deployment cache was clean");
        return null;
    }
}
Also used : CachePurgeReport(org.camunda.bpm.engine.impl.persistence.deploy.cache.CachePurgeReport) ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl) ProcessEngineImpl(org.camunda.bpm.engine.impl.ProcessEngineImpl)

Example 98 with ProcessEngineConfigurationImpl

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

the class BatchSuspensionTest method saveAndReduceBatchJobsPerSeed.

@Before
public void saveAndReduceBatchJobsPerSeed() {
    ProcessEngineConfigurationImpl configuration = engineRule.getProcessEngineConfiguration();
    defaultBatchJobsPerSeed = configuration.getBatchJobsPerSeed();
    // reduce number of batch jobs per seed to not have to create a lot of instances
    configuration.setBatchJobsPerSeed(1);
}
Also used : ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl) Before(org.junit.Before)

Example 99 with ProcessEngineConfigurationImpl

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

the class BatchPriorityTest method saveAndReduceBatchConfiguration.

@Before
public void saveAndReduceBatchConfiguration() {
    ProcessEngineConfigurationImpl configuration = engineRule.getProcessEngineConfiguration();
    defaultBatchJobsPerSeed = configuration.getBatchJobsPerSeed();
    defaultBatchJobPriority = configuration.getBatchJobPriority();
    // reduce number of batch jobs per seed to not have to create a lot of instances
    configuration.setBatchJobsPerSeed(1);
}
Also used : ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl) Before(org.junit.Before)

Example 100 with ProcessEngineConfigurationImpl

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

the class BatchPriorityTest method resetBatchJobsPerSeed.

@After
public void resetBatchJobsPerSeed() {
    ProcessEngineConfigurationImpl processEngineConfiguration = engineRule.getProcessEngineConfiguration();
    processEngineConfiguration.setBatchJobsPerSeed(defaultBatchJobsPerSeed);
    processEngineConfiguration.setBatchJobPriority(defaultBatchJobPriority);
}
Also used : ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl) After(org.junit.After)

Aggregations

ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)161 Test (org.junit.Test)35 HistoryLevel (org.camunda.bpm.engine.impl.history.HistoryLevel)22 DeploymentCache (org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache)18 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)17 CommandContext (org.camunda.bpm.engine.impl.interceptor.CommandContext)17 HistoryEvent (org.camunda.bpm.engine.impl.history.event.HistoryEvent)13 HistoryEventProcessor (org.camunda.bpm.engine.impl.history.event.HistoryEventProcessor)12 HistoryEventProducer (org.camunda.bpm.engine.impl.history.producer.HistoryEventProducer)12 Before (org.junit.Before)11 CommandChecker (org.camunda.bpm.engine.impl.cfg.CommandChecker)8 ProcessDefinitionEntity (org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity)8 After (org.junit.After)8 Date (java.util.Date)7 PooledDataSource (org.apache.ibatis.datasource.pooled.PooledDataSource)7 ProcessApplicationReference (org.camunda.bpm.application.ProcessApplicationReference)7 DefaultDmnEngineConfiguration (org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration)7 IdentityService (org.camunda.bpm.engine.IdentityService)7 ProcessEngineImpl (org.camunda.bpm.engine.impl.ProcessEngineImpl)7 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)6