test

package com.huike.hidp.system.workflow.service.impl;

import static org.junit.Assert.assertTrue;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Map;

import org.jbpm.api.Execution;
import org.jbpm.api.task.Task;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.huike.hidp.system.workflow.service.WorkFlowService;
import com.huike.hidp.system.workflow.service.util.JbpmTemplate;

public class WorkFlowServiceImplTest {

private static File zipFile = new File("WebRoot/jbpm/MyLeave.zip");

private static WorkFlowService workFlowService = null;

private static JbpmTemplate t = null;
private File file = null;

@BeforeClass
public static void setUp() throws Exception {
// new WorkFlowServiceImplTest().getWorkFlowServicesImpl();
String classPath = ClassLoader.getSystemResource("").toString();
int leg = classPath.substring(0, classPath.length() - 1).lastIndexOf(
"/");
classPath = classPath.substring(0, leg);
ApplicationContext ctx = new ClassPathXmlApplicationContext(
new String[] {
classPath + "/xml/hidp/applicationContext-service.xml",
classPath + "/xml/hidp/applicationContext-dao.xml",
classPath + "/xml/hidp/applicationContext.xml" });
workFlowService = (WorkFlowService) ctx
.getBean("workFlowService");
}

public static void p(Object o) {
System.out.println(o);
}
//
// @Test
// public void getWorkFlowServiceImpl() throws IOException {
// workFlowService = WorkFlowServiceImpl.getWorkFlowServiceImpl(zipFile);
// p(workFlowService);
// workFlowService = WorkFlowServiceImpl.getWorkFlowServiceImpl(zipFile);
// p(workFlowService);
// assertTrue(WorkFlowServiceImpl.getWorkFlowServiceImpl(zipFile) == WorkFlowServiceImpl
// .getWorkFlowServiceImpl(zipFile));
// }

@Test
public void testDeploy() throws Exception {
workFlowService.deployProcess(zipFile);
}

public void assignTask(String taskId, String userId) throws Exception {
// TODO Auto-generated method stub

}

public void completeTask(String taskId) throws Exception {
// TODO Auto-generated method stub

}

public boolean deleteProcess() throws Exception {
List plist = workFlowService.getProcessList();
String[] pId = new String[plist.size()] ;
plist.get(0);
return workFlowService.deleteProcess(pId);
}

public boolean deployProcess(File file) throws Exception {
return t.deploy(file);
}

public Execution findExecutionById(String executionId) throws Exception {
// TODO Auto-generated method stub
return null;
}

public Map<String, Object> getExecutionServiceVariables(String executionId)
throws Exception {
// TODO Auto-generated method stub
return null;
}

public Object getProcessDefinition(String[] pId) throws Exception {
// TODO Auto-generated method stub
return null;
}

public List getProcessList() throws Exception {
return null;
}

public List<Task> getUnassigned() throws Exception {
// TODO Auto-generated method stub
return null;
}

public InputStream imageStrean(String piId) throws Exception {
// TODO Auto-generated method stub
return null;
}

public boolean isActive(String activeName, String executionId)
throws Exception {
// TODO Auto-generated method stub
return false;
}

public boolean saveOrUpdateProcessState(String pid) {
// TODO Auto-generated method stub
return false;
}

public boolean serverDeployProcess(String path) throws Exception {
// TODO Auto-generated method stub
return false;
}

public void setExecutionServiceVariables(String executionId,
Map<String, Object> variables) throws Exception {
// TODO Auto-generated method stub

}

public void startProcessInstanceByKey(String key) throws Exception {
// TODO Auto-generated method stub

}
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值