<commit_before>package org.camunda.bpm.integrationtest.jobexecutor;

import org.camunda.bpm.integrationtest.jobexecutor.beans.FailingSLSB;
import org.camunda.bpm.integrationtest.util.AbstractFoxPlatformIntegrationTest;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;


@RunWith(Arquillian.class)
public class FailedJobCommandTest extends AbstractFoxPlatformIntegrationTest {
  
  @Deployment
  public static WebArchive createDeployment() {
    return initWebArchiveDeployment()
      .addClass(FailingSLSB.class)
      .addAsResource("org/camunda/bpm/integrationtest/jobexecutor/FailedJobCommandTest.bpmn20.xml");
      
  }
  
  @Test
  public void testJobRetriesDecremented() {
    runtimeService.startProcessInstanceByKey("theProcess");
    
    Assert.assertEquals(1, managementService.createJobQuery().withRetriesLeft().count());
    
    waitForJobExecutorToProcessAllJobs(6000, 500);
    
    // now the retries = 0
    
    Assert.assertEquals(0, managementService.createJobQuery().withRetriesLeft().count());
    
  }
  
  @Test
  public void testJobRetriesDecremented_multiple() {
    <commit_msg>fix(tests): increase timeout for failed job test<commit_after>package org.camunda.bpm.integrationtest.jobexecutor;

import org.camunda.bpm.integrationtest.jobexecutor.beans.FailingSLSB;
import org.camunda.bpm.integrationtest.util.AbstractFoxPlatformIntegrationTest;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;


@RunWith(Arquillian.class)
public class FailedJobCommandTest extends AbstractFoxPlatformIntegrationTest {
  
  @Deployment
  public static WebArchive createDeployment() {
    return initWebArchiveDeployment()
      .addClass(FailingSLSB.class)
      .addAsResource("org/camunda/bpm/integrationtest/jobexecutor/FailedJobCommandTest.bpmn20.xml");
      
  }
  
  @Test
  public void testJobRetriesDecremented() {
    runtimeService.startProcessInstanceByKey("theProcess");
    
    Assert.assertEquals(1, managementService.createJobQuery().withRetriesLeft().count());
    
    waitForJobExecutorToProcessAllJobs(30000, 500);
    
    // now the retries = 0
    
    Assert.assertEquals(0, managementService.createJobQuery().withRetriesLeft().count());
    
  }
  
  @Test
  public void testJobRetriesDecremented_multiple() {
    
{'fraction_non_alphanumeric': 0.09870426829268293, 'fraction_numerical': 0.009527439024390244, 'mean_word_length': 4.898876404494382, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1470372', 'n_tokens_mistral': 861, 'n_tokens_neox': 802, 'n_words': 110}