LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to unit test a LabVIEW web service method?

Hey folks,

 

I have some integrated tests for my LabVIEW web service that involve deploying a built executable with the web service, issuing requests, and verifying the responses.  However, it would be desirable to catch issues earlier by leveraging unit tests, specifically using VI Tester.

 

I tried the most obvious unit test I could think of:

1. Drop the LV "Request" object on the BD

2. Call "Create Session.vi"

3. Call "Check If Session Exists.vi'

 

This doesn't appear to work.  Does anyone else have ideas on how to make something like this work, or mock out the LV web service interactions during unit testing?  I could, of course, refactor most of my subvis to not require Request.lvclass on the conpane, but there are still subvis that depend on it that I would like to exercise.

 

CheckPermissionsTestCase.jpg

 

Thanks for your time.

-ksh

0 Kudos
Message 1 of 3
(2,826 Views)

Is the issue related with the web services or with the rest of yor code? Have you take a look of the LV examples for Web services?

0 Kudos
Message 2 of 3
(2,722 Views)

@Machop wrote:

Is the issue related with the web services or with the rest of yor code? Have you take a look of the LV examples for Web services?


Based on my example above, I am only using LV primitives, so I would have to say the former.  And I don't know that it's an 'issue' so much as I don't know how to accomplish what I want to do (unit test LV requests).  I can get the LV web service methods and requests functioning fine in an integrated fashion, which seems to be what the LV examples cover.  But what I'm after here is specifically unit testing subvis with the Request.lvclass on the connector pane.

Thanks!

0 Kudos
Message 3 of 3
(2,718 Views)