天天看点

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); 

// 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 { 

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 { 

return null; 

public map<string, object> getexecutionservicevariables(string executionid) 

throws exception { 

public object getprocessdefinition(string[] pid) throws exception { 

public list getprocesslist() throws exception { 

public list<task> getunassigned() throws exception { 

public inputstream imagestrean(string piid) throws exception { 

public boolean isactive(string activename, string executionid) 

return false; 

public boolean saveorupdateprocessstate(string pid) { 

public boolean serverdeployprocess(string path) throws exception { 

public void setexecutionservicevariables(string executionid, 

map<string, object> variables) throws exception { 

public void startprocessinstancebykey(string key) throws exception {