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.

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

  • 相关阅读:
    10款面向HTML5 画布(Canvas)的JavaScript库
    lufylegend库 LGraphics扭曲图片
    lufylegend库 LGraphics绘制图片
    lufylegend库 LGraphics
    lufylegend库 LBitmapData LBitmap LSprite
    Web骇客网;外刊IT评论
    HTML5画布(CANVAS)速查简表
    Canvas 画板
    Canvas 阴影效果
    Canvas 图片灰度
  • 原文地址:https://www.cnblogs.com/baoguo/p/1538507.html
Copyright © 2011-2022 走看看