国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

osworkflow小測試練習之beanshell

2019-11-18 13:08:38
字體:
來源:轉載
供稿:網友

  下面我將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;
  
  }
  
  }
  
  過程定義這樣寫一下:
  
  <pre-functions>
  
  <function type="beanshell">
  
  <arg name="script">
  
  com.littledragon.os.SimpleBeanShell sbs= transientVars.get("aaaa");
  
  sbs.setCount(20);
  
  </arg>
  
  </function>
  
  </pre-functions>
  
  寫個測試類:
  
  測試方法如下。
  
  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一路跑綠。
  
  其他待續

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 杨浦区| 新野县| 兴安县| 开江县| 平乐县| 湟源县| 吉安市| 贞丰县| 克什克腾旗| 防城港市| 乌兰察布市| 咸丰县| 青海省| 霍州市| 蓝山县| 定日县| 揭西县| 梅河口市| 乾安县| 宁乡县| 武宣县| 城固县| 武邑县| 龙游县| 宣恩县| 洛阳市| 云阳县| 开远市| 盈江县| 莲花县| 灯塔市| 射阳县| 平乡县| 禄丰县| 明水县| 白朗县| 象山县| 灵丘县| 抚顺市| 抚顺市| 仁寿县|