/**
   * Script Name : <b>SP_Email_DB_mbo_attr_date</b> Generated : <b>Sep 13, 2011 2:25:24 PM</b>
   * Description : Functional Test Script Original Host : WinNT Version 5.1 Build 2600 (S)
   *
   * @since 2011/09/13
   * @author FANFEI
   */
  public void testMain(Object[] args) {
    // TODO Insert code here
    WN.useProject(Cfg.projectName);
    EE.dnd("Database Connections->My Sample Database->sampledb->Tables->employee (dba)");
    WN.createWorkFlow(new WorkFlow().startParameter(Cfg.projectName).name(Cfg.wfName));
    WorkFlowEditor.addStartingPoint(new StartPoint().type(WorkFlow.SP_SERVER_INIT));

    PropertiesView.setEmailMbo("Employee", Cfg.projectName);
    WorkFlowEditor.addScreen("A");
    WorkFlowEditor.link(WorkFlow.SP_SERVER_INIT, "A");
    DOF.getWFServerInitiateFlowStartingPointFigure().click();

    PropertiesView.clickTab("Keys");
    PropertiesView.setNewKeyBindMBO("key1,string,Employee,birth_date");
    vpManual(
            "Properies",
            "key1,DateTime,Employee/birth_date",
            PropertiesView.getKeyAttributesofStartPoint(new StartPoint()).getKey())
        .performTest();

    PropertiesView.setKeyUserDefined("key1");
    vpManual(
            "Properies",
            "key1,DateTime,",
            PropertiesView.getKeyAttributesofStartPoint(new StartPoint()).getKey())
        .performTest();
    vpManual("noerror", 0, Problems.getErrors().size()).performTest();
  }
  /**
   * Script Name : <b>CdtnScrNavigate_Default_01</b> Generated : <b>Oct 12, 2011 11:27:27 AM</b>
   * Description : Functional Test Script Original Host : WinNT Version 5.1 Build 2600 (S)
   *
   * @since 2011/10/12
   * @author ffan
   */
  public void testMain(Object[] args) {
    // TODO Insert code here
    WN.useProject(Cfg.projectName);
    EE.dnd("Database Connections->My Sample Database->sampledb->Tables->department (dba)");
    // WN.createObjectQuery(new ObjectQuery().name("findByPrimaryKey")
    // .parameter("dept_id,int,true,dept_id")
    // .queryDefinition("SELECT x.* FROM Department x WHERE x.dept_id = :dept_id")
    // .returnType(ObjectQueryWizard.RT_SINGLE)
    // .startParameter(WN.mboPath(Cfg.projectName, "Department")));

    WN.createWorkFlow(
        new WorkFlow()
            .startParameter(Cfg.projectName)
            .name("myWF")
            .option(WorkFlow.SP_CLIENT_INIT));
    WorkFlowEditor.addMenuItem(
        "Start",
        new WFScreenMenuItem()
            .name("Submit")
            .type("Online Request")
            .project(Cfg.projectName)
            .mbo("Department")
            .objectQuery("findByPrimaryKey")
            .parametermapping("dept_id,Department_dept_id_attribKey"));

    System.out.println("list has:" + PropertiesView.getListOfDefaultSuccessScreen());
    vpManual("haslist", ",Start", PropertiesView.getListOfDefaultSuccessScreen()).performTest();
  }
 /**
  * Script Name : <b>CSFO_One2One_Not_Cascade_BiDir_Parent</b> Generated : <b>Sep 8, 2011 2:47:03
  * AM</b> Description : Functional Test Script Original Host : WinNT Version 5.1 Build 2600 (S)
  *
  * @since 2011/09/08
  * @author eric
  */
 public void testMain(Object[] args) {
   WN.useProject(Cfg.projectName);
   EE.dnd("Database Connections->My Sample Database->sampledb->Tables->department (dba)");
   EE.dnd("Database Connections->My Sample Database->sampledb->Tables->employee (dba)");
   WN.createRelationship(
       new Relationship()
           .startParameter(WN.mboPath(Cfg.projectName, "Department"))
           .target("Employee")
           .mapping("dept_id,dept_id")
           .bidirectional("true")
           .type(Relationship.TYPE_OTM));
   WN.createWorkFlow(new WorkFlow().startParameter(Cfg.projectName).name("myWF"));
   WorkFlowEditor.dragMbo(Cfg.projectName, "Department");
   vpManual("creen", false, WorkFlowEditor.hasScreen("Employee")).performTest();
   vpManual("creen", true, WorkFlowEditor.hasScreen("Department")).performTest();
   vpManual("creen", true, WorkFlowEditor.hasScreen("DepartmentDetail")).performTest();
   vpManual("creen", true, WorkFlowEditor.hasScreen("Departmentcreate")).performTest();
 }
  /**
   * Script Name : <b>Script1</b> Generated : <b>Oct 13, 2011 1:37:09 AM</b> Description :
   * Functional Test Script Original Host : WinNT Version 5.1 Build 2600 (S)
   *
   * @since 2011/10/13
   * @author xjf
   */
  public void testMain(Object[] args) {
    // TODO Insert code here
    WN.useProject(Cfg.projectName);
    EE.dnd(
        EE.parseResourcePath(
            "Database Connections->My Sample Database->sampledb->Tables->department (dba)"),
        50,
        90);

    WN.createWorkFlow(
        new WorkFlow()
            .startParameter(Cfg.projectName)
            .name("wfmbocreate")
            .option(WorkFlow.SP_CLIENT_INIT));

    // ******************add key from key tab
    DOF.getCTabItem(DOF.getRoot(), "Flow Design").click();
    DOF.getCTabFolder(DOF.getRoot(), "Properties").click(atText("Properties"));
    PropertiesView.clickTab("Keys");
    PropertiesView.NewKey("key1,string");

    // **************end

    // verify key duplicate
    WorkFlowEditor.addWidget("Start", new WFEditBox().label("editbox:"));

    TestObject[] boxes = DOF.getWFEditBoxFigures(DOF.getRoot());
    TestObject box = boxes[0];
    ((GefEditPartTestObject) box).click();
    PropertiesView.clickTab("General");

    DOF.getButton(DOF.getGroup(DOF.getRoot(), "Input Data Binding"), "&New key...").click();
    WO.setTextField(DOF.getDialog("Key"), DOF.getTextField(DOF.getDialog("Key"), "Name:"), "key1");

    String actual =
        DOF.getLabelByAncestorLine(DOF.getDialog("Key"), "Composite->Composite->Shell->Shell")
            .getProperty("text")
            .toString();
    vpManual(
            "keyduplicate", "Key names must be unique.   The key name key1 already exists.", actual)
        .performTest();
    DOF.getButton(DOF.getDialog("Key"), "Cancel").click();

    // end
    PropertiesView.NewKey("key2,list");
    PropertiesView.clickTab("General");
    String s1 = PropertiesView.verifykeylist();
    System.out.println(s1);
    vpManual("unmatchkey", "", s1).performTest();

    PropertiesView.NewKey("key3,string");
    PropertiesView.clickTab("General");
    String s2 = PropertiesView.verifykeylist();
    vpManual("matchedkey", "key3,", s2).performTest();
  }
 /**
  * Script Name : <b>I18N_MR_From_Android</b> Generated : <b>Nov 28, 2011 6:43:28 AM</b>
  * Description : Functional Test Script Original Host : WinNT Version 5.1 Build 2600 (S)
  *
  * @since 2011/11/28
  * @author flvxp
  */
 public void testMain(Object[] args) {
   WN.useProject(Cfg.projectName);
   EE.runSQL(
       new ScrapbookCP().database("sampledb").type("Sybase_ASA_12.x").name("My Sample Database"),
       GlobalConfig.getRFTProjectRoot() + "/testscript/Workflow/I18N/conf/I18N_ddl.sql");
   // MBO
   EE.dnd("Database Connections->My Sample Database->sampledb->Tables->I18N (dba)");
   WN.deployProject(
       new DeployOption()
           .startParameter(Cfg.projectName)
           .mode(DeployOption.MODE_REPLACE)
           .server("My Unwired Server")
           .serverConnectionMapping("My Sample Database,sampledb"));
   // WF
   WN.createWorkFlow(
       new WorkFlow()
           .startParameter(Cfg.projectName)
           .name("myWF")
           .option(WorkFlow.SP_SERVER_INIT)
           .mbo("I18N")
           .objectQuery("findAll")
           .from("所有")
           .to("supAdmin")
           .cc("supAdmin")
           .subject("subject")
           .fromMatchingRule("所有")
           .body("body")
           .verifyTo("To,supAdmin", true));
   //
   vpManual("error", 0, Problems.getErrors().size()).performTest();
   //
   WFCustomizer.runTest(
       new WorkFlowPackage()
           .startParameter(WN.filePath(Cfg.projectName, Cfg.wfName))
           .assignToUser("supAdmin")
           .unwiredServer("My Unwired Server")
           .deployToServer("true")
           .verifyResult("Assigning workflow myWF to supAdmin", true),
       customTestScript(),
       "tplan.Workflow.common.StartWF_android",
       new CallBackMethod()
           .receiver(WorkFlowEditor.class)
           .methodName("sendNotification")
           .parameter(
               new Email()
                   .unwiredServer("My Unwired Server")
                   .to("supAdmin")
                   .from("所有")
                   .subject("subject")
                   .body("body")));
   WFCustomizer.verifyResult(new WFClientResult().data("list_items_count=2"));
 }
Example #6
0
 /**
  * Script Name : <b>NQ_6</b> Generated : <b>Oct 10, 2011 4:28:51 PM</b> Description : Functional
  * Test Script Original Host : WinNT Version 5.1 Build 2600 (S)
  *
  * @since 2011/10/10
  * @author flvVm
  */
 public void testMain(Object[] args) {
   WN.useProject(Cfg.projectName);
   // MBO
   EE.dnd("Database Connections->My Sample Database->sampledb->Tables->department (dba)");
   // MBOProperties mbo = new MBOProperties(Cfg.projectName, "Department");
   WN.createObjectQuery(
       new ObjectQuery()
           .name("ObjQuery")
           .startParameter(WN.mboPath(Cfg.projectName, "Department"))
           .parameter("name,string,true,dept_name")
           .queryDefinition("SELECT x.* FROM Department x WHERE x.dept_name = :name")
           .returnType(ObjectQueryWizard.RT_MULTIPLE));
   // WF
   WN.createWorkFlow(new WorkFlow().startParameter(Cfg.projectName).name("myWF"));
   WorkFlowEditor.addStartingPoint(new StartPoint().type(WorkFlow.SP_CLIENT_INIT));
   WorkFlowEditor.addScreen("invokeScr");
   WorkFlowEditor.addScreen("resultScr");
   WorkFlowEditor.link("Client-initiated", "invokeScr");
   //
   WorkFlowEditor.addEditBox(
       Cfg.projectName,
       "myWF.xbw",
       "invokeScr",
       new WFEditBox().label("dept_Name").logicalType("TEXT").newKey("nameVal,string"));
   WorkFlowEditor.addMenuItem(
       "invokeScr",
       new WFScreenMenuItem()
           .name("ObjectQuery")
           .type("Online Request")
           .project(Cfg.projectName)
           .mbo("Department")
           .objectQuery("ObjQuery")
           .parametermapping("name,nameVal")
           .defaultSuccessScreen("resultScr"));
   //
   PropertiesView.clickTab("General");
   vpManual(
           "objectquery",
           true,
           DOF.getCCombo(DOF.getRoot(), "Object query:").getProperty("text").equals("ObjQuery"))
       .performTest();
   // vpManual("parameters", "name,nameVal",
   // PropertiesView.getMenuItem("ObjectQuery").getParameterMapping()[0]).performTest();
   //
   vpManual("error", 0, Problems.getErrors().size()).performTest();
 }
  /**
   * Script Name : <b>Cust_API_saveScreens_1</b> Generated : <b>Mar 30, 2012 10:36:23 AM</b>
   * Description : Functional Test Script Original Host : WinNT Version 5.1 Build 2600 (S)
   *
   * @since 2012/03/30
   * @author test
   */
  public void testMain(Object[] args) {
    WN.useProject(Cfg.projectName);
    EE.dnd("Database Connections->My Sample Database->sampledb->Tables->department (dba)");
    WN.createWorkFlow(
        new WorkFlow()
            .startParameter(Cfg.projectName)
            .name(Cfg.wfName)
            .option(WorkFlow.SP_CLIENT_INIT));
    WorkFlowEditor.dragMbo(Cfg.projectName, "Department");
    WorkFlowEditor.addWidget("Start", new WFEditBox().label("label1").newKey("key1,string"));
    WorkFlowEditor.addScreen("Screen2");
    WorkFlowEditor.addWidget("Screen2", new WFEditBox().label("label2").newKey("key2,string"));
    WorkFlowEditor.link("Start", "Screen2");
    WorkFlowEditor.addMenuItem(
        "Start",
        new WFScreenMenuItem()
            .name("findAll")
            .project(Cfg.projectName)
            .mbo("Department")
            .type("Online Request")
            .defaultSuccessScreen("Department")
            .objectQuery("findAll"));
    WN.deployProject(
        new DeployOption()
            .startParameter(Cfg.projectName)
            .server("My Unwired Server")
            .mode(DeployOption.MODE_REPLACE)
            .serverConnectionMapping("My Sample Database,sampledb"));

    WFCustomizer.runTest(
        new WorkFlowPackage()
            .startParameter(WN.filePath(Cfg.projectName, Cfg.wfName))
            .unwiredServer("My Unwired Server")
            .assignToSelectedUser("DT"),
        customJsTestScript(),
        "tplan.Workflow.common.StartWF_android");

    WFCustomizer.verifyResult(new WFClientResult().data("valueCount=0|valueCount=0|valueCount=2"));
  }
Example #8
0
  /**
   * Script Name : <b>CS_EmailSub_SO</b> Generated : <b>Sep 8, 2011 3:16:34 AM</b> Description :
   * Functional Test Script Original Host : WinNT Version 5.1 Build 2600 (S)
   *
   * @since 2011/09/08
   * @author eric
   */
  public void testMain(Object[] args) {
    WN.useProject(Cfg.projectName);
    EE.dnd("Database Connections->My Sample Database->sampledb->Tables->department (dba)");
    WN.createWorkFlow(
        new WorkFlow()
            .startParameter(Cfg.projectName)
            .name("myWF")
            .option(WorkFlow.SP_SERVER_INIT)
            .mbo("Department")
            .objectQuery("findByPrimaryKey")
            .subject("dept_id=1")
            .subjectMatchingRule("dept_id=")
            .setParameterValue("dept_id,Subject,dept_id="));

    vpManual("screen", true, WorkFlowEditor.hasScreen("Department")).performTest();
    vpManual("screen", true, WorkFlowEditor.hasScreen("DepartmentDetail")).performTest();
    vpManual("screen", true, WorkFlowEditor.hasScreen("Departmentcreate")).performTest();
    vpManual("screen", true, WorkFlowEditor.hasScreen("Departmentdeleteinstance")).performTest();
    vpManual("screen", true, WorkFlowEditor.hasScreen("Departmentupdateinstance")).performTest();
    //		vpManual("link", false, WorkFlowEditor.hasLinkBetween("Server-initiated (Department)",
    // "Department")).performTest();
    vpManual(
            "link",
            true,
            WorkFlowEditor.hasLinkBetween("Server-initiated (Department)", "DepartmentDetail"))
        .performTest();
    vpManual(
            "link",
            true,
            WorkFlowEditor.hasLinkBetween("DepartmentDetail", "Departmentupdateinstance"))
        .performTest();
    vpManual(
            "link",
            true,
            WorkFlowEditor.hasLinkBetween("DepartmentDetail", "Departmentdeleteinstance"))
        .performTest();
  }
  /**
   * Script Name : <b>S675478_SentByServerKey_Following_Client</b> Generated : <b>Mar 12, 2012
   * 4:15:49 AM</b> Description : Functional Test Script Original Host : WinNT Version 5.1 Build
   * 2600 (S)
   *
   * @since 2012/03/12
   * @author ffan
   */
  public void testMain(Object[] args) {
    // TODO Insert code here
    WN.useProject(Cfg.projectName);
    EE.dnd("Database Connections->My Sample Database->sampledb->Tables->department (dba)", 10, 10);

    WN.createWorkFlow(
        new WorkFlow()
            .startParameter(Cfg.projectName)
            .name("myWF")
            .option(WorkFlow.SP_CLIENT_INIT));

    WorkFlowEditor.dragMbo(Cfg.projectName, "Department");
    WorkFlowEditor.addMenuItem(
        "Start",
        new WFScreenMenuItem()
            .name("findall")
            .project(Cfg.projectName)
            .type("Online Request")
            .mbo("Department")
            .objectQuery("findAll")
            .defaultSuccessScreen("DepartmentDetail"));
    MainMenu.saveAll();
    vpManual("noerror", 0, Problems.getErrors().size()).performTest();
  }
  /**
   * Script Name : <b>EMailTriggering_E2E_05</b> Generated : <b>Oct 19, 2011 9:03:19 PM</b>
   * Description : Functional Test Script Original Host : WinNT Version 5.1 Build 2600 (S)
   *
   * @since 2011/10/19
   * @author ffan
   */
  public void testMain(Object[] args) {
    // TODO Insert code here
    // restore the initial table record
    String sqldelete = "delete from Mbo1 where C1=1";
    try {
      DBUtil.runSQL((IDBResource) RC.getResource(ASA.class), sqldelete);
    } catch (SQLException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (ClassNotFoundException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    String sqlcreate = "insert into Mbo1 values (1,'one')";
    try {
      DBUtil.runSQL((IDBResource) RC.getResource(ASA.class), sqlcreate);
    } catch (SQLException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (ClassNotFoundException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    WN.useProject(Cfg.projectName);
    EE.dnd("Database Connections->My Sample Database->sampledb->Tables->mbo1 (dba)");
    WN.deployProject(
        new DeployOption()
            .startParameter(Cfg.projectName)
            .server("My Unwired Server")
            .mode(DeployOption.MODE_REPLACE)
            .serverConnectionMapping("My Sample Database,sampledb"));

    WN.createWorkFlow(
        new WorkFlow()
            .startParameter(Cfg.projectName)
            .name(Cfg.wfName)
            .option(WorkFlow.SP_SERVER_INIT));

    PropertiesView.jumpStart(
        new WorkFlow()
            .mbo("Mbo1")
            .objectQuery("findByPrimaryKey")
            .from("imo@localhost")
            .subject("<id>2</id>")
            .fromMatchingRule("imo")
            .setParameterValue("C1,Subject,<id>,</id>"));

    WorkFlowEditor.dragMbo(Cfg.projectName, "Mbo1");
    WorkFlowEditor.removeScreen("Mbo1");
    WorkFlowEditor.removeScreen("Mbo1updateinstance");
    WorkFlowEditor.removeScreen("Mbo1create");
    WorkFlowEditor.removeScreen("Mbo1deleteinstance");
    sleep(1);
    MainMenu.saveAll();
    WorkFlowEditor.addScreen("MyUpdate");
    WorkFlowEditor.link(WorkFlow.SP_SERVER_INIT, "Mbo1Detail");
    WorkFlowEditor.addMenuItem(
        "Mbo1Detail", new WFScreenMenuItem().name("Open MyUpdate").type("Open").screen("MyUpdate"));
    sleep(1);
    MainMenu.saveAll();

    WorkFlowEditor.removeMenuItem("Mbo1Detail", "Back");
    WorkFlowEditor.addMenuItem(
        "Mbo1Detail",
        new WFScreenMenuItem()
            .name("submit")
            .type("Submit Workflow")
            .project(Cfg.projectName)
            .mbo("Mbo1"));
    sleep(1);
    MainMenu.saveAll();

    WorkFlowEditor.addWidget(
        "MyUpdate", new WFEditBox().label("C1:").key("Mbo1_C1_attribKey").ifReadonly(true));
    sleep(1);
    MainMenu.saveAll();
    WorkFlowEditor.addWidget("MyUpdate", new WFEditBox().label("C2:").key("Mbo1_C2_attribKey"));
    sleep(1);
    MainMenu.saveAll();
    WorkFlowEditor.addMenuItem(
        "MyUpdate",
        new WFScreenMenuItem()
            .name("update")
            .type("Online Request")
            .project(Cfg.projectName)
            .mbo("Mbo1")
            .operation("update")
            .submitErrMsg("this is my submit error message")
            .defaultSuccessScreen("Mbo1Detail")
            .parametermapping("C1,Mbo1_C1_attribKey")
            .parametermapping("C2,Mbo1_C2_attribKey"));

    MainMenu.saveAll();
    vpManual("hasError", 0, Problems.getErrors().size()).performTest();

    WFCustomizer.runTest(
        new WorkFlowPackage()
            .startParameter(WN.filePath(Cfg.projectName, Cfg.wfName))
            .assignToUser(Cfg.deviceUser)
            .unwiredServer("My Unwired Server")
            .deployToServer("true"),
        customTestScript(),
        //			"tplan.Workflow.iconcommon.BB.server_dt_icon.Script",
        new CallBackMethod()
            .receiver(WorkFlowEditor.class)
            .methodName("sendNotification")
            .parameter(new Email().from("imo@localhost").subject("<id>1</id>")));

    WFCustomizer.verifyResult(
        new WFClientResult()
            .data("id=Mbo1_C1_attribKey,value=1|" + "id=Mbo1_C2_attribKey,value=one"));

    // vp: the new record is added in the datebase:
    java.util.List<String> clause = new ArrayList<String>();
    clause.add("C1=1");
    clause.add("C2='newone'");
    vpManual("dbresult", 1, CDBUtil.getRecordCount("localhost", "wf", "Mbo1", clause))
        .performTest();
  }
 /**
  * Script Name : <b>S665751_Loneline_in_ResultData_2_Android</b> Generated : <b>Nov 4, 2011
  * 7:29:58 AM</b> Description : Functional Test Script Original Host : WinNT Version 5.1 Build
  * 2600 (S)
  *
  * @since 2011/11/04
  * @author flvxp
  */
 public void testMain(Object[] args) {
   WN.useProject(Cfg.projectName);
   EE.runSQL(
       new ScrapbookCP().database("sampledb").type("Sybase_txt_12.x").name("My Sample Database"),
       GlobalConfig.getRFTProjectRoot() + "/testscript/Workflow/Actions/conf/txt_ddl.sql");
   EE.runSQL(
       new ScrapbookCP().database("sampledb").type("Sybase_txt_12.x").name("My Sample Database"),
       GlobalConfig.getRFTProjectRoot() + "/testscript/Workflow/Actions/conf/txt_data.sql");
   //		 MBO
   EE.dnd("Database Connections->My Sample Database->sampledb->Tables->txt (dba)");
   WN.deployProject(
       new DeployOption()
           .startParameter(Cfg.projectName)
           .mode(DeployOption.MODE_REPLACE)
           .server("My Unwired Server")
           .serverConnectionMapping("My Sample Database,sampledb"));
   //		 WF
   WN.createWorkFlow(
       new WorkFlow()
           .startParameter(Cfg.projectName)
           .name("myWF")
           .option(WorkFlow.SP_CLIENT_INIT));
   WorkFlowEditor.dragMbo(Cfg.projectName, "Txt");
   WorkFlowEditor.addEditBox(
       Cfg.projectName,
       "myWF.xbw",
       "Start Screen",
       new WFEditBox().label("id").logicalType("TEXT").newKey("id,int").setDefaultValue("2"));
   WorkFlowEditor.addMenuItem(
       "Start Screen",
       new WFScreenMenuItem()
           .name("findByPrimaryKey")
           .type("Online Request")
           .project(Cfg.projectName)
           .mbo("Txt")
           .objectQuery("findByPrimaryKey")
           .parametermapping("id,id")
           .defaultSuccessScreen("TxtDetail"));
   sleep(1);
   MainMenu.saveAll();
   WorkFlowEditor.addEditBox(
       Cfg.projectName,
       "myWF.xbw",
       "TxtDetail",
       new WFEditBox()
           .label("text")
           .logicalType("TEXT")
           .ifReadonly(true)
           .key("Txt_content_attribKey")
           .lines("3"));
   MainMenu.saveAll();
   //
   vpManual("error", 0, Problems.getErrors().size()).performTest();
   //
   WFCustomizer.runTest(
       new WorkFlowPackage()
           .startParameter(WN.filePath(Cfg.projectName, Cfg.wfName))
           .assignToUser("supAdmin")
           .unwiredServer("My Unwired Server")
           .deployToServer("true")
           .verifyResult("Assigning workflow myWF to supAdmin", true),
       customTestScript(),
       "tplan.Workflow.common.StartWF_android");
   WFCustomizer.verifyResult(
       new WFClientResult().data("id=Txt_content_attribKey,value=format2\r\ntest"));
 }
 /**
  * Script Name : <b>A671403_Special_Character_andr</b> Generated : <b>Oct 31, 2011 6:47:08 PM</b>
  * Description : Functional Test Script Original Host : WinNT Version 5.1 Build 2600 (S)
  *
  * @since 2011/10/31
  * @author flvxp
  */
 public void testMain(Object[] args) {
   WN.useProject(Cfg.projectName);
   EE.runSQL(
       new ScrapbookCP().database("sampledb").type("Sybase_ASA_12.x").name("My Sample Database"),
       GlobalConfig.getRFTProjectRoot() + "/testscript/Workflow/Actions/conf/AllDT_ddl.sql");
   EE.runSQL(
       new ScrapbookCP().database("sampledb").type("Sybase_ASA_12.x").name("My Sample Database"),
       GlobalConfig.getRFTProjectRoot() + "/testscript/Workflow/Actions/conf/AllDT_data.sql");
   // MBO
   EE.dnd("Database Connections->My Sample Database->sampledb->Tables->AllDT (dba)");
   WN.createObjectQuery(
       new ObjectQuery()
           .name("ObjQuery")
           .startParameter(WN.mboPath(Cfg.projectName, "AllDT"))
           .parameter("specialchar,string,true,string2")
           .queryDefinition("SELECT x.* FROM AllDT x WHERE x.string2 = :specialchar")
           .returnType(ObjectQueryWizard.RT_MULTIPLE));
   //
   WN.deployProject(
       new DeployOption()
           .startParameter(Cfg.projectName)
           .mode(DeployOption.MODE_REPLACE)
           .server("My Unwired Server")
           .serverConnectionMapping("My Sample Database,sampledb"));
   // WF
   WN.createWorkFlow(
       new WorkFlow()
           .startParameter(Cfg.projectName)
           .name("myWF")
           .option(WorkFlow.SP_CLIENT_INIT));
   WorkFlowEditor.dragMbo(Cfg.projectName, "AllDT");
   WorkFlowEditor.addEditBox(
       Cfg.projectName,
       "myWF.xbw",
       "Start Screen",
       new WFEditBox()
           .label("str")
           .logicalType("TEXT")
           .newKey("str,string")
           .setDefaultValue("Q\\A"));
   WorkFlowEditor.addMenuItem(
       "Start Screen",
       new WFScreenMenuItem()
           .name("objQuery")
           .type("Online Request")
           .project(Cfg.projectName)
           .mbo("AllDT")
           .objectQuery("ObjQuery")
           .parametermapping("specialchar,str")
           .defaultSuccessScreen("AllDT"));
   //
   vpManual("error", 0, Problems.getErrors().size()).performTest();
   //
   WFCustomizer.runTest(
       new WorkFlowPackage()
           .startParameter(WN.filePath(Cfg.projectName, Cfg.wfName))
           .assignToUser("supAdmin")
           .unwiredServer("My Unwired Server")
           .deployToServer("true")
           .verifyResult("Assigning workflow myWF to supAdmin", true),
       customTestScript(),
       "tplan.Workflow.common.StartWF_android");
   WFCustomizer.verifyResult(
       new WFClientResult().data("found=true|" + "id=AllDT_string2_attribKey,value=Q\\A"));
 }
  /**
   * Script Name : <b>Cred_Act_Complex_E2E_3_1</b> Generated : <b>Oct 28, 2011 4:37:50 AM</b>
   * Description : Functional Test Script Original Host : WinNT Version 5.1 Build 2600 (S)
   *
   * @since 2011/10/28
   * @author ffan
   */
  public void testMain(Object[] args) {
    // TODO Insert code here
    WN.useProject(Cfg.projectName);

    //		// Note:there are 2 records in testtable:
    //		EE.runSQL(new ScrapbookCP().database("sampledb")
    //				.type("Sybase_ASA_12.x").name("My Sample Database"),
    //				GlobalConfig.getRFTProjectRoot()+"/testscript/Workflow/Keys/setup/createTable.sql");

    EE.dnd("Database Connections->My Sample Database->sampledb->Tables->testtable (dba)");
    WN.deployProject(
        new DeployOption()
            .startParameter(Cfg.projectName)
            .server("My Unwired Server")
            .mode(DeployOption.MODE_REPLACE)
            .serverConnectionMapping("My Sample Database,sampledb"));

    // 1.the first WF:
    //		WN.createWorkFlow(new WorkFlow().startParameter(Cfg.projectName).name("myWF_cre_active_1")
    WN.createWorkFlow(
        new WorkFlow()
            .startParameter(Cfg.projectName)
            .name("myWF1")
            .option(WorkFlow.SP_CLIENT_INIT)
            .option(WorkFlow.SP_CREDENTIAL_REQUEST)
            .option(WorkFlow.SP_ACTIVATE));

    WorkFlowEditor.dragMbo(Cfg.projectName, "Testtable");
    PropertiesView.editModule(new Module().activeKey("1").credentialCacheKey("ffCredential"));
    PropertiesView.setAuthentication("supAdmin", "s3pAdmin");

    WorkFlowEditor.addMenuItem(
        "Start",
        new WFScreenMenuItem()
            .name("findAll")
            .type("Online Request")
            .project(Cfg.projectName)
            .mbo("Testtable")
            .objectQuery("findAll")
            .defaultSuccessScreen("Testtable"));

    WFCustomizer.runTest(
        new WorkFlowPackage()
            //			.startParameter(WN.filePath(Cfg.projectName, "myWF_cre_active_1"))
            .startParameter(WN.filePath(Cfg.projectName, "myWF1"))
            .assignToUser(Cfg.deviceUser)
            .unwiredServer("My Unwired Server")
            .deployToServer("true"),
        customTestScriptOne()
        //			,
        //			"tplan.Workflow.iconcommon.BB.myWF_icon.Script"
        );

    WFCustomizer.verifyResult(new WFClientResult().data("list_items_count=2"));

    // 2. the other WF with different active key and same credential key:

    //	WN.createWorkFlow(new WorkFlow().startParameter(Cfg.projectName).name("myWF_cre_active_2")
    WN.createWorkFlow(
        new WorkFlow()
            .startParameter(Cfg.projectName)
            .name("myWF2")
            .option(WorkFlow.SP_CLIENT_INIT)
            .option(WorkFlow.SP_CREDENTIAL_REQUEST)
            .option(WorkFlow.SP_ACTIVATE));

    WorkFlowEditor.dragMbo(Cfg.projectName, "Testtable");
    PropertiesView.editModule(new Module().activeKey("2").credentialCacheKey("ffCredential"));
    PropertiesView.setAuthentication("supAdmin", "s3pAdmin");

    WorkFlowEditor.addMenuItem(
        "Start",
        new WFScreenMenuItem()
            .name("findAll")
            .type("Online Request")
            .project(Cfg.projectName)
            .mbo("Testtable")
            .objectQuery("findAll")
            .defaultSuccessScreen("Testtable"));

    WFCustomizer.runTest(
        new WorkFlowPackage()
            //		.startParameter(WN.filePath(Cfg.projectName, "myWF_cre_active_2"))
            .startParameter(WN.filePath(Cfg.projectName, "myWF2"))
            .assignToUser(Cfg.deviceUser)
            .unwiredServer("My Unwired Server")
            .deployToServer("true"),
        customTestScriptTwo()
        //		,
        //		"tplan.Workflow.iconcommon.BB.myWF_icon2.Script"
        );

    WFCustomizer.verifyResult(new WFClientResult().data("list_items_count=2"));
  }
  /**
   * Script Name : <b>CdtnScr_Request_CRUD_01_Create_E2E</b> Generated : <b>Feb 29, 2012 9:11:46
   * PM</b> Description : Functional Test Script Original Host : WinNT Version 5.1 Build 2600 (S)
   *
   * @since 2012/02/29
   * @author ffan
   */
  public void testMain(Object[] args) {
    // TODO Insert code here
    //		create:
    // delete the date which will be created in the following code
    try {
      DBUtil.runSQL(
          (IDBResource) RC.getResource(ASA.class), "delete from States where state_id='CH'");
    } catch (SQLException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (ClassNotFoundException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    WN.useProject(Cfg.projectName);
    EE.dnd("Database Connections->My Sample Database->sampledb->Tables->states (dba)");
    WN.deployProject(
        new DeployOption()
            .startParameter(Cfg.projectName)
            .server("My Unwired Server")
            .mode(DeployOption.MODE_REPLACE)
            .serverConnectionMapping("My Sample Database,sampledb"));

    WN.createWorkFlow(
        new WorkFlow()
            .startParameter(Cfg.projectName)
            .name("myWF")
            .option(WorkFlow.SP_CLIENT_INIT));
    WorkFlowEditor.dragMbo(Cfg.projectName, "States");
    WorkFlowEditor.link("StatesDetail", "Statescreate");

    WorkFlowEditor.addWidget("Start", new WFEditBox().label("id:").newKey("id,string"));
    WorkFlowEditor.addMenuItem(
        "Start",
        new WFScreenMenuItem()
            .name("findByPK")
            .type("Online Request")
            .mbo("States")
            .objectQuery("findByPrimaryKey")
            .project(Cfg.projectName)
            .defaultSuccessScreen("StatesDetail")
            .parametermapping("state_id,id"));

    PropertiesView.set(
        new WFScreen().name("Statescreate"),
        new Modifications()
            .mod(
                "create",
                new WFScreenMenuItem()
                    .name("Create")
                    .type("Online Request")
                    .defaultSuccessScreen("StatesDetail")));

    PropertiesView.addConditionTableOfMenuItem("c1", "Start");
    MainMenu.saveAll();
    WFCustomizer.runTest(
        new WorkFlowPackage()
            .startParameter(WN.filePath(Cfg.projectName, Cfg.wfName))
            .assignToUser(testscript.Workflow.cfg.Cfg.deviceUser)
            .deployToServer("true")
            .unwiredServer("My Unwired Server"),
        script()
        //			,
        //			testscript.Workflow.cfg.Cfg.tplanScript_client_1
        );

    // vp:data in device
    WFCustomizer.verifyResult(
        new WFClientResult().data("id=States_state_id_attribKey,value=AB|" + "id=id,value=AB"));

    // vp2:verify the update record  has added into backend db in state
    vpManual(
            "db",
            1,
            DBUtil.getDB("select * from states where state_id='CH' and state_name='China'"))
        .performTest();
  }
  /**
   * Script Name : <b>CSFO_One2One_Cascade_N_bi_dir_Parent</b> Generated : <b>Sep 15, 2011 3:24:13
   * PM</b> Description : Functional Test Script Original Host : WinNT Version 5.1 Build 2600 (S)
   *
   * @since 2011/09/15
   * @author FANFEI
   */
  public void testMain(Object[] args) {
    // TODO Insert code here
    WN.useProject(Cfg.projectName);
    EE.dnd("Database Connections->My Sample Database->sampledb->Tables->wf_ff_a (dba)");
    EE.dnd("Database Connections->My Sample Database->sampledb->Tables->wf_ff_b (dba)");
    WN.createRelationship(
        new Relationship()
            .startParameter(WN.mboPath(Cfg.projectName, "Wf_ff_a"))
            .target("Wf_ff_b")
            .mapping("aid,aid")
            .composite("true")
            .bidirectional("false")
            .type(Relationship.TYPE_OTO));
    WN.createWorkFlow(
        new WorkFlow()
            .startParameter(Cfg.projectName)
            .name("myWF")
            .option(WorkFlow.SP_CLIENT_INIT));
    WorkFlowEditor.dragMbo(Cfg.projectName, "Wf_ff_a");

    vpManual("creen", true, WorkFlowEditor.hasScreen("Wfffa")).performTest();
    vpManual("creen", true, WorkFlowEditor.hasScreen("Wfffaupdateinstance")).performTest();
    vpManual("creen", true, WorkFlowEditor.hasScreen("Wfffadeleteinstance")).performTest();
    vpManual("creen", true, WorkFlowEditor.hasScreen("WfffaDetail")).performTest();
    vpManual("creen", true, WorkFlowEditor.hasScreen("Wfffacreate")).performTest();
    vpManual("creen", true, WorkFlowEditor.hasScreen("WfffbDetail")).performTest();
    vpManual("creen", true, WorkFlowEditor.hasScreen("Wfffbupdateinstance")).performTest();

    vpManual("link", true, WorkFlowEditor.hasLinkBetween("WfffaDetail", "WfffbDetail"))
        .performTest();
    vpManual("link", true, WorkFlowEditor.hasLinkBetween("WfffbDetail", "Wfffbupdateinstance"))
        .performTest();

    // vp1:parentDetail:
    vpManual("hasmenu", true, WorkFlowEditor.hasMenuItemInScreen("WfffaDetail", "Open WfffbDetail"))
        .performTest();
    vpManual(
            "hasmenu",
            true,
            WorkFlowEditor.hasMenuItemInScreen("WfffaDetail", "Open Wfffaupdateinstance"))
        .performTest();
    vpManual(
            "hasmenu",
            true,
            WorkFlowEditor.hasMenuItemInScreen("WfffaDetail", "Open Wfffadeleteinstance"))
        .performTest();
    vpManual(
            "hasmenu",
            true,
            WorkFlowEditor.hasWidgetInScreen("WfffaDetail", new WFEditBox().label("Aid:")))
        .performTest();
    PropertiesView.clickTab("General");
    vpManual(
            "dataBinding",
            "Wf_ff_a_aid_attribKey",
            DOF.getCCombo(DOF.getGroup(DOF.getRoot(), "Input Data Binding")).getProperty("text"))
        .performTest();

    vpManual(
            "hasmenu",
            true,
            WorkFlowEditor.hasWidgetInScreen("WfffaDetail", new WFEditBox().label("Aname:")))
        .performTest();
    PropertiesView.clickTab("General");
    vpManual(
            "dataBinding",
            "Wf_ff_a_aname_attribKey",
            DOF.getCCombo(DOF.getGroup(DOF.getRoot(), "Input Data Binding")).getProperty("text"))
        .performTest();

    // vp2:childDetail:
    vpManual(
            "hasmenu",
            true,
            WorkFlowEditor.hasMenuItemInScreen(
                "WfffbDetail", "Open Screen Wf_ff_b_update_instance"))
        .performTest();
    vpManual(
            "hasmenu",
            true,
            WorkFlowEditor.hasMenuItemInScreen("WfffbDetail", "Wf_ff_b_delete_instance"))
        .performTest();
    vpManual(
            "hasmenu",
            true,
            WorkFlowEditor.hasWidgetInScreen("WfffbDetail", new WFEditBox().label("Bid:")))
        .performTest();
    PropertiesView.clickTab("General");
    vpManual(
            "dataBinding",
            "Wf_ff_b_bid_attribKey",
            DOF.getCCombo(DOF.getGroup(DOF.getRoot(), "Input Data Binding")).getProperty("text"))
        .performTest();

    vpManual(
            "hasmenu",
            true,
            WorkFlowEditor.hasWidgetInScreen("WfffbDetail", new WFEditBox().label("Aid:")))
        .performTest();
    PropertiesView.clickTab("General");
    vpManual(
            "dataBinding",
            "Wf_ff_b_aid_attribKey",
            DOF.getCCombo(DOF.getGroup(DOF.getRoot(), "Input Data Binding")).getProperty("text"))
        .performTest();

    vpManual(
            "hasmenu",
            true,
            WorkFlowEditor.hasWidgetInScreen("WfffbDetail", new WFEditBox().label("Bname:")))
        .performTest();
    PropertiesView.clickTab("General");
    vpManual(
            "dataBinding",
            "Wf_ff_b_bname_attribKey",
            DOF.getCCombo(DOF.getGroup(DOF.getRoot(), "Input Data Binding")).getProperty("text"))
        .performTest();

    // vp3:child_Update:
    vpManual("hasmenu", true, WorkFlowEditor.hasMenuItemInScreen("Wfffbupdateinstance", "Update"))
        .performTest();

    vpManual(
            "hasmenu",
            true,
            WorkFlowEditor.hasWidgetInScreen("Wfffbupdateinstance", new WFEditBox().label("Bid:")))
        .performTest();
    PropertiesView.clickTab("General");
    vpManual(
            "dataBinding",
            "Wf_ff_b_bid_attribKey",
            DOF.getCCombo(DOF.getGroup(DOF.getRoot(), "Input Data Binding")).getProperty("text"))
        .performTest();

    vpManual(
            "hasmenu",
            true,
            WorkFlowEditor.hasWidgetInScreen("Wfffbupdateinstance", new WFEditBox().label("Aid:")))
        .performTest();
    PropertiesView.clickTab("General");
    vpManual(
            "dataBinding",
            "Wf_ff_b_aid_attribKey",
            DOF.getCCombo(DOF.getGroup(DOF.getRoot(), "Input Data Binding")).getProperty("text"))
        .performTest();

    vpManual(
            "hasmenu",
            true,
            WorkFlowEditor.hasWidgetInScreen(
                "Wfffbupdateinstance", new WFEditBox().label("Bname:")))
        .performTest();
    PropertiesView.clickTab("General");
    vpManual(
            "dataBinding",
            "Wf_ff_b_bname_attribKey",
            DOF.getCCombo(DOF.getGroup(DOF.getRoot(), "Input Data Binding")).getProperty("text"))
        .performTest();
  }