TInt CTestMessSharedData::DeleteEntryL(CTestStep& aStep)
	{
	TInt	ret=KErrNone;
	TPtrC	name;

	if ( !aStep.GetStringFromConfig(aStep.ConfigSection(), KName, name) )
		{
		aStep.ERR_PRINTF1(_L("Name not found"));
		aStep.SetTestStepResult(EFail);
		ret=KErrArgument;
		}
	else
		{
		aStep.INFO_PRINTF2(_L("Name : %S"), &name);

		CMsgEntry*	msgParent=NULL;
		CMsgEntry*	msgEntry=iList;
		TBool		found=EFalse;

		while ( (msgEntry!=NULL) && !found )
			{
			if ( msgEntry->iName.Compare(name) == 0 )
				{
				if ( msgParent!=NULL )
					{
					msgParent->iNext=msgEntry->iNext;
					}
				else
					{
					iList=msgEntry->iNext;
					}
				iDeleteTestStep=ETrue;
				iAnyPostStepToDo=msgEntry;
				found=ETrue;
				}
			else
				{
				msgParent=msgEntry;
				msgEntry=msgEntry->iNext;
				}
			}

		if ( !found )
			{
			aStep.ERR_PRINTF1(_L("Message Entry not found"));
			aStep.SetTestStepResult(EFail);
			ret=KErrNotFound;
			}
		}

	return ret;
	}
void CTestMessSharedData::CMsgEntry::ConstructL(CTestStep& aStep)
	{
	TPtrC	name;

	//	Read in name tag
	if ( !aStep.GetStringFromConfig(aStep.ConfigSection(), KName, name) )
		{
		aStep.ERR_PRINTF1(_L("Name not found"));
		aStep.SetTestStepResult(EFail);
		}
	else
		{
		aStep.INFO_PRINTF2(_L("Name : %S"), &name);
		iName.Copy(name);
		}
	}
