Forum Discussion

CDurkin's avatar
CDurkin
Contributor
15 years ago

Problem with command line when testing a JAVA application.

My java applications includes serveral thirdparty JAR's.  When I manual run the app I use a command line like below:



    java -cp myApp.jar;thirdPartyLib1.jar;thirdPartyLib2.jar myClassName



However in TestComplete I fill in the java dialog box it always fails on the 2nd item in the "Class paths" list.



When I examine the "Command line" of the item in the tests window, it is showing a space instead of semicolon.  The space character does not seem to be a valid delimiter for class path items.  For example TestCompletes java command line is:



    "java.exe" -cp "myApp.jar" "thirdPartyLib1.jar" "thirdPartyLib2.jar" myClassName





Is this a bug, or a configuration issues?



Thanks

3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Have you walked through this using the "Add Java Application" dialog?  As I see it, not having run a JAR myself through TC, for adding multiple JAR files there's a specific feature of the dialog where you add additional files, folders, and classes.  See the following topic and see if it helps.



    http://smartbear.com/support/viewarticle/18982/
  • I did use the "Add Java Application" dialog to create the Tested Application. My problem is when the "Class path" list as more than one entry, the system then always complains about the second entry.  If I look at and copy and paste the Command Line from the top of the TestedApps screen into a batch file the program will not run.



    The class paths in the command line are all seperated by spaces " ", however if replace the spaces with ";" semicolon's it no longer a problem. 



    In the end to get around this problem I changed my JAR's manifest file so that I did not have to list items in the Class path control. 


  • Hi Chris,



    This is a bug. It will be corrected in future product updates. Thank you for reporting it.

    Meanwhile, you can either modify the application manifest (as you have already done), or add java.exe (or javaw.exe) as TestedApp in Simple run mode and pass the rest of the parameters (the JAR-file to be tested, class paths, and so forth) via the command line.



    Sorry for the inconvenience.