Service Virtualization

Expand all | Collapse all

How to do Data driven service virtualization?

Jump to Best Answer
  • 1.  How to do Data driven service virtualization?

    Posted 09-30-2015 03:38 AM

    How to do Data driven service virtualization?

     

    I have service Image where I need to pass data using external sheet. My web service request has two Input value and based on that two input I have to validate one Output message. I need to automate this Input value and pass response from external sheet. I don't want to add multiple response value in service image. Can some one help me in this regard.

    Thanks for help.

    Abhishek



  • 2.  Re: How to do Data driven service virtualization?
    Best Answer

    Posted 09-30-2015 10:18 PM

    Use the Data Driven VS. The data is derived from excel sheet but can be used with other sources as well.



  • 3.  Re: How to do Data driven service virtualization?

    Posted 10-01-2015 03:01 AM

    Thanks Amit. Will try this option.



  • 4.  Re: How to do Data driven service virtualization?

    Posted 10-06-2015 07:43 AM

    Hi Amit,

     

    Could you please help on joining query code  , please do correct in the below mentioned code.

     

    Joining two tables in Test_Data_V2.xslx  1)Customer,2)Card  based on customer ID

     

     

    TDMJoinQuery query = TDMJoinQuery.create(Table.name("Customer").PK("CustomerID"),Table.name("Card").FK("CustomerID"));
    query.join(Table.name("Customer").PK("CustomerID"),Table.name("Card").FK("CustomerID"));

    return TDMDataStore.queryByJoin(testExec, "CustomerEnquiryQuery", query);

     

    Thanks

    Nandeesha



  • 5.  Re: How to do Data driven service virtualization?

    Posted 10-06-2015 02:33 PM

    Hi ,

    We can get though DB, EXCEL, CSV. Please use the below Snipplets

     

    SQL Query

    _________

    Select * FROM TableA

    LEFT OUTER JOIN TableB

    ON TableA. ThisColumn = TableB.ThatColumn

    Where TableA.ThisColumn = ‘Value’

     

    TDMQuery

    ------------------------

    TDMJoinQuery query2 = TDMJoinQuery.create(Table.name(" TableA ").PK(" ThisColumn "), Table.name(" TableB ").FK("ThatColumn"));

    query2.whereArr(new WClause[]{new WClause(" TableA ", " ThisColumn ", “Value”)});

    return TDMDatastore.query(testExec, “SecondQueryName",query2);

     

     

    Sample Query for TDM( Excel, CSV)

    ------------------------------------------------------------------

    import com.itko.tdm.framework.builder.query.*;

    import com.itko.tdm.framework.dto.*;

     

     

    TDMJoinQuery query2 = TDMJoinQuery.create(Table.name("USERS").PK("ID"), Table.name("ADDRESS").FK("ID"));

    query2.whereArr(new WClause[]{new WClause("USERS", "ID", request_userID.toString())});

    return TDMDatastore.query(testExec, "getComplexCustInfoQuery",query2);

     

    Note:

    This Query will create CA SV properties for every column in the selected rows from each table based on the request argument (“request_userID”) in the where clause that can then be used in the response. The properties have the following naming convention:

    {{USERS_COL1}}

    {{USERS_COL2}}

    {{USERS_COL3}}

    -etc-

    {{ADDRESS_COL1}}

    {{ADDRESS_COL2}}

    {{ADDRESS_COL3}}

    -etc-

    We need to keep Jar file in DevTest Home>/lib/core

    I can give you jar file based on your input format

     

    Thanks

    Ranjith



  • 6.  Re: How to do Data driven service virtualization?

    Posted 10-06-2015 03:14 PM

    Hi Ranjith,

     

    How to use Database as External Data Source and Which Class and Method we can use in Match script.

     

    Below code work with Excel, Csv files not sure how to use this with Database Source.

     

    TDMJoinQuery query2 = TDMJoinQuery.create(Table.name(" TableA ").PK(" ThisColumn "), Table.name(" TableB ").FK("ThatColumn"));

    query2.whereArr(new WClause[]{new WClause(" TableA ", " ThisColumn ", “Value”)});

    return TDMDatastore.query(testExec, “SecondQueryName",query2);

     

     

    Can you share code for DataBase ?

     

    -Ankush