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

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


SCRIPT UnitTestDriver2.3.3.11 
#
# Sleep before start, allows stub time to start up and initialise.
#
	SLEEP 500
#
# Set the proxy info
#
	INCLUDE "C:\HttpTest\wsp_pr_hnd_driver\setproxyinfo_driver.txt"
#
# Get the session connected - default caps
#
	INCLUDE "C:\HttpTest\wsp_pr_hnd_driver\doconnect_accept_driver.txt"
#
# Do the method invocation - trans1 
#
	SLEEP 500
	INCLUDE "C:\HttpTest\wsp_pr_hnd_driver\trans1_post_singlebody_driver.txt"
#
# Do the method invocation - trans2 - just invocation as need to wait until trans1 completes
#
	SLEEP 500
	SEND
		INVOKE OpenTransactionL
			PARAMETER aMethod POST
			PARAMETER aUri http://wap.symbian.com/
			STOREITEM :RETURN: trans2
		ENDINVOKE
		INVOKE trans2 AddHeaderL
			PARAMETER aFieldName Accept
			PARAMETER aFieldType RStringF
			PARAMETER aFieldValue application/vnd.wap.wmlc
		ENDINVOKE
		INVOKE trans2 AddHeaderL
			PARAMETER aFieldName Content-Type
			PARAMETER aFieldType RStringF
			PARAMETER aFieldValue application/x-www-form-urlencoded
		ENDINVOKE
		INVOKE trans2 AddBody
			CREATEITEM aBody CDriverDataSupplier body2
		ENDINVOKE
		INVOKE trans2 SubmitL
		ENDINVOKE
	ENDSEND
#
# Trans 2 - Expect call to OverallDataSize invoked from the validation filter
#
	EXPECT
		INVOCATION body2 MHTTPDataSupplier::OverallDataSize
			PARAMETER :RETURN: 48
		ENDINVOCATION
	ENDEXPECT
#
# Get the response - trans1
#
	INCLUDE "C:\HttpTest\wsp_pr_hnd_driver\trans1_response_multichunk_singlesdu_driver.txt"
#
# Trans1 complete - Expect another call to OverallDataSize 
#
	EXPECT
		INVOCATION body2 MHTTPDataSupplier::OverallDataSize
			PARAMETER :RETURN: 48
		ENDINVOCATION
	ENDEXPECT
#
# Expect the post data to be extracted - one part only
#
	EXPECT
		INVOCATION body2 MHTTPDataSupplier::GetNextDataPart
			PARAMETER aDataPart <$file$C:\HttpTest\wsp_pr_hnd_driver\post_data_1_driver.txt$file$>
			PARAMETER :RETURN: ETrue
		ENDINVOCATION
	ENDEXPECT
#
# Expect the release of the data
#
	EXPECT
		INVOCATION body2 MHTTPDataSupplier::ReleaseData
		ENDINVOCATION
	ENDEXPECT
#
# Get the response - trans2
#
	INCLUDE "C:\HttpTest\wsp_pr_hnd_driver\trans2_response_multichunk_singlesdu_driver.txt"
#
# 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


