executionserviceremotetest.java

来自「一个java工作流引擎」· Java 代码 · 共 32 行

JAVA
32
字号
package org.jbpm.ejb;

import java.util.*;
import javax.naming.*;
import org.jbpm.model.definition.*;
import org.jbpm.model.execution.*;
import org.jbpm.model.log.*;
import junit.framework.*;

public class ExecutionServiceRemoteTest extends TestCase {
  
  public void testGet() throws Exception {
    Properties properties = new Properties();
    properties.put( Context.INITIAL_CONTEXT_FACTORY ,"org.jnp.interfaces.NamingContextFactory");
    properties.put( Context.PROVIDER_URL,"localhost:1100");
    properties.put( Context.URL_PKG_PREFIXES,"jboss.naming:org.jnp.interfaces");
    
    for ( int i = 0; i < 50; i++ ) {
      JbpmEjbServiceLocator jbpmEjbServiceLocator = new JbpmEjbServiceLocator( properties );
      ExecutionServiceRemote executionServiceRemote = null;
      executionServiceRemote = jbpmEjbServiceLocator.getExecutionServiceRemote();
      Definition definition = executionServiceRemote.getLatestDefinition( "the state process" );
      assertNotNull( "did you forget to deploy the process definition with 'ant deploy.process.archives' ?", definition );
      InvocationLog invocationLog = executionServiceRemote.startProcessInstance( "remote app-client test runner", definition.getId(), null, null );
      ProcessInstance instance = invocationLog.getProcessInstance();
      executionServiceRemote.endOfState( "testrunner", instance.getRoot().getId(), null, null );
      jbpmEjbServiceLocator.release( executionServiceRemote );
    }
  }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?