How to use pubtest.bat file in TIBCO Data Virtualization?

How to use pubtest.bat file in TIBCO Data Virtualization?

book

Article ID: KB0070308

calendar_today

Updated On:

Products Versions
TIBCO Data Virtualization All Supported Versions

Description

PubTest is used to ensure that resources published by a Composite server are functioning properly. Every time a new resource is published, a test should be added to PubTest’s input file to test that new resource.

PubTest should then be run immediately before exporting from a development instance, to check for regressions. PubTest should also be run on an instance after every import to check for regressions and to ensure that the import works. 

Syntax to execute pubtest.bat file:
============
pubtest.bat -host <hostname> -dbPort <TDV baseport+1> -wsPort <ws port> -user <username> -password <password> -domain <domain name> -input pubtest_sample.dat -printOutput true -encrypt false

Note: The '-input' parameter points to the 'pubtest_sample.dat' file by default. This file contains the query or web service calls to verify that the server is functioning properly. Instead of the 'pubtest_sample.dat', the user can also specify another text file with a .dat or .txt extension.


Below are the contents of the 'pubtest_sample.dat' file:
===============
[QUERY]
database=system
select * from ALL_DOMAINS
   where DOMAIN_NAME like 'c%'


[PROCEDURE]
database=examples
{ CALL LookupProduct(1) }


#[PROCEDURE]
#database=ds
#outTypes=INTEGER
#{ CALL procedure_with_one_integer_output(3,?) }


[WEB_SERVICE]
path=/services/system/admin/resource/resourcePort.ws
action=resourceExists
contentType=text/xml;charset=UTF-8
<soap-env:Envelope xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
  <soap-env:Body>
    <ns1:resourceExists xmlns:ns1="http://www.compositesw.com/services/system/admin/resource" >
      <ns1:path>/services/databases/system/ALL_DOMAINS</ns1:path>
      <ns1:type>TABLE</ns1:type>
    </ns1:resourceExists>
  </soap-env:Body>
</soap-env:Envelope>
===============

Issue/Introduction

This article will provide information on the usage of the pubtest.bat file in TIBCO Data Virtualization.

Environment

Windows

Resolution

To execute pubtest.bat, open the command prompt and navigate to the location:
'..\<TDV_Server_Dir>\apps\jdbc'

A sample command for reference:
 pubtest.bat -host localhost -dbPort 9811 -wsPort 9810 -user admin -password password -domain composite -input pubtest_sample.dat -printOutput true -encrypt false


The output for each test query in the pubtest_sample.bat file will be displayed on the command prompt window.

Screenshot of the output:
User-added image

A successful execution shows that the TDV server is functioning as expected. However, if an error is encountered, then the user would have to dig deeper into identifying the cause of the specified error.