void CHttpClientTestParams::ConstructL(CTestStep& aTestCase)
    {
    TPtrC method;
    TPtrC uri;
    TPtrC rawRequest;
    TPtrC rawResponse;
    TPtrC rawEncodedAuthenticationRequest;
    TPtrC rawFinalResponse;
    if(!aTestCase.GetStringFromConfig(aTestCase.ConfigSection(), KMethod(), method) || 
            !aTestCase.GetStringFromConfig(aTestCase.ConfigSection(), KUri(), uri) ||
             !aTestCase.GetIntFromConfig(aTestCase.ConfigSection(), KStatusCode(), iStatusCode))
        {
        User::Leave(KErrCorrupt);
        }
    aTestCase.GetStringFromConfig(aTestCase.ConfigSection(), KRawRequest(), rawRequest);
    aTestCase.GetStringFromConfig(aTestCase.ConfigSection(), KRawResponse(), rawResponse);
    aTestCase.GetStringFromConfig(aTestCase.ConfigSection(), KRawEncodedAuthenticationRequest(), rawEncodedAuthenticationRequest);
    aTestCase.GetStringFromConfig(aTestCase.ConfigSection(), KRawFinalResponse(), rawFinalResponse);
    
    iMethod = EscapeUtils::ConvertFromUnicodeToUtf8L(method);
    iUri = EscapeUtils::ConvertFromUnicodeToUtf8L(uri);
    iRawRequest = EscapeUtils::ConvertFromUnicodeToUtf8L(rawRequest);
    iRawResponse = EscapeUtils::ConvertFromUnicodeToUtf8L(rawResponse);
    iEncodedAuthenticationRequest = EscapeUtils::ConvertFromUnicodeToUtf8L(rawEncodedAuthenticationRequest);
    iFinalResponse = EscapeUtils::ConvertFromUnicodeToUtf8L(rawFinalResponse);
       
    ParseAndReplaceCRLF(iRawRequest);
    ParseAndReplaceCRLF(iRawResponse);
    ParseAndReplaceCRLF(iEncodedAuthenticationRequest);
    ParseAndReplaceCRLF(iFinalResponse);

    
    
    TPtrC responseBody;
    if(aTestCase.GetStringFromConfig(aTestCase.ConfigSection(), KResponseBody(), responseBody))
        {
        iResponseBody = EscapeUtils::ConvertFromUnicodeToUtf8L(responseBody);
        }
    
    TPtrC requestBody;
    if(aTestCase.GetStringFromConfig(aTestCase.ConfigSection(), KRequestBody(), requestBody))
        {
        iRequestBody = EscapeUtils::ConvertFromUnicodeToUtf8L(requestBody);
        }
    
    
    // Now read the headers
    // Read the number of headers
    TInt responseHeaderCount = 0;
    aTestCase.GetIntFromConfig(aTestCase.ConfigSection(), KResponseFieldCount(), responseHeaderCount);
    for(TInt i = 0; i < responseHeaderCount; ++i)
        {
        CHeaderInfo* headerInfo = new(ELeave) CHeaderInfo;
        CleanupStack::PushL(headerInfo);
        TBuf<32> headerFormat;
        headerFormat.Format(KHeader(), i + 1);
        TPtrC headerName;
        aTestCase.GetStringFromConfig(aTestCase.ConfigSection(), headerFormat, headerName);
        headerInfo->iFieldName = EscapeUtils::ConvertFromUnicodeToUtf8L(headerName);
        TInt headerValueCount = 0;        
        TBuf<32> headerValueCountStr;
        headerValueCountStr.Format(KHeaderValueCount(), i + 1);        
        aTestCase.GetIntFromConfig(aTestCase.ConfigSection(), headerValueCountStr, headerValueCount);        
        for(TInt j = 0; j < headerValueCount; ++j)
            {
            TBuf<32> headerValueFormat;
            headerValueFormat.Format(KHeaderValue(), i + 1, j+ 1);
            TPtrC headerValue;
            aTestCase.GetStringFromConfig(aTestCase.ConfigSection(), headerValueFormat, headerValue);
            CHeaderFieldInfo* fieldInfo = new(ELeave) CHeaderFieldInfo;
            CleanupStack::PushL(fieldInfo);
            fieldInfo->iFieldValue = EscapeUtils::ConvertFromUnicodeToUtf8L(headerValue);
            
            // Check this field has params.
            TBuf<32> headerFieldParamCount;
            headerFieldParamCount.Format(KFieldParamCount(), i + 1, j + 1);
            TInt paramCount = 0;
            aTestCase.GetIntFromConfig(aTestCase.ConfigSection(), headerFieldParamCount, paramCount);
            for(TInt k = 0; k < paramCount; ++k)
                {
                TBuf<48> fieldParamName;
                TBuf<48> fieldParamValue;
                fieldParamName.Format(KFieldParamName, i + 1, j + 1, k + 1);
                fieldParamValue.Format(KFieldParamValue, i + 1, j + 1, k + 1);             
                TPtrC paramName;
                TPtrC paramValue;
                aTestCase.GetStringFromConfig(aTestCase.ConfigSection(), fieldParamName, paramName);
                aTestCase.GetStringFromConfig(aTestCase.ConfigSection(), fieldParamValue, paramValue);
                CHeaderFieldParamInfo* paramInfo = new(ELeave) CHeaderFieldParamInfo;
                CleanupStack::PushL(paramInfo);
                paramInfo->iParamName = EscapeUtils::ConvertFromUnicodeToUtf8L(paramName);
                paramInfo->iParamValue = EscapeUtils::ConvertFromUnicodeToUtf8L(paramValue);                
                fieldInfo->iFieldParamInfos.AppendL(paramInfo);
                CleanupStack::Pop(); // paramInfo                
                }
            
            headerInfo->iFieldInfos.AppendL(fieldInfo); 
            CleanupStack::Pop(); // fieldInfo
            }        
        // Check if the header has some params
        TBuf<48> headerParamCount;
        headerParamCount.Format(KHeaderParamCount(), i + 1);
        TInt hdrParamCount = 0;
        aTestCase.GetIntFromConfig(aTestCase.ConfigSection(), headerParamCount, hdrParamCount);   
        for(TInt x = 0; x < hdrParamCount; ++x)
            {
            TBuf<48> headerParamName;
            TBuf<48> headerParamValue;
            headerParamName.Format(KHeaderParamName(), i + 1, x + 1);
            headerParamValue.Format(KHeaderParamValue(), i + 1, x + 1);
            TPtrC paramName;
            TPtrC paramValue;
            aTestCase.GetStringFromConfig(aTestCase.ConfigSection(), headerParamName, paramName);
            aTestCase.GetStringFromConfig(aTestCase.ConfigSection(), headerParamValue, paramValue);
            CHeaderFieldParamInfo* paramInfo = new (ELeave) CHeaderFieldParamInfo;
            CleanupStack::PushL(paramInfo);
            paramInfo->iParamName = EscapeUtils::ConvertFromUnicodeToUtf8L(paramName);
            paramInfo->iParamValue = EscapeUtils::ConvertFromUnicodeToUtf8L(paramValue);
            headerInfo->iParamInfos.AppendL(paramInfo);
            CleanupStack::Pop(); // paramInfo
            }
        iResponseHeaderInfos.AppendL(headerInfo);
        CleanupStack::Pop(); // headerInfo
        }

    TPtrC fileName;
    aTestCase.GetStringFromConfig(aTestCase.ConfigSection(), KResponseFileName(), fileName);
    if(fileName.Length() > 0)
        {
        iFileSender = CFileSender::NewL(fileName);        
        aTestCase.GetStringFromConfig(aTestCase.ConfigSection(), KResponseFileNameStore(), fileName);
        if(fileName.Length() == 0)
            {
            User::Leave(KErrCorrupt);
            }
        iFileReceiver = CFileReceiver::NewL(fileName);
        }

    
    TPtrC ulFileName;
    aTestCase.GetStringFromConfig(aTestCase.ConfigSection(), KRequestFileName(), ulFileName);
    if(ulFileName.Length() > 0)
        {
        iFileSender = CFileSender::NewL(ulFileName);
        aTestCase.GetStringFromConfig(aTestCase.ConfigSection(), KRequestFileNameStore(), ulFileName);
        if(ulFileName.Length() == 0)
             {
             User::Leave(KErrCorrupt);
             }
         iFileReceiver = CFileReceiver::NewL(ulFileName);        
        }
    
    // Read request headers 
     TInt reqFieldCount = 0;
    aTestCase.GetIntFromConfig(aTestCase.ConfigSection(), KRequestFieldCount(), reqFieldCount);
    
    for(TInt ii = 0; ii < reqFieldCount; ++ii)
        {
        // Read the request header
        TBuf<64> reqHeaderStr;
        reqHeaderStr.Format(KRequestHeader(), ii + 1);
        TPtrC reqHeaderName;
        aTestCase.GetStringFromConfig(aTestCase.ConfigSection(), reqHeaderStr, reqHeaderName);
        CHeaderInfo* headerInfo = new(ELeave) CHeaderInfo;
        CleanupStack::PushL(headerInfo);
        headerInfo->iFieldName = EscapeUtils::ConvertFromUnicodeToUtf8L(reqHeaderName);
        
        // Now read how many fields are present
        reqHeaderStr.Format(KRequestHeaderValueCount(), ii + 1);
        TInt reqHdrValueCount = 0;
        aTestCase.GetIntFromConfig(aTestCase.ConfigSection(), reqHeaderStr, reqHdrValueCount);
        for(TInt jj = 0; jj < reqHdrValueCount; ++jj)
            {
            TPtrC reqHeaderVal;
            reqHeaderStr.Format(KRequestHeaderValue(), ii + 1, jj + 1);
            aTestCase.GetStringFromConfig(aTestCase.ConfigSection(), reqHeaderStr, reqHeaderVal);
            CHeaderFieldInfo* info = new (ELeave) CHeaderFieldInfo;
            CleanupStack::PushL(info);
            info->iFieldValue = EscapeUtils::ConvertFromUnicodeToUtf8L(reqHeaderVal);
            reqHeaderStr.Format(KRequestHeaderValueParamCount, ii + 1, jj + 1);
            TInt paramCount = 0;
            aTestCase.GetIntFromConfig(aTestCase.ConfigSection(), reqHeaderStr, paramCount);
            for(TInt kk = 0; kk < paramCount; ++kk)
                {
                reqHeaderStr.Format(KRequestHeaderValueParamName(), ii + 1, jj + 1, kk + 1);
                TPtrC name;
                TPtrC value;
                aTestCase.GetStringFromConfig(aTestCase.ConfigSection(), reqHeaderStr, name);
                reqHeaderStr.Format(KRequestHeaderValueParamValue(), ii + 1, jj + 1, kk + 1);
                aTestCase.GetStringFromConfig(aTestCase.ConfigSection(), reqHeaderStr, value);
                
                CHeaderFieldParamInfo* paramInfo = new (ELeave) CHeaderFieldParamInfo;
                CleanupStack::PushL(paramInfo);
                paramInfo->iParamName = EscapeUtils::ConvertFromUnicodeToUtf8L(name);
                paramInfo->iParamValue = EscapeUtils::ConvertFromUnicodeToUtf8L(value);
                info->iFieldParamInfos.AppendL(paramInfo);
                CleanupStack::Pop(); // CHeaderFieldParamInfo
                }
            headerInfo->iFieldInfos.AppendL(info);
            CleanupStack::Pop(); // info
            }
        
        iRequestHeaderInfos.AppendL(headerInfo);
        CleanupStack::Pop();      
        }         
    
    iConnDisconnect = EFalse;
    aTestCase.GetBoolFromConfig(aTestCase.ConfigSection(), KConnDisconnect(), iConnDisconnect);
    
    iExpectedError = KErrNone;    
    aTestCase.GetIntFromConfig(aTestCase.ConfigSection(), KExpectedError(), iExpectedError);
    
    iNoRetryOnDisconnect = EFalse;
    aTestCase.GetBoolFromConfig(aTestCase.ConfigSection(), KNoRetryOnDisconnect(), iNoRetryOnDisconnect);
    
    iResponseDynamicAndStatic = EFalse;
    aTestCase.GetBoolFromConfig(aTestCase.ConfigSection(), KResponseDynamicAndStatic(), iResponseDynamicAndStatic);
    
    iOnlineTest = EFalse;
    aTestCase.GetBoolFromConfig(aTestCase.ConfigSection(), KOnlineTest(), iOnlineTest);
        
    iRedirection = EFalse;
    aTestCase.GetBoolFromConfig(aTestCase.ConfigSection(), KRedirection(), iRedirection);
   
    iResponseTimeout = EFalse;
    aTestCase.GetBoolFromConfig(aTestCase.ConfigSection(), KResponseTimeout(), iResponseTimeout);
    
    iNotifyTransferProgress = EFalse;
    aTestCase.GetBoolFromConfig(aTestCase.ConfigSection(), KNotifyTransferProgress(), iNotifyTransferProgress);
    
    iSetAuthentication = EFalse;
    aTestCase.GetBoolFromConfig(aTestCase.ConfigSection(), KSetAuthentication(), iSetAuthentication);
    
    TPtrC proxyAddress;
    if(aTestCase.GetStringFromConfig(aTestCase.ConfigSection(), KProxyAddress, proxyAddress))
        {
        iProxyAddress = EscapeUtils::ConvertFromUnicodeToUtf8L(proxyAddress);
        }
    }