⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testasyncprimitive.java

📁 一个很好的微工作流内核
💻 JAVA
字号:
/* * 	  *  Copyright (c) 2002, 2003 Dragos Manolescu (dam@micro-workflow.com) *  *  See the LICENSE file for licensing information. */package com.microworkflow.test;import junit.framework.Test;import junit.framework.TestSuite;import com.microworkflow.execution.*;import com.microworkflow.process.*;public class TestAsyncPrimitive extends TestActivity {	public TestAsyncPrimitive(String arg0) {		super(arg0);	}	public static void main(String[] args) {		junit.swingui.TestRunner.run(TestAsyncPrimitive.class);	}	public static Test suite() {		return new TestSuite(TestAsyncPrimitive.class);	}	public void testAsyncPrimitive() {		AsyncPrimitive p = new AsyncPrimitive(O1_KEY,"result1", new Performer() {			public Object execute() {				synchronized(this) {					try {						wait(2000);					} catch (InterruptedException e) {						;					}				}				if (context.containsKey(targetKey)) {					DomainObject domainObject = (DomainObject) getTarget();					return domainObject.concat((String) get("argument1"));				}				return null;			}		});		wc = executeWorkflow(p);		String expectedResult = "this is a string".concat("first argument");		assertEquals(			"Strings not equal",			true,			expectedResult.equalsIgnoreCase((String) wc.get("result1")));	}}

⌨️ 快捷键说明

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