## GT0128 Hurricane WAP
## WSP Protocol Handler
#######################
## Ref. SGL.GT0128.aaa.bbb WSP Protocol Handler Unit Tests
## Unit test 2.1.1.4
## Driver chat script
#
# Test Synopsis
# * Connect while in null state, server redirects to a permanent alternative address
# The function ConnectReq will be called, and the redirect reason will be returned by the callback DissconnectInd
# A new ConnectReq call will be made using the permanent alternative proxy address and the result will be returned by the callback ConnectCnf 

# Expected Result
# * Expected result: connection made to a new permanent server and the ERedirect message sent to the client. 


SCRIPT UnitTestDriver2.1.1.4 
#
# Sleep before start, allows stub time to start up and initialise.
#
	SLEEP 500
#
# Set the proxy info then connect
#
INCLUDE "C:\HttpTest\wsp_pr_hnd_driver\setproxyinfo_driver.txt"

	SEND
		INVOKE SessionConnectL
		ENDINVOKE
	ENDSEND

#
# Wait for the redirection event
#
	EXPECT
		INVOCATION SessionRunL
			VALIDATE aEvent ERedirected
		ENDINVOCATION
	ENDEXPECT

#
# Check the redirection proxy address
#
	ECHO "Getting redirected address"
	SEND
		INVOKE GetConnectionProperties
			VALIDATE aProxyAddress 10.29.23.2
			VALIDATE aBearer _010
			VALIDATE aIsSecure _01A
			VALIDATE aRemotePort 9203
		ENDINVOKE
	ENDSEND

#
# Wait for the cnf - this is given by EConnectedOK event
#
	ECHO "Waiting for cnf"
	EXPECT
		INVOCATION SessionRunL
			VALIDATE aEvent EConnectedOK
		ENDINVOCATION
	ENDEXPECT


# 
# Wait for a while
#
	ECHO DriverSleepingForHalfSec
	SLEEP 500
#
# Client disconnect
#
	SEND
		INVOKE SessionDisconnectL
			VALIDATE :LEAVECODE: 0
		ENDINVOKE
	ENDSEND
#
# Wait for ind - this is given by EDisconnected
#
	EXPECT
		INVOCATION SessionRunL
			VALIDATE aEvent EDisconnected
		ENDINVOCATION
	ENDEXPECT



#
# Give the stub a chance to finish before exiting
#
	SLEEP 500
#
# Done!
#

ENDSCRIPT


