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.

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

  • 相关阅读:
    Mybatis plus 多表连接分页查询
    webstorm自动格式化.vue文件并符合Eslint
    Selenium python爬虫
    Cent OS防火墙配置端口开放
    开发Hexo主题(一)
    谷歌开发者主页回归
    个人博客网站
    linux搭建ftp
    putty之pscp上传文件
    送走了最好的兄弟 收到上交复试通知
  • 原文地址:https://www.cnblogs.com/baoguo/p/1538507.html
Copyright © 2011-2022 走看看