<commit_before>/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.activiti.spring.test.taskassignment;

import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.impl.test.PvmTestCase;
import org.activiti.engine.impl.util.CollectionUtil;
import org.springframework.context.support.ClassPathXmlApplicationContext;


/**
 * @author <NAME>
 */
public class CustomTaskAssignmentTest extends PvmTestCase {
  
  public void testSetAssigneeThroughSpringService() {
    ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/activiti/spring/test/taskassignment/taskassignment-context.xml");
    RuntimeService runtimeService = (RuntimeService) applicationContext.getBean(RuntimeService.class);
    TaskService taskService = (TaskService) applicationContext.getBean(TaskService.class);
    
    runtimeService.startProcessInstanceByKey("assigneeThroughSpringService", CollectionUtil.singletonMap("emp", "fozzie"));
    assertEquals(1, taskService.createTaskQuery().taskAssignee("<NAME>").count());
  }

}
<commit_msg>ACT-221: renamed EventListener to ExecutionListener<commit_after>/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.activiti.spring.test.taskassignment;

import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.impl.test.PvmTestCase;
import org.activiti.engine.impl.util.CollectionUtil;
import org.activiti.engine.repository.Deployment;
import org.springframework.context.support.ClassPathXmlApplicationContext;


/**
 * @author <NAME>
 */
public class CustomTaskAssignmentTest extends PvmTestCase {
  
  public void testSetAssigneeThroughSpringService() {
    ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/activiti/spring/test/taskassignment/taskassignment-context.xml");
    RuntimeService runtimeService =  applicationContext.getBean(RuntimeService.class);
    TaskService taskService = applicationContext.getBean(TaskService.class);
    
    runtimeService.startProcessInstanceByKey("assigneeThroughSpringService", CollectionUtil.singletonMap("emp", "fozzie"));
    assertEquals(1, taskService.createTaskQuery().taskAssignee("<NAME>").count());
    
    // Remove deployments
    RepositoryService repositoryService = applicationContext.getBean(RepositoryService.class);
    for (Deployment deployment : repositoryService.createDeploymentQuery().list()) {
      repositoryService.deleteDeploymentCascade(deployment.getId());
    }
    applicationContext.destroy();
  }

}

{'fraction_non_alphanumeric': 0.09033842794759825, 'fraction_numerical': 0.0035480349344978166, 'mean_word_length': 5.385017421602788, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2567315', 'n_tokens_mistral': 942, 'n_tokens_neox': 923, 'n_words': 253}