Package org.activiti.designer.test

Source Code of org.activiti.designer.test.ProcessTestMultiProcessInOneFile

package org.activiti.designer.test;

import static org.junit.Assert.assertEquals;

import java.io.FileInputStream;
import java.util.List;

import org.activiti.engine.RepositoryService;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.test.ActivitiRule;
import org.junit.Rule;
import org.junit.Test;

public class ProcessTestMultiProcessInOneFile {

  private String filename = "/Users/henryyan/work/projects/activiti/activiti-study/src/test/resources/diagrams/MultiProcessInOneFile.bpmn";

  @Rule
  public ActivitiRule activitiRule = new ActivitiRule();

  @Test
  public void startProcess() throws Exception {
    RepositoryService repositoryService = activitiRule
        .getRepositoryService();
    repositoryService
        .createDeployment()
        .addInputStream("MultiProcessInOneFile.bpmn20.xml",
            new FileInputStream(filename)).deploy();
    long count = repositoryService.createProcessDefinitionQuery().count();
    assertEquals(2, count);
   
    List<ProcessDefinition> list = repositoryService.createProcessDefinitionQuery().list();
    assertEquals("process1", list.get(0).getKey());
    assertEquals("leave", list.get(1).getKey());
  }
}
TOP

Related Classes of org.activiti.designer.test.ProcessTestMultiProcessInOneFile

TOP
Copyright © 2018 www.massapi.com. 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.