gwyj001 - Local, Auto and Networked Java Gateways
This programs tests:
- Networked JavaGateway
- Local JavaGateway
- Auto JavaGateway
- LocalJavaGateway.destroy() method
The order of tests is as follows:
- Check NETWORKED JavaGateway is available, ECI Sync to NETWORKED, then close
- Create LOCAL JavaGateway and ECI Sync to LOCAL
- Re-open NETWORKED (TCP/IP) JavaGateway, then ECI Sync to NETWORKED
- Create AUTO (should default to Local:) JavaGateway, then ECI Sync to AUTO
- Explicitly close AUTO connection
- Call LocalJavaGateway.destroy() method - this should FAIL
- Explicitly close LOCAL connection
- Call to LocalJavaGateway.destroy() method
- Create LOCAL JavaGateway - should FAIL
- Create AUTO JavaGateway - should FAIL
- ECI Sync to NETWORKED
- 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:
- Written : Nov 97 - Alan Hollingshead (based on destroyLocalGateway by Chris Goodall)
- Updated : Apr 98 - uses common classes