Tabnine Logo
AcquiredJobs.contains
Code IndexAdd Tabnine to your IDE (free)

How to use
contains
method
in
org.camunda.bpm.engine.impl.jobexecutor.AcquiredJobs

Best Java code snippets using org.camunda.bpm.engine.impl.jobexecutor.AcquiredJobs.contains (Showing top 8 results out of 315)

origin: camunda/camunda-bpm-platform

@Deployment(resources = "org/camunda/bpm/engine/test/jobexecutor/simpleAsyncProcess.bpmn20.xml")
public void testProcessingOfJobsWithMatchingDeployment() {
 runtimeService.startProcessInstanceByKey("simpleAsyncProcess");
 Set<String> registeredDeployments = managementService.getRegisteredDeployments();
 Assert.assertEquals(1, registeredDeployments.size());
 Assert.assertTrue(registeredDeployments.contains(deploymentId));
 Job executableJob = managementService.createJobQuery().singleResult();
 String otherDeploymentId =
   deployAndInstantiateWithNewEngineConfiguration(
     "org/camunda/bpm/engine/test/jobexecutor/simpleAsyncProcessVersion2.bpmn20.xml");
 // assert that two jobs have been created, one for each deployment
 List<Job> jobs = managementService.createJobQuery().list();
 Assert.assertEquals(2, jobs.size());
 Set<String> jobDeploymentIds = new HashSet<String>();
 jobDeploymentIds.add(jobs.get(0).getDeploymentId());
 jobDeploymentIds.add(jobs.get(1).getDeploymentId());
 Assert.assertTrue(jobDeploymentIds.contains(deploymentId));
 Assert.assertTrue(jobDeploymentIds.contains(otherDeploymentId));
 // select executable jobs for executor of first engine
 AcquiredJobs acquiredJobs = getExecutableJobs(processEngineConfiguration.getJobExecutor());
 Assert.assertEquals(1, acquiredJobs.size());
 Assert.assertTrue(acquiredJobs.contains(executableJob.getId()));
 repositoryService.deleteDeployment(otherDeploymentId, true);
}
origin: camunda/camunda-bpm-platform

public void testJobsWithoutDeploymentIdAreAlwaysProcessed() {
 CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutorTxRequired();
 String messageId = commandExecutor.execute(new Command<String>() {
  public String execute(CommandContext commandContext) {
   MessageEntity message = new MessageEntity();
   commandContext.getJobManager().send(message);
   return message.getId();
  }
 });
 AcquiredJobs acquiredJobs = getExecutableJobs(processEngineConfiguration.getJobExecutor());
 Assert.assertEquals(1, acquiredJobs.size());
 Assert.assertTrue(acquiredJobs.contains(messageId));
 commandExecutor.execute(new DeleteJobsCmd(messageId, true));
}
origin: camunda/camunda-bpm-platform

@OperateOnDeployment("pa1")
@Test
public void testDeploymentAwareJobAcquisition() {
 JobExecutor jobExecutor1 = engine1Configuration.getJobExecutor();
 ProcessInstance instance1 = engine1.getRuntimeService().startProcessInstanceByKey("archive1Process");
 ProcessInstance instance2 = processEngine.getRuntimeService().startProcessInstanceByKey("archive2Process");
 Job job1 = managementService.createJobQuery().processInstanceId(instance1.getId()).singleResult();
 Job job2 = managementService.createJobQuery().processInstanceId(instance2.getId()).singleResult();
 // the deployment aware configuration should only return the jobs of the registered deployments
 CommandExecutor commandExecutor = engine1Configuration.getCommandExecutorTxRequired();
 AcquiredJobs acquiredJobs = commandExecutor.execute(new AcquireJobsCmd(jobExecutor1));
 Assert.assertEquals(1, acquiredJobs.size());
 Assert.assertTrue(acquiredJobs.contains(job1.getId()));
 Assert.assertFalse(acquiredJobs.contains(job2.getId()));
}
origin: camunda/camunda-bpm-platform

