Service Virtualization

 View Only
  • 1.  socket virtualization

    Posted Jul 16, 2019 07:41 PM
    Hello, how can I virtualize the following function within Devtest through TCP or what method do you recommend the service to virtualize is a socket.

    socket = new Socket (host, Integer.parseInt (port));

    socket.setSoTimeout (Integer.parseInt (timeOut));

    //System.out.println("connecting .. ");
    logger.info ("ConnectToCDCSocket.getReportCDC () >> connecting ..");

    input = new DataInputStream (socket.getInputStream ());
    output = new DataOutputStream (socket.getOutputStream ());

    exit.writeBytes (XMLSRequest);
    exit.flush ();

    // Long end = System.currentTimeMillis ();
    / * Change for optimization when getting an answer - Migracion 10/08/2012 * /
    StringBuilder sBuilder = new StringBuilder ();

    while ((answer = input.readLine ())! = null) {
    // end answer = answer;
    sBuilder.append (answer);
    }
    Final answer = sBuilder.toString ();

    would help me a lot if you have an example of how a socket is virtualized in devtest

    Thanks


  • 2.  RE: socket virtualization
    Best Answer

    Broadcom Employee
    Posted Jul 17, 2019 02:28 AM
    HI Vladimir
            You are in the right direction. TCP virtualization suits best for your requirement. You may need to use one or more Data protocol handlers. Please refer to this document that shows an example of how this can be done. Please let me know if you need the source code used in that example.






  • 3.  RE: socket virtualization

    Posted Jul 17, 2019 11:06 AM
    Hi Sankar  Natarajan,  it would be very helpful if you send me the code used in that example

    Thanks, regards


  • 4.  RE: socket virtualization

    Broadcom Employee
    Posted Jul 18, 2019 08:06 AM
    The code is here:  https://community.broadcom.com/enterprisesoftware/viewdocument/?DocumentKey=3a75e7c5-4879-444e-8e9a-bbe0804f56ba&CommunityKey=94bda077-625b-4914-8ac3-c88a06c2cc23&tab=librarydocuments

    https://community.broadcom.com/enterprisesoftware/viewdocument/?DocumentKey=cd179a93-4b1e-42fe-9603-39c81eba6306&CommunityKey=94bda077-625b-4914-8ac3-c88a06c2cc23&tab=librarydocuments

    ------------------------------
    Sankar Natarajan
    Service Virtualization Product Engineering Team
    Broadcom
    ------------------------------