Chinaunix首页 | 论坛 | 博客
  • 博客访问: 622745
  • 博文数量: 692
  • 博客积分: 4000
  • 博客等级: 上校
  • 技术积分: 4715
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-17 13:38
文章分类

全部博文(692)

文章存档

2011年(1)

2008年(691)

我的朋友

分类:

2008-10-17 13:44:01


  下面我将osworkflow的各个部分职能的小测试写一下,以便比较全面的掌握osworkflow。
  
  Beanshell部分:
  
  要把bsh的jar 包放到classpath中。
  
  如做个简单的测试:
  
  public class SimpleBeanShell {
  
  private int count;
  
  public int getCount() {
  
  return count;
  
  }
  
  public void setCount(int count) {
  
  this.count = count;
  
  }
  
  }
  
  过程定义这样写一下:
  
  
  
  
  
  
  
  com.littledragon.os.SimpleBeanShell sbs= transientVars.get("aaaa");
  
  sbs.setCount(20);
  
  

  
  

  
  

  
  写个测试类:
  
  测试方法如下。
  
  public void testGetCount() throws Exception {
  
  //long id;
  
  SimpleBeanShell simpleBeanShell = new SimpleBeanShell();
  
  Map inputs = new HashMap();
  
  inputs.put("aaaa", simpleBeanShell);
  
  Workflow wf = new BasicWorkflow("testyunguang");
  
  wf.initialize("ospractice", 1, inputs);
  
  int count = simpleBeanShell.getCount();
  
  assertEquals(20, count);
  
  }
  
  即可看到通过beanshell方法将count值设为20,junit一路跑绿。
  
  其他待续
  
【责编:admin】

--------------------next---------------------

阅读(234) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~