zoukankan      html  css  js  c++  java
  • How to use PUnit & CUnit

    How to use ALBPM PUnit Suite

    How to use ALBPM PUnit Suite

    PreCondition: Install ALBPM Studio and new one ALBPM Project

     

     

    Step 1. Create Roles "user"

    Step 2. Create Participant "punit" and assign role "user"

    Step 3. New Process "Process1"

    Step 4. New instance variable "instanceVar1 : String"

    Step 5. Right click "Interactive",choose "Main Task"

           Implementation Type : Method

           New megthod : interactivePunit

           and input code /* instanceVar1 = "OK" */

    Step 6. Run process,Please check process run is ok

     

     

    Step 1. New Module XXProjectTests

    Step 2. New PUnitSuite "Process1Tests"

     

    ALBPM Studio auto new two methods "setup" and "tearDown"

     

    setup:

    session = createSession(participant : "punit")

     

      Comments:

      session : Fuego.Test.ProcessServiceSession

      this.createSession()

     

    tearDown:

    close session

     

     

    Step 3. new method "testMainFlow"

    **************************************************************************

    instanceId as String

     

    log this

        using message = "[Test Begin]"

     

    log this

        using message = "Creating process instance"

     

    instanceId = processCreateInstance(session, processId : "/Process1")

     

    log this

        using message = "Checking instance is running"

       

    assertInstanceRunning this

        using session = session,

              instanceId = instanceId

     

    log this

        using message = "Waiting for instance stops at interactive activity"

       

    waitInstanceStopsAtActivity this

        using session = session,

              instanceId = instanceId,

              activityName = "Interactive",

              timeoutSeconds = 10

             

    log this

        using message = "Executing interactive activity"         

             

    activityExecute session

        using activityName = "Interactive",

              instanceId = instanceId

     

    log this

        using message = "Waiting for instance end"

       

    waitInstanceIsCompleted this

        using session = session,

              instanceId = instanceId,

              timeoutSeconds = 30

             

    log("Checking instance variable value")                   

    object = instanceGetVariable(session, instanceId, "instanceVar1")

    assertEquals this

        using a = "OK",

              b = String.valueOf(object)  

             

    log this

        using message = "[Test End]"

    **************************************************************************

    Step 4. Run ALBPM Studio

    Step 5. Run test method.

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

  • 相关阅读:
    [转]ASP.NET 导出Excel 80070005错误解决备忘
    [转]整理.net程序集加载方法
    Jquery示例
    WQL测试工具
    asp.net 2.0的事务问题
    <转>xPath教程
    .NET代码编写规范
    sqlserver2005 技巧
    MySQL(5.0)导出导入
    Castle ActiveRecord 笔记
  • 原文地址:https://www.cnblogs.com/baoguo/p/1538507.html
Copyright © 2011-2022 走看看