gwyj001 - Local, Auto and Networked Java Gateways

This programs tests:

  1. Networked JavaGateway
  2. Local JavaGateway
  3. Auto JavaGateway
  4. LocalJavaGateway.destroy() method

The order of tests is as follows:

  1. Check NETWORKED JavaGateway is available, ECI Sync to NETWORKED, then close
  2. Create LOCAL JavaGateway and ECI Sync to LOCAL
  3. Re-open NETWORKED (TCP/IP) JavaGateway, then ECI Sync to NETWORKED
  4. Create AUTO (should default to Local:) JavaGateway, then ECI Sync to AUTO
  5. Explicitly close AUTO connection
  6. Call LocalJavaGateway.destroy() method - this should FAIL
  7. Explicitly close LOCAL connection
  8. Call to LocalJavaGateway.destroy() method
  9. Create LOCAL JavaGateway - should FAIL
  10. Create AUTO JavaGateway - should FAIL
  11. ECI Sync to NETWORKED
  12. Explicitly close NETWORKED connection

Parameters can be overridden via command line.

Issue "gwyj001 -?" for help and default settings.

Sample Input

java jgtest.gateway.gwyj001 -j hollings

The -j option must specify an active Java Gateway and should not be local:

Sample Output

gwyj001 - Local, Auto and Networked Java Gateways -j Networked JGate -> hollings -r JGate port -> 2006 -list list systems only -> false -s CICS server -> (not specified) -a application -> SRVTIME -u userid -> SYSAD -p password -> SYSAD -! debug -> false -? Display settings only --- gwyj001 started 18/06/98 16:54 --- Successfully created JavaGateway connection --- --- Using CICS Region: NETBTCLR 1. NETWORKED JavaGateway connection available getAddress() ............ hollings getGatewayLocale()....... en_GB getPort() ............... 2006 getProtocol()............ tcp getURL() ................ tcp://hollings:2006/ isInitialFlow() ......... true isOpen() ................ true eci_sync - commarea ..... 18/06/98 16:54:13 RC: 0 NETWORKED JavaGateway connection closed 2. LOCAL JavaGateway connection available via setURL(local:) getAddress() ............ getGatewayLocale()....... null getPort() ............... 0 getProtocol()............ local getURL() ................ local:/// isInitialFlow() ......... true isOpen() ................ false LOCAL JavaGateway connection opened isOpen() ................ true eci_sync - commarea ..... 18/06/98 16:54:14 RC: 0 3. NETWORKED JavaGateway connection re-opened getAddress() ............ hollings getGatewayLocale()....... en_GB getPort() ............... 2006 getProtocol()............ tcp getURL() ................ tcp://hollings:2006/ isInitialFlow() ......... true isOpen() ................ true eci_sync - commarea ..... 18/06/98 16:54:14 RC: 0 4. AUTO JavaGateway connection available getAddress() ............ hollings getGatewayLocale()....... null getPort() ............... 2006 getProtocol()............ auto getURL() ................ auto://hollings:2006/ isInitialFlow() ......... true isOpen() ................ true AutoJavaGateway protocol. tcp eci_sync - commarea ..... 18/06/98 16:54:15 RC: 0 5. AUTO JavaGateway connection closed isOpen() ................ false 6. Call to LocalJavaGateway.destroy() raised expected exception. Exception: java.io.IOException: CCL6659E: In use Local Gateways currently exist. 7. LOCAL JavaGateway connection isOpen() ................ true LOCAL JavaGateway connection closed isOpen() ................ false 8. Call to LocalJavaGateway.destroy() successful 9. Creation of LocalJavaGateway failed and raised expected exception. Exception: java.io.IOException: CCL6658E: Local Gateway support has been terminated. 10. Creation of AutoJavaGateway failed and raised expected exception. Exception: java.io.IOException: CCL6658E: Local Gateway support has been terminated. 11. Continue with NETWORKED JavaGateway connection isOpen() ................ true eci_sync - commarea ..... 18/06/98 16:54:15 RC: 0 12. Close NETWORKED JavaGateway connection NETWORKED JavaGateway connection closed isOpen() ................ false --- gwyj001 completed 18/06/98 16:54 --- Calls successful ... 5 out of 5 --- Iterations run ..... 1 out of 1 --- gwyj001 : JGate steps completed successfully ... 12 out of 12

History log: