I posted this tutorial as an answer to a question, but there's been enough discussion that I'm separating it into a separate thread.
Here are the basic instructions. Let me know if you have any questions.
Step 1 – In your favourite java IDE, add the jar files from the bin directory in your DevTest (aka Service Virtualization or LISA) installation directory:
Step 2 – Create a new Java class that extends DataProtocol. It is recommended you extend ParameterListDataProtocol to make things easier, but not required.
Step 3 – Override and implement “public void updateRequest(TestExec testExec, Request request)”
This method is called to parse the request into readable data.
Make sure to call request.setOperation(operationName) to set the operation name for the request
Pull out the fields that are important for determining which fields you want to match on using request.getArguments().addParameter(new Parameter(“Name of Field”, “Value of field”));
Step 4 – Override and implement “public void updateResponse(TestExec testExec, Response response)”
This method is called to parse the response. It’s used only for displaying the response in a user friendly format. In playback mode this isn’t called
Call response.setBody(xmlResults) to set the response after converting it into a user friendly format (XML is recommended)
Step 5 – Override and implement “public void updateResponse(TestExec testExec, TransientResponse transientResponse)”
This method is called in playback mode to generate the response (ie. converts the user friendly version of the response into the format required by the system)
Call transientResponse.setBody(response) to set the response after converting it to the correct format
Step 6 – Create a file in your project. The name can be anything, but the extension must be “.lisaextensions”. In the file you’ll specify the details of your new Data Protocol Handler:
Step 7 – Export the classes and lisaextensions file as a jar and place them in the hotdeploy directory in the DevTest (aka Service Virtualization or LISA) installation directory.
Note if you make an update, close the workstation and reopen it to pick up the changes.
Attached is a sample implementation of a DPH and the associated lisaextensions file. Let me know if you have any questions.
I have followed the example up to copying the generated jar into hotdeploy. After that, I open the workstation and where should I see the example DPH? Went to VSE Recorder but isn't there.
Try restarting the Registry service....
Same thing. I am running DevTest 9.0.0. I see in the logs that the hotDeploy folder is checked:
2016-09-22 13:53:48,405Z (10:53) [Event Sink Thread Pool Thread 1] WARN com.itko.util.DirectoryWatcher - File 'C:\Program Files\CA\DevTest\hotDeploy\TDI_ISO-8583.jar' has been touched. User: 'KRATOS$' Host Name: 'kratos'
Then restart the Workstation:
2016-09-22 13:54:31,672Z (10:54) [ServerRequestResponder 6] INFO com.itko.lisa.coordinator.TestRegistryImpl - Asked to remove workstation null
2016-09-22 13:54:58,183Z (10:54) [ServerRequestResponder 4] INFO com.itko.lisa.coordinator.TestRegistryImpl - adding new live workstation
Is there anything I could enable to see what's wrong? Like debug logs. Where should I see the deployed DPH if it's built exactly like the example.
I tried implementing this using only Request (UpdateRequest) side for my testing and learning purpose. But faced an issue . Lisa is not able to create instance of that ProcyoclHandler Class . Error thorwn is Unsupported class version 52. So what i probably interpret here is because of Jre versions because custom prortocol i have built is using JRE 1.8 however on my Server whrere i have workstation (Devetest 8.x) has JRE 1.6 installed . Is this because of this compatibility conflict ?
Also looks like Devetest 8.x supports Java 7 . Please advise further
Hi Kevin.Bowman can you please help me here