## GT0128 Hurricane WAP
## WSP Protocol Handler
#######################
## Ref. SGL.GT0128.aaa.bbb WSP Protocol Handler Unit Tests
## Unit test 2.3.1.11
## Driver chat script
#
# Test Synopsis
# * Invoke GET method N times, where N is greater than the MOR

# Expected Result
# * Expected result: Each Invoke is successfully completed


SCRIPT UnitTestDriver2.3.1.11 
#
# Sleep before start, allows stub time to start up and initialise.
#
	SLEEP 500
#
# Step 1 - set up the desired WSP proxy for this test
#
	INCLUDE "C:\HttpTest\wsp_pr_hnd_driver\setproxyinfo_driver.txt"
#
# Step 2 - make a clean connection to a WSP proxy (caps:  MOR = 1)
#
	INCLUDE "C:\HttpTest\wsp_pr_hnd_driver\doconnect_accept_driver.txt"
#
# Step 3 - open first transaction (will be given ID trans1)
#
	INCLUDE "C:\HttpTest\wsp_pr_hnd_driver\doopen_get_trans_driver.txt"
#
# Step 4 - submit the first transaction
#
	SEND
		INVOKE trans1 SubmitL
		ENDINVOKE
	ENDSEND

	SLEEP 1000
#
# Step 5 - open second transaction (will be given ID trans2)
#
	INCLUDE "C:\HttpTest\wsp_pr_hnd_driver\doopen_get_trans2_driver.txt"
#
# Step 6 - submit the second transaction
#
	SEND
		INVOKE trans2 SubmitL
		ENDINVOKE
	ENDSEND
#
# Step 7 - await the arrival of the response headers event from trans1
#
	EXPECT
		INVOCATION TransactionRunL
			VALIDATE aTransaction trans1
			VALIDATE aEvent EGotResponseHeaders
		ENDINVOCATION
	ENDEXPECT
#
# Step 8 - validate the response status code and headers for trans1
#
	SEND
		INVOKE trans1 GetStatusCode
			VALIDATE :RETURN: 200
		ENDINVOKE
		INVOKE trans1 GetHeaderL
			PARAMETER aFieldName Content-Type
			PARAMETER aFieldType RStringF
			VALIDATE aFieldValue application/vnd.wap.wmlc
			PARAMETER aPart 0
			VALIDATE :RETURN: ETrue
		ENDINVOKE
	ENDSEND
#
# Step 9 - await the arrival of the response body event for trans1
#
	EXPECT
		INVOCATION TransactionRunL
			VALIDATE aTransaction trans1
			VALIDATE aEvent EGotResponseBodyData
		ENDINVOCATION
	ENDEXPECT
#
# Step 10 - validate the response body for trans1
#
	SEND
		INVOKE trans1 GetBody
			STOREITEM :RETURN: respBody
		ENDINVOKE
		INVOKE respBody MHTTPDataSupplier::OverallDataSize
			VALIDATE :RETURN: 12
		ENDINVOKE
		INVOKE respBody MHTTPDataSupplier::GetNextDataPart
			VALIDATE aDataPart "SomeBodyData"
			VALIDATE :RETURN: ETrue
		ENDINVOKE
	ENDSEND
#
# Step 11 - release the response body for trans1 and expect to be reentered
#			with the response complete event
#
	SEND
		ALLOWREENTRANCY
		INVOKE respBody MHTTPDataSupplier::ReleaseData
		ENDINVOKE
	ENDSEND
	EXPECT
		INVOCATION TransactionRunL
			VALIDATE aTransaction trans1
			VALIDATE aEvent EResponseComplete
		ENDINVOCATION
	ENDEXPECT
#
# Step 12 - close the transaction trans1
#
	SEND
		INVOKE trans1 Close
		ENDINVOKE
	ENDSEND
#
# Step 13 - await the arrival of the response headers event from trans2
#
	EXPECT
		INVOCATION TransactionRunL
			VALIDATE aTransaction trans2
			VALIDATE aEvent EGotResponseHeaders
		ENDINVOCATION
	ENDEXPECT
#
# Step 14 - validate the response status code and headers from trans2
#
	SEND
		INVOKE trans2 GetStatusCode
			VALIDATE :RETURN: 200
		ENDINVOKE
		INVOKE trans2 GetHeaderL
			PARAMETER aFieldName Content-Type
			PARAMETER aFieldType RStringF
			VALIDATE aFieldValue application/vnd.wap.wmlc
			PARAMETER aPart 0
			VALIDATE :RETURN: ETrue
		ENDINVOKE
	ENDSEND
#
# Step 15 - await the arrival of the response body event from trans2
#
	EXPECT
		INVOCATION TransactionRunL
			VALIDATE aTransaction trans2
			VALIDATE aEvent EGotResponseBodyData
		ENDINVOCATION
	ENDEXPECT
#
# Step 16 - validate the response body from trans2
#
	SEND
		INVOKE trans2 GetBody
			STOREITEM :RETURN: respBody2
		ENDINVOKE
		INVOKE respBody2 MHTTPDataSupplier::OverallDataSize
			VALIDATE :RETURN: 12
		ENDINVOKE
		INVOKE respBody2 MHTTPDataSupplier::GetNextDataPart
			VALIDATE aDataPart "SomeBodyData"
			VALIDATE :RETURN: ETrue
		ENDINVOKE
	ENDSEND
#
# Step 17 - release the response body for trans2 and expect to be reentered
#			with the response complete event
#
	SEND
		ALLOWREENTRANCY
		INVOKE respBody2 MHTTPDataSupplier::ReleaseData
		ENDINVOKE
	ENDSEND
	EXPECT
		INVOCATION TransactionRunL
			VALIDATE aTransaction trans2
			VALIDATE aEvent EResponseComplete
		ENDINVOCATION
	ENDEXPECT
#
# Step 18 - close the transaction trans2
#
	SEND
		INVOKE trans2 Close
		ENDINVOKE
	ENDSEND
#
# Ask for disconnect
# 
	SLEEP 500
	INCLUDE "C:\HttpTest\wsp_pr_hnd_driver\do_clientdisconnect_driver.txt"
#
# Give the stub a chance to finish before exiting
#
	SLEEP 500
#
# Done!
#

ENDSCRIPT