@Deployment(resources = "org/camunda/bpm/engine/test/jobexecutor/simpleAsyncProcess.bpmn20.xml")
public void testExplicitDeploymentRegistration() {
 runtimeService.startProcessInstanceByKey("simpleAsyncProcess");
 String otherDeploymentId =
   deployAndInstantiateWithNewEngineConfiguration(
     "org/camunda/bpm/engine/test/jobexecutor/simpleAsyncProcessVersion2.bpmn20.xml");
 processEngine.getManagementService().registerDeploymentForJobExecutor(otherDeploymentId);
 List<Job> jobs = managementService.createJobQuery().list();
 AcquiredJobs acquiredJobs = getExecutableJobs(processEngineConfiguration.getJobExecutor());
 Assert.assertEquals(2, acquiredJobs.size());
 for (Job job : jobs) {
  Assert.assertTrue(acquiredJobs.contains(job.getId()));
 }
 repositoryService.deleteDeployment(otherDeploymentId, true);
}
origin: camunda/camunda-bpm-platform

 @OperateOnDeployment("pa1")
 @Test
 public void testDeploymentUnawareJobAcquisition() {
  JobExecutor defaultJobExecutor = processEngineConfiguration.getJobExecutor();

  ProcessInstance instance1 = engine1.getRuntimeService().startProcessInstanceByKey("archive1Process");
  ProcessInstance instance2 = processEngine.getRuntimeService().startProcessInstanceByKey("archive2Process");

  Job job1 = managementService.createJobQuery().processInstanceId(instance1.getId()).singleResult();
  Job job2 = managementService.createJobQuery().processInstanceId(instance2.getId()).singleResult();

  // the deployment unaware configuration should return both jobs
  CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutorTxRequired();
  processEngineConfiguration.setJobExecutorDeploymentAware(false);
  try {
   AcquiredJobs acquiredJobs = commandExecutor.execute(new AcquireJobsCmd(defaultJobExecutor));

   Assert.assertEquals(2, acquiredJobs.size());
   Assert.assertTrue(acquiredJobs.contains(job1.getId()));
   Assert.assertTrue(acquiredJobs.contains(job2.getId()));
  } finally {
   processEngineConfiguration.setJobExecutorDeploymentAware(true);
  }
 }
}
origin: org.camunda.bpm/camunda-engine

@Deployment(resources = "org/camunda/bpm/engine/test/jobexecutor/simpleAsyncProcess.bpmn20.xml")
public void testProcessingOfJobsWithMatchingDeployment() {
 runtimeService.startProcessInstanceByKey("simpleAsyncProcess");
 Set<String> registeredDeployments = managementService.getRegisteredDeployments();
 Assert.assertEquals(1, registeredDeployments.size());
 Assert.assertTrue(registeredDeployments.contains(deploymentId));
 Job executableJob = managementService.createJobQuery().singleResult();
 String otherDeploymentId =
   deployAndInstantiateWithNewEngineConfiguration(
     "org/camunda/bpm/engine/test/jobexecutor/simpleAsyncProcessVersion2.bpmn20.xml");
 // assert that two jobs have been created, one for each deployment
 List<Job> jobs = managementService.createJobQuery().list();
 Assert.assertEquals(2, jobs.size());
 Set<String> jobDeploymentIds = new HashSet<String>();
 jobDeploymentIds.add(jobs.get(0).getDeploymentId());
 jobDeploymentIds.add(jobs.get(1).getDeploymentId());
 Assert.assertTrue(jobDeploymentIds.contains(deploymentId));
 Assert.assertTrue(jobDeploymentIds.contains(otherDeploymentId));
 // select executable jobs for executor of first engine
 AcquiredJobs acquiredJobs = getExecutableJobs(processEngineConfiguration.getJobExecutor());
 Assert.assertEquals(1, acquiredJobs.size());
 Assert.assertTrue(acquiredJobs.contains(executableJob.getId()));
 repositoryService.deleteDeployment(otherDeploymentId, true);
}
origin: org.camunda.bpm/camunda-engine

public void testJobsWithoutDeploymentIdAreAlwaysProcessed() {
 CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutorTxRequired();
 String messageId = commandExecutor.execute(new Command<String>() {
  public String execute(CommandContext commandContext) {
   MessageEntity message = new MessageEntity();
   commandContext.getJobManager().send(message);
   return message.getId();
  }
 });
 AcquiredJobs acquiredJobs = getExecutableJobs(processEngineConfiguration.getJobExecutor());
 Assert.assertEquals(1, acquiredJobs.size());
 Assert.assertTrue(acquiredJobs.contains(messageId));
 commandExecutor.execute(new DeleteJobsCmd(messageId, true));
}
origin: org.camunda.bpm/camunda-engine

@Deployment(resources = "org/camunda/bpm/engine/test/jobexecutor/simpleAsyncProcess.bpmn20.xml")
public void testExplicitDeploymentRegistration() {
 runtimeService.startProcessInstanceByKey("simpleAsyncProcess");
 String otherDeploymentId =
   deployAndInstantiateWithNewEngineConfiguration(
     "org/camunda/bpm/engine/test/jobexecutor/simpleAsyncProcessVersion2.bpmn20.xml");
 processEngine.getManagementService().registerDeploymentForJobExecutor(otherDeploymentId);
 List<Job> jobs = managementService.createJobQuery().list();
 AcquiredJobs acquiredJobs = getExecutableJobs(processEngineConfiguration.getJobExecutor());
 Assert.assertEquals(2, acquiredJobs.size());
 for (Job job : jobs) {
  Assert.assertTrue(acquiredJobs.contains(job.getId()));
 }
 repositoryService.deleteDeployment(otherDeploymentId, true);
}
org.camunda.bpm.engine.impl.jobexecutorAcquiredJobscontains

Popular methods of AcquiredJobs

  • size
  • <init>
  • addJobIdBatch
  • getJobIdBatches
  • removeJobId
  • getNumberOfJobsAttemptedToAcquire
  • getNumberOfJobsFailedToLock

Popular in Java

  • Reading from database using SQL prepared statement
  • putExtra (Intent)
  • setContentView (Activity)
  • startActivity (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • Permission (java.security)
    Legacy security code; do not use.
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now