valueutilscase.java
来自「日常的办公系统 应用工作流框架等增加员工的基本信息、培训信息、奖罚信息、薪资信息」· Java 代码 · 共 114 行
JAVA
114 行
//// TestCase.java//// jmettraux@openwfe.org//// generated with // jtmpl 1.0.04 20.11.2001 John Mettraux (jmettraux@openwfe.org)//package openwfe.org.engine._test;import junit.framework.Assert;import openwfe.org.Utils;import openwfe.org.engine.workitem.*;import openwfe.org.engine.expressions.*;/** * The test cases for the package * * <p><font size=2>CVS Info : * <br>$Author: jmettraux $ * <br>$Date: 2005/05/17 16:40:20 $ * <br>$Id: ValueUtilsCase.java,v 1.2 2005/05/17 16:40:20 jmettraux Exp $ </font> * * @author jmettraux@openwfe.org */public class ValueUtilsCase extends junit.framework.TestCase{ private final static org.apache.log4j.Logger log = org.apache.log4j.Logger .getLogger(ValueUtilsCase.class.getName()); // // FIELDS // // CONSTRUCTORS public ValueUtilsCase (String name) { super(name); } // // METHODS public void setUp () { } public void tearDown () { } // // TEST METHODS public void testDetermineValue () throws Exception { FlowExpression fe = new SetValueExpression(); fe.setAttributes(new java.util.HashMap(1)); fe.getAttributes().put("field-value", "toto"); log.debug("FlowExpression ready"); InFlowWorkItem wi = new InFlowWorkItem(); wi.setAttributes(new StringMapAttribute()); wi.getAttributes().puts("toto", "toto-value"); log.debug("Workitem ready"); Object v = ValueUtils.determineValue(fe, wi); Assert.assertTrue ("Value is not null", v != null); Assert.assertTrue ("Value is Attribute", (v instanceof Attribute)); log.debug("Value is "+v); } public void testDetermineValueWhenNull () throws Exception { FlowExpression fe = new SetValueExpression(); fe.setAttributes(new java.util.HashMap(1)); fe.getAttributes().put("field-value", "toto"); log.debug("FlowExpression ready"); InFlowWorkItem wi = new InFlowWorkItem(); wi.setAttributes(new StringMapAttribute()); //wi.getAttributes().puts("toto", "toto-value"); log.debug("Workitem ready"); Object v = ValueUtils.determineValue(fe, wi); Assert.assertTrue ("Value is null", v == null); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?