# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1278419351 -10800 # Node ID a8ae8e6fbd42aa68867893bc7f740faa933012d0 # Parent a1df79fa35b402f89c987ff3473946ddb69c31ba Revision: 201025 Kit: 2010127 diff -r a1df79fa35b4 -r a8ae8e6fbd42 webservices/wsconnection/src/senserviceconnectionimpl.cpp --- a/webservices/wsconnection/src/senserviceconnectionimpl.cpp Fri Jun 11 14:42:58 2010 +0300 +++ b/webservices/wsconnection/src/senserviceconnectionimpl.cpp Tue Jul 06 15:29:11 2010 +0300 @@ -621,6 +621,7 @@ TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"SubmitL - ESenInternalError"); retVal = KErrSenInternal; } + break; default: { TLSLOG_L(KSenServiceConnectionLogChannelBase+iConnectionID, KMinLogLevel ,"SubmitL - default"); @@ -2511,16 +2512,19 @@ } else { - TMessage message = ipSenServiceDispatcher->GetMessageFromQueue(aTransactionID); - CSenAsyncOperation* pAsyncOp = message.iSenAsyncOperation; - if (pAsyncOp) - { - TInt idx = AsyncOpsArrayL().Find(pAsyncOp); - if (idx >= 0) - { - AsyncOpsArrayL().Remove(idx); - } - pAsyncOp->iActive = NULL; + TMessage message = ipSenServiceDispatcher->GetMessageFromQueue(aTransactionID); + CSenAsyncOperation* pAsyncOp = message.iSenAsyncOperation; + if (pAsyncOp) + { + TInt idx(-1); + TRAP( retVal, + idx = AsyncOpsArrayL().Find(pAsyncOp); + if (idx >= 0) + { + AsyncOpsArrayL().Remove(idx); + } + ); + pAsyncOp->iActive = NULL; pAsyncOp->Cancel(); delete pAsyncOp; diff -r a1df79fa35b4 -r a8ae8e6fbd42 webservices/wsdescription/src/servicepolicy.cpp --- a/webservices/wsdescription/src/servicepolicy.cpp Fri Jun 11 14:42:58 2010 +0300 +++ b/webservices/wsdescription/src/servicepolicy.cpp Tue Jul 06 15:29:11 2010 +0300 @@ -787,8 +787,6 @@ return EFalse; } - return EFalse; - } HBufC8* CServicePolicy::ClientPolicyValue(const TDesC8& aKey) { diff -r a1df79fa35b4 -r a8ae8e6fbd42 webservices/wsfragment/src/rsendocument.cpp --- a/webservices/wsfragment/src/rsendocument.cpp Fri Jun 11 14:42:58 2010 +0300 +++ b/webservices/wsfragment/src/rsendocument.cpp Tue Jul 06 15:29:11 2010 +0300 @@ -59,12 +59,17 @@ RXmlEngDocument doc; doc.OpenL(domImpl); RSenDocument document; + CleanupClosePushL(document); + document.ipData = NULL; + document.iInternal = NULL; document.ipData = new (ELeave) TSenDocumentData; document.iInternal = (reinterpret_cast(const_cast(&doc)))->iInternal; document.ipData->iInternal = document.iInternal; + document.ipData->ipOpenDocuments = NULL; document.ipData->ipOpenDocuments = new (ELeave) TInt(1); document.ipData->iDomImpl = domImpl; + CleanupStack::Pop(); TCleanupItem cleanup(CleanupRSenDocument, document.ipData); CleanupStack::PushL(cleanup); return document; @@ -89,12 +94,17 @@ RXmlEngDocument doc; doc.OpenL(domImpl, aInternal); RSenDocument document; + CleanupClosePushL(document); + document.ipData = NULL; + document.iInternal = NULL; document.ipData = new (ELeave) TSenDocumentData; document.iInternal = (reinterpret_cast(const_cast(&doc)))->iInternal; document.ipData->iInternal = document.iInternal; + document.ipData->ipOpenDocuments = NULL; document.ipData->ipOpenDocuments = new (ELeave) TInt(1); document.ipData->iDomImpl = domImpl; + CleanupStack::Pop(); TCleanupItem cleanup(CleanupRSenDocument, document.ipData); CleanupStack::PushL(cleanup); return document; @@ -108,26 +118,28 @@ EXPORT_C void RSenDocument::Close() { - *ipData->ipOpenDocuments = *ipData->ipOpenDocuments - 1; - if ( !*ipData->ipOpenDocuments ) - { - RXmlEngDOMImplementation domImpl = ipData->iDomImpl; - iInternal = ipData->iInternal; - delete ipData->ipOpenDocuments; - delete ipData; - RXmlEngDocument::Close(); - domImpl.Close(); - TBool* pDisabled = (TBool*)Dll::Tls(); - if ( !pDisabled ) - { - XmlEngineCleanup(); - } - } - else - { - iInternal = NULL; - } - + if(ipData && ipData->ipOpenDocuments) + { + *ipData->ipOpenDocuments = *ipData->ipOpenDocuments - 1; + if ( !*ipData->ipOpenDocuments ) + { + RXmlEngDOMImplementation domImpl = ipData->iDomImpl; + iInternal = ipData->iInternal; + delete ipData->ipOpenDocuments; + delete ipData; + RXmlEngDocument::Close(); + domImpl.Close(); + TBool* pDisabled = (TBool*)Dll::Tls(); + if ( !pDisabled ) + { + XmlEngineCleanup(); + } + } + else + { + iInternal = NULL; + } + } } EXPORT_C void RSenDocument::Destroy() diff -r a1df79fa35b4 -r a8ae8e6fbd42 webservices/wsframework/inc/senwebservicesession.h --- a/webservices/wsframework/inc/senwebservicesession.h Fri Jun 11 14:42:58 2010 +0300 +++ b/webservices/wsframework/inc/senwebservicesession.h Tue Jul 06 15:29:11 2010 +0300 @@ -293,6 +293,7 @@ // Data, which also subclasses can access TTime iValidUntil; + TTime iMaxTime; RSenCredentialPtr iCredentialPtr; HBufC8* iTransportCue; diff -r a1df79fa35b4 -r a8ae8e6fbd42 webservices/wsframework/src/sencontextitem.cpp --- a/webservices/wsframework/src/sencontextitem.cpp Fri Jun 11 14:42:58 2010 +0300 +++ b/webservices/wsframework/src/sencontextitem.cpp Tue Jul 06 15:29:11 2010 +0300 @@ -107,6 +107,7 @@ ipData = NULL; } } + break; case ECSenWSDescription: { CSenWSDescription* p = (CSenWSDescription*) ipData; diff -r a1df79fa35b4 -r a8ae8e6fbd42 webservices/wsframework/src/senmessagecontext.cpp --- a/webservices/wsframework/src/senmessagecontext.cpp Fri Jun 11 14:42:58 2010 +0300 +++ b/webservices/wsframework/src/senmessagecontext.cpp Tue Jul 06 15:29:11 2010 +0300 @@ -397,6 +397,7 @@ CSenContextItem* pItem = MessageToItem( apMessage, aOwned, leaveCode ); if( leaveCode != KErrNone ) { + delete pItem; return leaveCode; } @@ -415,6 +416,7 @@ CSenContextItem* pItem = MessageToItem( apMessage, aOwned, leaveCode ); if( leaveCode != KErrNone ) { + delete pItem; return leaveCode; } diff -r a1df79fa35b4 -r a8ae8e6fbd42 webservices/wsframework/src/senwebservicesession.cpp --- a/webservices/wsframework/src/senwebservicesession.cpp Fri Jun 11 14:42:58 2010 +0300 +++ b/webservices/wsframework/src/senwebservicesession.cpp Tue Jul 06 15:29:11 2010 +0300 @@ -98,6 +98,7 @@ // Init member variables iClientServerInterval = 0; iValidUntil = Time::NullTTime(); + iMaxTime = Time::NullTTime();; iFrameworkId = iFramework.Id().AllocL(); } @@ -1553,9 +1554,12 @@ } else { - const TTime& MAX_TIME = Time::MaxTTime(); - return MAX_TIME; // if no expiration was set, the session is + //const TTime& MAX_TIME = Time::MaxTTime(); + //return MAX_TIME; // if no expiration was set, the session is // valid forever(!) + iMaxTime = Time::MaxTTime(); + return iMaxTime; + } } diff -r a1df79fa35b4 -r a8ae8e6fbd42 webservices/wshttpchanneltransportplugin/src/senhttpchanneltransportplugin.cpp --- a/webservices/wshttpchanneltransportplugin/src/senhttpchanneltransportplugin.cpp Fri Jun 11 14:42:58 2010 +0300 +++ b/webservices/wshttpchanneltransportplugin/src/senhttpchanneltransportplugin.cpp Tue Jul 06 15:29:11 2010 +0300 @@ -482,10 +482,7 @@ { iHttpChannel->SetExplicitIapDefined(ETrue); } - if(iHttpChannel) - { iHttpChannel->DisableTimeOutL(aRequestId); - } #ifdef _SENDEBUG TLSLOG_FORMAT((KSenHttpChannelObserverLogChannelBase,KNormalLogLevel, _L8("- Request's txnID: %d"), aRequestId)); if ( apErrorBody ) diff -r a1df79fa35b4 -r a8ae8e6fbd42 webservices/wsmessages/src/senatomfeed.cpp --- a/webservices/wsmessages/src/senatomfeed.cpp Fri Jun 11 14:42:58 2010 +0300 +++ b/webservices/wsmessages/src/senatomfeed.cpp Tue Jul 06 15:29:11 2010 +0300 @@ -113,7 +113,7 @@ //from table for (TInt aIndex = 0; aIndex < iEntries.Count(); aIndex++ ) { - const TDesC8& tmp = iEntries[aIndex]->IdTag();//delete this + // const TDesC8& tmp = iEntries[aIndex]->IdTag();//delete this if(aEntryId.Compare(iEntries[aIndex]->IdTag())==0) { delete iEntries[aIndex]; diff -r a1df79fa35b4 -r a8ae8e6fbd42 webservices/wsmessages/src/sensoapenvelope2.cpp --- a/webservices/wsmessages/src/sensoapenvelope2.cpp Fri Jun 11 14:42:58 2010 +0300 +++ b/webservices/wsmessages/src/sensoapenvelope2.cpp Tue Jul 06 15:29:11 2010 +0300 @@ -188,7 +188,8 @@ : ipBodyFragment(NULL), ipHeaderFragment(NULL), ipSoapAction(NULL), - iFault(EFalse) + iFault(EFalse), + iTransactionId(KErrNotFound) { } diff -r a1df79fa35b4 -r a8ae8e6fbd42 webservices/wsutils/src/senpropertieselement.cpp --- a/webservices/wsutils/src/senpropertieselement.cpp Fri Jun 11 14:42:58 2010 +0300 +++ b/webservices/wsutils/src/senpropertieselement.cpp Tue Jul 06 15:29:11 2010 +0300 @@ -332,9 +332,10 @@ { CSenNamespace* pNamespace = sourceNamespaces[i]; CSenNamespace* pNewNamespace = - CSenNamespace::NewL(pNamespace->Prefix(),pNamespace->URI()); - + CSenNamespace::NewL(pNamespace->Prefix(),pNamespace->URI()); + CleanupStack::PushL(pNewNamespace); CSenXmlElement::AddNamespaceL(*pNewNamespace, EFalse); + CleanupStack::Pop(); } } diff -r a1df79fa35b4 -r a8ae8e6fbd42 webservices/wsxml/src/senxmlelement.cpp --- a/webservices/wsxml/src/senxmlelement.cpp Fri Jun 11 14:42:58 2010 +0300 +++ b/webservices/wsxml/src/senxmlelement.cpp Tue Jul 06 15:29:11 2010 +0300 @@ -1232,13 +1232,14 @@ if (pNamespace == NULL) // does not exist { CSenNamespace* pNewNamespace = - CSenNamespace::NewL(aNewNamespace.Prefix(), aNewNamespace.URI()); - + CSenNamespace::NewL(aNewNamespace.Prefix(), aNewNamespace.URI()); + CleanupStack::PushL(pNewNamespace); // allocate array if not already reserved if(!ipNamespaces) { ipNamespaces = new (ELeave) RPointerArray; } + CleanupStack::Pop(); ipNamespaces->Append(pNewNamespace); pNamespace = pNewNamespace; } @@ -1254,12 +1255,14 @@ { if ( aUri.Length() > 0) { - pNamespace = CSenNamespace::NewL(aPrefix, aUri); + pNamespace = CSenNamespace::NewL(aPrefix, aUri); + CleanupStack::PushL(pNamespace); // allocate array if not already reserved if(!ipNamespaces) { ipNamespaces = new (ELeave) RPointerArray; } + CleanupStack::Pop(); ipNamespaces->Append(pNamespace); } } diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/group/testhc_c.bat --- a/websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/group/testhc_c.bat Fri Jun 11 14:42:58 2010 +0300 +++ b/websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/group/testhc_c.bat Tue Jul 06 15:29:11 2010 +0300 @@ -20,4 +20,4 @@ ATSINTERFACE.EXE -testmodule HostletConnectionBCTest -copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_HostConn.txt \ No newline at end of file +copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\WebSrv_HostConn.txt \ No newline at end of file diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/group/testhc_z.bat --- a/websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/group/testhc_z.bat Fri Jun 11 14:42:58 2010 +0300 +++ b/websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/group/testhc_z.bat Tue Jul 06 15:29:11 2010 +0300 @@ -21,4 +21,4 @@ ATSINTERFACE.EXE -testmodule HostletConnectionBCTest -copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_HostConn.txt \ No newline at end of file +copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\WebSrv_HostConn.txt \ No newline at end of file diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/sis/50_asp_hostconn.pkg --- a/websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/sis/50_asp_hostconn.pkg Fri Jun 11 14:42:58 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; -&EN - -; Installation header -; Only one component name as we only support English -; UID is the main app's UID - -#{"WebServices hostlet"},(0x20015A25),3,0,0,TYPE=SA -[0x101F7961],0,0,0,{"Series60ProductID"} - -; Non-localised vendor name -:"Nokia Corporation" - -; Localised vendor names -%{"Nokia Corporation"} - -; Files to install and to where -"\Epoc32\Release\armv5\urel\HostletConnectionBCTest.dll"-"!:\sys\bin\HostletConnectionBCTest.dll" -"\Epoc32\winscw\c\testhc_c.bat"-"!:\testHC.bat" -"\Epoc32\winscw\c\testframework\testframework_hostlet.ini"-"!:\testframework\testframework_hostlet.ini" \ No newline at end of file diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/sis/50_asp_hostconn.sis Binary file websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/sis/50_asp_hostconn.sis has changed diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/sis/52_websrv_hostconn.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/sis/52_websrv_hostconn.pkg Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,36 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: +; +; Languages +; none - English only by default +&EN + +; Installation header +; Only one component name as we only support English +; UID is the main app's UID + +#{"WebServices hostlet"},(0x20015A25),3,0,0,TYPE=SA +[0x101F7961],0,0,0,{"Series60ProductID"} + +; Non-localised vendor name +:"Nokia Corporation" + +; Localised vendor names +%{"Nokia Corporation"} + +; Files to install and to where +"\Epoc32\Release\armv5\urel\HostletConnectionBCTest.dll"-"!:\sys\bin\HostletConnectionBCTest.dll" +"\Epoc32\winscw\c\testhc_c.bat"-"!:\testHC.bat" +"\Epoc32\winscw\c\testframework\testframework_hostlet.ini"-"!:\testframework\testframework_hostlet.ini" \ No newline at end of file diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/sis/52_websrv_hostconn.sis Binary file websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/sis/52_websrv_hostconn.sis has changed diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/hostlet_connection_api/tsrc/hostconnTester/group/hostconnTester.mmp --- a/websrv_pub/hostlet_connection_api/tsrc/hostconnTester/group/hostconnTester.mmp Fri Jun 11 14:42:58 2010 +0300 +++ b/websrv_pub/hostlet_connection_api/tsrc/hostconnTester/group/hostconnTester.mmp Tue Jul 06 15:29:11 2010 +0300 @@ -33,7 +33,6 @@ //USERINCLUDE ../inc -//SYSTEMINCLUDE /epoc32/include SYSTEMINCLUDE /Epoc32/include/libc MW_LAYER_SYSTEMINCLUDE //SYSTEMINCLUDE diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_connection_api/tsrc/bc/connection/group/testsc_c.bat --- a/websrv_pub/web_service_connection_api/tsrc/bc/connection/group/testsc_c.bat Fri Jun 11 14:42:58 2010 +0300 +++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/group/testsc_c.bat Tue Jul 06 15:29:11 2010 +0300 @@ -20,4 +20,4 @@ ATSINTERFACE.EXE -testmodule CSenServiceConnectionBCTest -copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_ServiceConnection.txt \ No newline at end of file +copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\WebSrv_ServiceConnection.txt \ No newline at end of file diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_connection_api/tsrc/bc/connection/group/testsc_z.bat --- a/websrv_pub/web_service_connection_api/tsrc/bc/connection/group/testsc_z.bat Fri Jun 11 14:42:58 2010 +0300 +++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/group/testsc_z.bat Tue Jul 06 15:29:11 2010 +0300 @@ -21,4 +21,4 @@ ATSINTERFACE.EXE -testmodule CSenServiceConnectionBCTest -copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_ServiceConnection.txt \ No newline at end of file +copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\WebSrv_ServiceConnection.txt \ No newline at end of file diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_connection_api/tsrc/bc/connection/sis/50_asp_connection.pkg --- a/websrv_pub/web_service_connection_api/tsrc/bc/connection/sis/50_asp_connection.pkg Fri Jun 11 14:42:58 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; -&EN - -; Installation header -; Only one component name as we only support English -; UID is the main app's UID - -#{"WebServices Connection"},(0x20016BAA),3,0,0,TYPE=SA -[0x101F7961],0,0,0,{"Series60ProductID"} - -; Non-localised vendor name -:"Nokia Corporation" - -; Localised vendor names -%{"Nokia Corporation"} - - -; Files to install and to where -"\Epoc32\Release\armv5\urel\CSenServiceConnectionBCTest.dll"-"!:\sys\bin\CSenServiceConnectionBCTest.dll" -"\Epoc32\winscw\c\testSC_c.bat"-"!:\testSC.bat" -"\Epoc32\winscw\c\testframework\testframework_connection.ini"-"!:\testframework\testframework_connection.ini" \ No newline at end of file diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_connection_api/tsrc/bc/connection/sis/50_asp_connection.sis Binary file websrv_pub/web_service_connection_api/tsrc/bc/connection/sis/50_asp_connection.sis has changed diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_connection_api/tsrc/bc/connection/sis/52_websrv_connection.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/sis/52_websrv_connection.pkg Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,37 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: +; +; Languages +; none - English only by default +&EN + +; Installation header +; Only one component name as we only support English +; UID is the main app's UID + +#{"WebServices Connection"},(0x20016BAA),3,0,0,TYPE=SA +[0x101F7961],0,0,0,{"Series60ProductID"} + +; Non-localised vendor name +:"Nokia Corporation" + +; Localised vendor names +%{"Nokia Corporation"} + + +; Files to install and to where +"\Epoc32\Release\armv5\urel\CSenServiceConnectionBCTest.dll"-"!:\sys\bin\CSenServiceConnectionBCTest.dll" +"\Epoc32\winscw\c\testSC_c.bat"-"!:\testSC.bat" +"\Epoc32\winscw\c\testframework\testframework_connection.ini"-"!:\testframework\testframework_connection.ini" \ No newline at end of file diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_connection_api/tsrc/bc/connection/sis/52_websrv_connection.sis Binary file websrv_pub/web_service_connection_api/tsrc/bc/connection/sis/52_websrv_connection.sis has changed diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_connection_api/tsrc/bc/senutils/group/testsu_c.bat --- a/websrv_pub/web_service_connection_api/tsrc/bc/senutils/group/testsu_c.bat Fri Jun 11 14:42:58 2010 +0300 +++ b/websrv_pub/web_service_connection_api/tsrc/bc/senutils/group/testsu_c.bat Tue Jul 06 15:29:11 2010 +0300 @@ -20,4 +20,4 @@ ATSINTERFACE.EXE -testmodule SenUtilsBCTest -copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_SenUtils.txt \ No newline at end of file +copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\WebSrv_SenUtils.txt \ No newline at end of file diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_connection_api/tsrc/bc/senutils/group/testsu_z.bat --- a/websrv_pub/web_service_connection_api/tsrc/bc/senutils/group/testsu_z.bat Fri Jun 11 14:42:58 2010 +0300 +++ b/websrv_pub/web_service_connection_api/tsrc/bc/senutils/group/testsu_z.bat Tue Jul 06 15:29:11 2010 +0300 @@ -21,4 +21,4 @@ ATSINTERFACE.EXE -testmodule SenUtilsBCTest -copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_SenUtils.txt \ No newline at end of file +copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\WebSrv_SenUtils.txt \ No newline at end of file diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_connection_api/tsrc/bc/senutils/sis/50_asp_senutils.pkg --- a/websrv_pub/web_service_connection_api/tsrc/bc/senutils/sis/50_asp_senutils.pkg Fri Jun 11 14:42:58 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; -&EN - -; Installation header -; Only one component name as we only support English -; UID is the main app's UID - -#{"WebServices Utils"},(0x20016BAB),3,0,0,TYPE=SA -[0x101F7961],0,0,0,{"Series60ProductID"} - -; Non-localised vendor name -:"Nokia Corporation" - -; Localised vendor names -%{"Nokia Corporation"} - -; Files to install and to where -"\Epoc32\Release\armv5\urel\SenUtilsBCTest.dll"-"!:\sys\bin\SenUtilsBCTest.dll" -"\Epoc32\winscw\c\testSU_c.bat"-"!:\testSU.bat" -"\Epoc32\winscw\c\testframework\testframework_senutils.ini"-"!:\testframework\testframework_senutils.ini" \ No newline at end of file diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_connection_api/tsrc/bc/senutils/sis/50_asp_senutils.sis Binary file websrv_pub/web_service_connection_api/tsrc/bc/senutils/sis/50_asp_senutils.sis has changed diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_connection_api/tsrc/bc/senutils/sis/52_websrv_senutils.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/web_service_connection_api/tsrc/bc/senutils/sis/52_websrv_senutils.pkg Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,36 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: +; +; Languages +; none - English only by default +&EN + +; Installation header +; Only one component name as we only support English +; UID is the main app's UID + +#{"WebServices Utils"},(0x20016BAB),3,0,0,TYPE=SA +[0x101F7961],0,0,0,{"Series60ProductID"} + +; Non-localised vendor name +:"Nokia Corporation" + +; Localised vendor names +%{"Nokia Corporation"} + +; Files to install and to where +"\Epoc32\Release\armv5\urel\SenUtilsBCTest.dll"-"!:\sys\bin\SenUtilsBCTest.dll" +"\Epoc32\winscw\c\testSU_c.bat"-"!:\testSU.bat" +"\Epoc32\winscw\c\testframework\testframework_senutils.ini"-"!:\testframework\testframework_senutils.ini" \ No newline at end of file diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_connection_api/tsrc/bc/senutils/sis/52_websrv_senutils.sis Binary file websrv_pub/web_service_connection_api/tsrc/bc/senutils/sis/52_websrv_senutils.sis has changed diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_connection_api/tsrc/senutilsTestCases/group/senutilsTestCases.mmp --- a/websrv_pub/web_service_connection_api/tsrc/senutilsTestCases/group/senutilsTestCases.mmp Fri Jun 11 14:42:58 2010 +0300 +++ b/websrv_pub/web_service_connection_api/tsrc/senutilsTestCases/group/senutilsTestCases.mmp Tue Jul 06 15:29:11 2010 +0300 @@ -55,7 +55,6 @@ //RESOURCE resource_file2 MW_LAYER_SYSTEMINCLUDE //SYSTEMINCLUDE -SYSTEMINCLUDE /epoc32/include SYSTEMINCLUDE /epoc32/include/xml SYSTEMINCLUDE /epoc32/include/libc diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_description_api/tsrc/bc/senservdesc/sis/50_ASP_WSDescription.SIS Binary file websrv_pub/web_service_description_api/tsrc/bc/senservdesc/sis/50_ASP_WSDescription.SIS has changed diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_description_api/tsrc/bc/senservdesc/sis/50_ASP_WSDescription.pkg --- a/websrv_pub/web_service_description_api/tsrc/bc/senservdesc/sis/50_ASP_WSDescription.pkg Fri Jun 11 14:42:58 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; -&EN - -; Installation header -; Only one component name as we only support English -; UID is the main app's UID - -#{"WebServices Description"},(0x10282CAB),3,0,0,TYPE=SA -[0x101F7961],0,0,0,{"Series60ProductID"} - -; Non-localised vendor name -:"Nokia Corporation" - -; Localised vendor names -%{"Nokia Corporation"} - -; Files to install and to where -"\Epoc32\Release\armv5\urel\SenServDescBCTest.dll"-"!:\sys\bin\SenServDescBCTest.dll" -"\Epoc32\winscw\c\testSD_c.bat"-"!:\testSD.bat" -"\Epoc32\winscw\c\testframework\testframework_senservdesc.ini"-"!:\testframework\testframework_senservdesc.ini" diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_description_api/tsrc/bc/senservdesc/sis/52_websrv_wsdescription.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/web_service_description_api/tsrc/bc/senservdesc/sis/52_websrv_wsdescription.pkg Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,36 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: +; +; Languages +; none - English only by default +&EN + +; Installation header +; Only one component name as we only support English +; UID is the main app's UID + +#{"WebServices Description"},(0x10282CAB),3,0,0,TYPE=SA +[0x101F7961],0,0,0,{"Series60ProductID"} + +; Non-localised vendor name +:"Nokia Corporation" + +; Localised vendor names +%{"Nokia Corporation"} + +; Files to install and to where +"\Epoc32\Release\armv5\urel\SenServDescBCTest.dll"-"!:\sys\bin\SenServDescBCTest.dll" +"\Epoc32\winscw\c\testSD_c.bat"-"!:\testSD.bat" +"\Epoc32\winscw\c\testframework\testframework_senservdesc.ini"-"!:\testframework\testframework_senservdesc.ini" diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_description_api/tsrc/bc/senservdesc/sis/52_websrv_wsdescription.sis Binary file websrv_pub/web_service_description_api/tsrc/bc/senservdesc/sis/52_websrv_wsdescription.sis has changed diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_description_api/tsrc/bc/senservdesc/sis/TestSD_c.bat --- a/websrv_pub/web_service_description_api/tsrc/bc/senservdesc/sis/TestSD_c.bat Fri Jun 11 14:42:58 2010 +0300 +++ b/websrv_pub/web_service_description_api/tsrc/bc/senservdesc/sis/TestSD_c.bat Tue Jul 06 15:29:11 2010 +0300 @@ -19,5 +19,5 @@ md e:\BCTest\Results ATSINTERFACE.EXE -testmodule SenServDescBCTest -copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_WSDescription.txt +copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\WebSrv_WSDescription.txt diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_description_api/tsrc/bc/senservdesc/sis/TestSD_z.bat --- a/websrv_pub/web_service_description_api/tsrc/bc/senservdesc/sis/TestSD_z.bat Fri Jun 11 14:42:58 2010 +0300 +++ b/websrv_pub/web_service_description_api/tsrc/bc/senservdesc/sis/TestSD_z.bat Tue Jul 06 15:29:11 2010 +0300 @@ -19,5 +19,5 @@ md e:\BCTest\Results ATSINTERFACE.EXE -testmodule SenServDescBCTest -copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_WSDescription.txt +copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\WebSrv_WSDescription.txt diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_description_api/tsrc/senservdescTester/group/senservdescTester.mmp --- a/websrv_pub/web_service_description_api/tsrc/senservdescTester/group/senservdescTester.mmp Fri Jun 11 14:42:58 2010 +0300 +++ b/websrv_pub/web_service_description_api/tsrc/senservdescTester/group/senservdescTester.mmp Tue Jul 06 15:29:11 2010 +0300 @@ -37,7 +37,6 @@ //TARGETPATH ?target_path DEFFILE senservdescTester.def -SYSTEMINCLUDE /epoc32/include MW_LAYER_SYSTEMINCLUDE //SYSTEMINCLUDE #ifdef SBSV2 USERINCLUDE ../inc diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/sis/50_ASP_WSManager.SIS Binary file websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/sis/50_ASP_WSManager.SIS has changed diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/sis/50_ASP_WSManager.pkg --- a/websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/sis/50_ASP_WSManager.pkg Fri Jun 11 14:42:58 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; -&EN - -; Installation header -; Only one component name as we only support English -; UID is the main app's UID - -#{"WebServices Manager"},(0x10282CAC),3,0,0,TYPE=SA -[0x101F7961],0,0,0,{"Series60ProductID"} - -; Non-localised vendor name -:"Nokia Corporation" - -; Localised vendor names -%{"Nokia Corporation"} - -; Files to install and to where -"\Epoc32\Release\armv5\urel\SenServiceManagerBCTest.dll"-"!:\sys\bin\SenServiceManagerBCTest.dll" -"\Epoc32\winscw\c\testSM_c.bat"-"!:\testSM.bat" -"\Epoc32\winscw\c\testframework\testframework_senservicemanager.ini"-"!:\testframework\testframework_senservicemanager.ini" diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/sis/52_websrv_wsmanager.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/sis/52_websrv_wsmanager.pkg Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,36 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: +; +; Languages +; none - English only by default +&EN + +; Installation header +; Only one component name as we only support English +; UID is the main app's UID + +#{"WebServices Manager"},(0x10282CAC),3,0,0,TYPE=SA +[0x101F7961],0,0,0,{"Series60ProductID"} + +; Non-localised vendor name +:"Nokia Corporation" + +; Localised vendor names +%{"Nokia Corporation"} + +; Files to install and to where +"\Epoc32\Release\armv5\urel\SenServiceManagerBCTest.dll"-"!:\sys\bin\SenServiceManagerBCTest.dll" +"\Epoc32\winscw\c\testSM_c.bat"-"!:\testSM.bat" +"\Epoc32\winscw\c\testframework\testframework_senservicemanager.ini"-"!:\testframework\testframework_senservicemanager.ini" diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/sis/52_websrv_wsmanager.sis Binary file websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/sis/52_websrv_wsmanager.sis has changed diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/sis/TestSM_c.bat --- a/websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/sis/TestSM_c.bat Fri Jun 11 14:42:58 2010 +0300 +++ b/websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/sis/TestSM_c.bat Tue Jul 06 15:29:11 2010 +0300 @@ -19,4 +19,4 @@ md e:\BCTest\Results ATSINTERFACE.EXE -testmodule SenServiceManagerBCTest -copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_WSManager.txt +copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\WebSrv_WSManager.txt diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/sis/TestSM_z.bat --- a/websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/sis/TestSM_z.bat Fri Jun 11 14:42:58 2010 +0300 +++ b/websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/sis/TestSM_z.bat Tue Jul 06 15:29:11 2010 +0300 @@ -20,4 +20,4 @@ md e:\BCTest\Results ATSINTERFACE.EXE -testmodule SenServiceManagerBCTest -copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_WSManager.txt +copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\WebSrv_WSManager.txt diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_manager_api/tsrc/senservicemanagerTester/group/senservicemanagerTester.mmp --- a/websrv_pub/web_service_manager_api/tsrc/senservicemanagerTester/group/senservicemanagerTester.mmp Fri Jun 11 14:42:58 2010 +0300 +++ b/websrv_pub/web_service_manager_api/tsrc/senservicemanagerTester/group/senservicemanagerTester.mmp Tue Jul 06 15:29:11 2010 +0300 @@ -56,7 +56,6 @@ SOURCEPATH ../src #endif // SBSV2 -SYSTEMINCLUDE /epoc32/include MW_LAYER_SYSTEMINCLUDE //SYSTEMINCLUDE SYSTEMINCLUDE /epoc32/include/libc diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/group/testnsc_c.bat --- a/websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/group/testnsc_c.bat Fri Jun 11 14:42:58 2010 +0300 +++ b/websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/group/testnsc_c.bat Tue Jul 06 15:29:11 2010 +0300 @@ -20,4 +20,4 @@ ATSINTERFACE.EXE -testmodule NewSoapClassesBCTest -copy C:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_NewSoapClasses.txt \ No newline at end of file +copy C:\Logs\TestFramework\TestReport.txt e:\BCTest\results\WebSrv_NewSoapClasses.txt \ No newline at end of file diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/group/testnsc_z.bat --- a/websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/group/testnsc_z.bat Fri Jun 11 14:42:58 2010 +0300 +++ b/websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/group/testnsc_z.bat Tue Jul 06 15:29:11 2010 +0300 @@ -21,4 +21,4 @@ ATSINTERFACE.EXE -testmodule NewSoapClassesBCTest -copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\ASP_NewSoapClasses.txt \ No newline at end of file +copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\WebSrv_NewSoapClasses.txt \ No newline at end of file diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/sis/50_asp_newsoapclasses.pkg --- a/websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/sis/50_asp_newsoapclasses.pkg Fri Jun 11 14:42:58 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; -&EN - -; Installation header -; Only one component name as we only support English -; UID is the main app's UID - -#{"WebServices SoapClasses"},(0x20015A26),3,0,0,TYPE=SA -[0x101F7961],0,0,0,{"Series60ProductID"} - -; Non-localised vendor name -:"Nokia Corporation" - -; Localised vendor names -%{"Nokia Corporation"} - -; Files to install and to where -"\Epoc32\Release\armv5\urel\NewSoapClassesBCTest.dll"-"!:\sys\bin\NewSoapClassesBCTest.dll" -"\Epoc32\winscw\c\testNSC_c.bat"-"!:\testNSC.bat" -"\Epoc32\winscw\c\testframework\testframework_newsoapclasses.ini"-"!:\testframework\testframework_newsoapclasses.ini" \ No newline at end of file diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/sis/50_asp_newsoapclasses.sis Binary file websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/sis/50_asp_newsoapclasses.sis has changed diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/sis/52_websrv_newsoapclasses.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/sis/52_websrv_newsoapclasses.pkg Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,36 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: +; +; Languages +; none - English only by default +&EN + +; Installation header +; Only one component name as we only support English +; UID is the main app's UID + +#{"WebServices SoapClasses"},(0x20015A26),3,0,0,TYPE=SA +[0x101F7961],0,0,0,{"Series60ProductID"} + +; Non-localised vendor name +:"Nokia Corporation" + +; Localised vendor names +%{"Nokia Corporation"} + +; Files to install and to where +"\Epoc32\Release\armv5\urel\NewSoapClassesBCTest.dll"-"!:\sys\bin\NewSoapClassesBCTest.dll" +"\Epoc32\winscw\c\testNSC_c.bat"-"!:\testNSC.bat" +"\Epoc32\winscw\c\testframework\testframework_newsoapclasses.ini"-"!:\testframework\testframework_newsoapclasses.ini" \ No newline at end of file diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/sis/52_websrv_newsoapclasses.sis Binary file websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/sis/52_websrv_newsoapclasses.sis has changed diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/web_service_messaging_api/tsrc/newsoapclassesTester/group/newsoapclassesTester.mmp --- a/websrv_pub/web_service_messaging_api/tsrc/newsoapclassesTester/group/newsoapclassesTester.mmp Fri Jun 11 14:42:58 2010 +0300 +++ b/websrv_pub/web_service_messaging_api/tsrc/newsoapclassesTester/group/newsoapclassesTester.mmp Tue Jul 06 15:29:11 2010 +0300 @@ -35,7 +35,6 @@ //TARGETPATH ?target_path DEFFILE newsoapclassesTester.def -SYSTEMINCLUDE /epoc32/include SYSTEMINCLUDE /epoc32/include/xml SYSTEMINCLUDE /epoc32/include/libc APP_LAYER_SYSTEMINCLUDE //SYSTEMINCLUDE diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/group/WSTester.mmp --- a/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/group/WSTester.mmp Fri Jun 11 14:42:58 2010 +0300 +++ b/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/group/WSTester.mmp Tue Jul 06 15:29:11 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: ?Description +* Description: Project specification file for wstester * */ @@ -27,7 +27,7 @@ #if defined(EKA2) CAPABILITY ALL -TCB /* Remove comments and replace 0x00000000 with correct vendor id */ -// VENDORID 0x00000000 +VENDORID VID_DEFAULT #endif //TARGETPATH ?target_path @@ -56,7 +56,7 @@ LIBRARY SenUtils.lib LIBRARY efsrv.lib -LIBRARY imut.lib // base64 enc/dec +LIBRARY inetprotutil.lib // for base64 encoding LIBRARY estor.lib LIBRARY XMLFRAMEWORK.lib LIBRARY bafl.lib diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/inc/WSTester.h --- a/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/inc/WSTester.h Fri Jun 11 14:42:58 2010 +0300 +++ b/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/inc/WSTester.h Tue Jul 06 15:29:11 2010 +0300 @@ -24,8 +24,8 @@ #include #include #include -#include -#include // for base64 codec +#include +#include #include //Sen @@ -484,7 +484,7 @@ //logging CStifLogger* iLog; //For decrypting data.... - TImCodecB64 iBase64Codec; + TBase64 iBase64Codec; RFs iFsSession; TInt iRunCase; TInt iStarted; diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/sis/51_WebSrv_WSXML.pkg --- a/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/sis/51_WebSrv_WSXML.pkg Fri Jun 11 14:42:58 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; -; Languages -; none - English only by default -&EN - -; Installation header -; Only one component name as we only support English -; UID is the main app's UID - -#{"WebServices XMLExtensions"},(0x10282C8A),1,0,0,TYPE=SA -[0x101F7961],3,*,*,{"Series60ProductID"} - -; Non-localised vendor name -:"Nokia Corporation" - -; Localised vendor names -%{"Nokia Corporation"} - -; Files to install and to where -"\Epoc32\Release\armv5\urel\wstester.dll"-"!:\sys\bin\wstester.dll" -"\Epoc32\winscw\c\TestInit.bat"-"!:\TestInit.bat" diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/sis/51_WebSrv_WSXML.sis Binary file websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/sis/51_WebSrv_WSXML.sis has changed diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/sis/52_websrv_wsxml.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/sis/52_websrv_wsxml.pkg Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,35 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: +; +; Languages +; none - English only by default +&EN + +; Installation header +; Only one component name as we only support English +; UID is the main app's UID + +#{"WebServices XMLExtensions"},(0x10282C8A),1,0,0,TYPE=SA +[0x101F7961],3,*,*,{"Series60ProductID"} + +; Non-localised vendor name +:"Nokia Corporation" + +; Localised vendor names +%{"Nokia Corporation"} + +; Files to install and to where +"\Epoc32\Release\armv5\urel\wstester.dll"-"!:\sys\bin\wstester.dll" +"\Epoc32\winscw\c\TestInit.bat"-"!:\TestInit.bat" diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/sis/52_websrv_wsxml.sis Binary file websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/sis/52_websrv_wsxml.sis has changed diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/src/WSTester.cpp --- a/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/src/WSTester.cpp Fri Jun 11 14:42:58 2010 +0300 +++ b/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/src/WSTester.cpp Tue Jul 06 15:29:11 2010 +0300 @@ -92,7 +92,8 @@ // void CWSTester::ConstructL() { - //__UHEAP_MARK; + // __UHEAP_MARK; + TestModuleIf().SetBehavior(CTestModuleIf::ETestLeaksHandles); iLog = CStifLogger::NewL( KWSTesterLogPath, KWSTesterLogFile, CStifLogger::ETxt, diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/src/WSTesterBlocks.cpp --- a/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/src/WSTesterBlocks.cpp Fri Jun 11 14:42:58 2010 +0300 +++ b/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/src/WSTesterBlocks.cpp Tue Jul 06 15:29:11 2010 +0300 @@ -248,6 +248,11 @@ { // Test case not passed iLog->Log(_L("Registering identity provider 1 failed. Error: %d"), error ); + if(error == -30321) + { + iWriter.WriteL(_L8("Registering identity provider 1 failed. End-user denies permission.")); + iWriter.CommitL(); + } return error; } return KErrNone; @@ -279,6 +284,11 @@ if (error != KErrNone ) { iLog->Log(_L("Registering Service Description failed. Error: %d"), error ); + if(error == -30321) + { + iWriter.WriteL(_L8("Registering Service Description failed.End-user denies permission")); + iWriter.CommitL(); + } return error; } return KErrNone; @@ -464,7 +474,7 @@ TInt retVal = iSenServiceConnection->StartTransaction(); - iLog->Log(_L("### _S_StartTransaction -> ended###")); + iLog->Log(_L("### _S_StartTransaction -> ended: %d"), retVal); return retVal; } @@ -474,7 +484,7 @@ TInt retVal = iSenServiceConnection->TransactionCompleted(); - iLog->Log(_L("### _S_TransactionCompleted -> ended###")); + iLog->Log(_L("### _S_TransactionCompleted -> ended: %d"), retVal); return retVal; } @@ -2733,6 +2743,7 @@ { iLog->Log(_L("******* SetStatus -> Started! ********")); + iLog->Log(_L("Status: %d"), aStatus); switch( aStatus ) { @@ -3267,7 +3278,6 @@ HBufC8* pResult8 = HBufC8::NewLC( source8.Length() ); TPtr8 result8 = pResult8->Des(); - iBase64Codec.Initialise(); iBase64Codec.Decode(source8 , result8); aMessage = result8; CleanupStack::Pop(); // pResult8 diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_extensions_api/tsrc/senxmlTester/group/senxmlTester.mmp --- a/websrv_pub/xml_extensions_api/tsrc/senxmlTester/group/senxmlTester.mmp Fri Jun 11 14:42:58 2010 +0300 +++ b/websrv_pub/xml_extensions_api/tsrc/senxmlTester/group/senxmlTester.mmp Tue Jul 06 15:29:11 2010 +0300 @@ -61,7 +61,6 @@ //RESOURCE resource_file //RESOURCE resource_file2 -SYSTEMINCLUDE /epoc32/include SYSTEMINCLUDE /epoc32/include/libc MW_LAYER_SYSTEMINCLUDE //SYSTEMINCLUDE LIBRARY bafl.lib diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_fragment_api/tsrc/bc/senfragment/bwins/senfragmentbctestu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/xml_fragment_api/tsrc/bc/senfragment/bwins/senfragmentbctestu.def Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,8 @@ +EXPORTS + ?LibEntryL@@YAPAVCTestModuleBase@@XZ @ 1 NONAME ; class CTestModuleBase * LibEntryL(void) + ?SetRequirements@@YAHAAPAVCTestModuleParam@@AAK@Z @ 2 NONAME ; int SetRequirements(class CTestModuleParam * &, unsigned long &) + ?ContentOf@CTestDomFragmentBase@@QAE?AVTPtrC8@@ABVTDesC8@@@Z @ 3 NONAME ; class TPtrC8 CTestDomFragmentBase::ContentOf(class TDesC8 const &) + ?SetContentOfL@CTestDomFragmentBase@@QAE?AVTXmlEngElement@@ABVTDesC8@@0@Z @ 4 NONAME ; class TXmlEngElement CTestDomFragmentBase::SetContentOfL(class TDesC8 const &, class TDesC8 const &) + ?SetContentL@CTestFragmentBase@@UAEXABVTDesC8@@@Z @ 5 NONAME ; void CTestFragmentBase::SetContentL(class TDesC8 const &) + ?AddContentL@CTestFragmentBase@@UAEXABVTDesC8@@@Z @ 6 NONAME ; void CTestFragmentBase::AddContentL(class TDesC8 const &) + diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_fragment_api/tsrc/bc/senfragment/eabi/SenFragmentBCTestu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/xml_fragment_api/tsrc/bc/senfragment/eabi/SenFragmentBCTestu.def Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,18 @@ +EXPORTS + _Z9LibEntryLv @ 1 NONAME + _Z15SetRequirementsRP16CTestModuleParamRm @ 2 NONAME + _ZN17CTestFragmentBase11AddContentLERK6TDesC8 @ 3 NONAME + _ZN17CTestFragmentBase11SetContentLERK6TDesC8 @ 4 NONAME + _ZN20CTestDomFragmentBase13SetContentOfLERK6TDesC8S2_ @ 5 NONAME + _ZN20CTestDomFragmentBase9ContentOfERK6TDesC8 @ 6 NONAME + _ZTI13CMainFragment @ 7 NONAME ; ## + _ZTI16CMainDomFragment @ 8 NONAME ; ## + _ZTI17CDelegateFragment @ 9 NONAME ; ## + _ZTI17CTestFragmentBase @ 10 NONAME ; ## + _ZTI20CDelegateDomFragment @ 11 NONAME ; ## + _ZTV13CMainFragment @ 12 NONAME ; ## + _ZTV16CMainDomFragment @ 13 NONAME ; ## + _ZTV17CDelegateFragment @ 14 NONAME ; ## + _ZTV17CTestFragmentBase @ 15 NONAME ; ## + _ZTV20CDelegateDomFragment @ 16 NONAME ; ## + diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_fragment_api/tsrc/bc/senfragment/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/xml_fragment_api/tsrc/bc/senfragment/group/bld.inf Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for senfragment +* +*/ + + + + + + + + + + + +PRJ_PLATFORMS +// specify the platforms your component needs to be built for here +// defaults to WINS MARM so you can ignore this if you just build these +DEFAULT + +PRJ_TESTEXPORTS +// NOTE: If using ARS requirements all export operations should be done under this. +// 'abld test export' + +PRJ_EXPORTS +// Specify the source file followed by its destination here +// copy will be used to copy the source file to its destination +// If there's no destination then the source file will be copied +// to the same name in /epoc32/include + +testsf_c.bat /epoc32/winscw/c/TestSF_c.bat +testsf_z.bat /epoc32/winscw/c/TestSF_z.bat +testframework.ini /epoc32/winscw/c/testframework/testframework_senfragment.ini + +/* +/agnmodel/inc/AGMCOMON.H +*/ + +PRJ_TESTMMPFILES +// NOTE: If using ARS requirements .mmp file operation should be done under this. +// 'abld test build' + +PRJ_MMPFILES +// Specify the .mmp files required for building the important component +// releasables. +// +// Specify "tidy" if the component you need to build doesn't need to be +// released. Specify "ignore" if the MMP file exists but should be +// ignored. +// Example: +/* +/agnmodel/group/agnmodel.mmp +#if defined(MARM) +/agnmodel/group/agsvexe.mmp +#endif +*/ +senfragment.mmp + +// End of File \ No newline at end of file diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_fragment_api/tsrc/bc/senfragment/group/senfragment.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/xml_fragment_api/tsrc/bc/senfragment/group/senfragment.mmp Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project specification file for senfragment +* +*/ + + +#include + +TARGET SenFragmentBCTest.dll +TARGETTYPE dll +UID 0x1000008D 0x101FB3E7 + +#if defined(EKA2) +CAPABILITY ALL -TCB +/* Remove comments and replace 0x00000000 with correct vendor id */ +VENDORID VID_DEFAULT +/* Remove comments and replace 0x00000000 with correct secure id */ +// SECUREID 0x00000000 +#endif + +//TARGETPATH ?target_path +DEFFILE senfragmentbctest.def + +SOURCEPATH ../src +SOURCE senfragment.cpp +SOURCE senfragmentcases.cpp +SOURCE mainfragment.cpp +SOURCE delegatefragment.cpp +SOURCE maindomfragment.cpp +SOURCE delegatedomfragment.cpp +SOURCE TestFragment.cpp + + +//RESOURCE resource_file +//RESOURCE resource_file2 + +USERINCLUDE ../inc +USERINCLUDE ../../../../../../webservices/wsfragment/inc + +SYSTEMINCLUDE /epoc32/include/libc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY bafl.lib +LIBRARY charconv.lib +LIBRARY euser.lib +LIBRARY estor.lib +LIBRARY efsrv.lib +LIBRARY stiftestinterface.lib +LIBRARY SenFragment.lib +LIBRARY SenXml.lib +LIBRARY SenServDesc.lib +LIBRARY XMLFRAMEWORK.lib + +#if !defined( RD_SEN_BACKPORT_CHANGE_FOR_LIBXML2_UIDS_AND_WSSTAR_IMAGE_NAME_PREFIXES ) + //LIBRARY XmlEngine.lib + LIBRARY XmlEngineDOM.lib + //LIBRARY XmlEngineUtils.lib +#else + LIBRARY WsStarXmlEngine.lib + LIBRARY WsStarXmlEngineDOM.lib + LIBRARY WsStarXmlEngineUtils.lib +#endif + +LANG SC + +// AIF ?filename// End of File diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_fragment_api/tsrc/bc/senfragment/group/testframework.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/xml_fragment_api/tsrc/bc/senfragment/group/testframework.ini Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,178 @@ +# +# This is STIFTestFramework initialization file +# Comment lines start with '#'-character. +# See STIF TestFramework users guide.doc for instructions + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set following test engine settings: +# - Set Test Reporting mode. TestReportMode's possible values are: +# + 'Summary': Summary of the tested test cases. +# + 'Environment': Hardware and software info. +# + 'TestCases': Test case report. +# + 'FullReport': Set of all above ones. +# + Example 'TestReportMode= Summary TestCases' +# +# - CreateTestReport setting controls report creation mode +# + YES, Test report will created. +# + NO, No Test report. +# +# - File path indicates the base path of the test report. +# - File name indicates the name of the test report. +# +# - File format indicates the type of the test report. +# + TXT, Test report file will be txt type, for example 'TestReport.txt'. +# + HTML, Test report will be html type, for example 'TestReport.html'. +# +# - File output indicates output source of the test report. +# + FILE, Test report logging to file. +# + RDEBUG, Test report logging to using rdebug. +# +# - File Creation Mode indicates test report overwriting if file exist. +# + OVERWRITE, Overwrites if the Test report file exist. +# + APPEND, Continue logging after the old Test report information if +# report exist. +# - Sets a device reset module's dll name(Reboot). +# + If Nokia specific reset module is not available or it is not correct one +# StifHWResetStub module may use as a template for user specific reset +# module. + +[Engine_Defaults] + +TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', + 'TestCases' or 'FullReport' + +CreateTestReport= YES # Possible values: YES or NO + +TestReportFilePath= C:\LOGS\TestFramework\ +TestReportFileName= TestReport + +TestReportFormat= TXT # Possible values: TXT or HTML +TestReportOutput= FILE # Possible values: FILE or RDEBUG +TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting + +[End_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Module configurations start +# Modules are added between module tags +# tags. Module name is specified after ModuleName= tag, like +# ModuleName= XXXXXXXXX +# Modules might have initialisation file, specified as +# IniFile= c:\testframework\YYYYYY +# Modules might have several configuration files, like +# TestCaseFile= c:\testframework\NormalCases.txt +# TestCaseFile= c:\testframework\SmokeCases.txt +# TestCaseFile= c:\testframework\ManualCases.txt + +# (TestCaseFile is synonym for old term ConfigFile) + +# Following case specifies demo module settings. Demo module +# does not read any settings from file, so tags +# IniFile and TestCaseFile are not used. +# In the simplest case it is enough to specify only the +# name of the test module when adding new test module + +[New_Module] +ModuleName= SenFragmentBCTest +[End_Module] + + +# Load testmoduleXXX, optionally with initialization file and/or test case files +#[New_Module] +#ModuleName= testmodulexxx + +#TestModuleXXX used initialization file +#IniFile= c:\testframework\init.txt + +#TestModuleXXX used configuration file(s) +#TestCaseFile= c:\testframework\testcases1.cfg +#TestCaseFile= c:\testframework\testcases2.cfg +#TestCaseFile= c:\testframework\manualtestcases.cfg + +#[End_Module] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set STIFTestFramework logging overwrite parameters for Logger. +# Hardware and emulator environment logging path and styles can +# be configured from here to overwrite the Logger's implemented values. +# +# Settings description: +# - Indicates option for creation log directory/directories. If log directory/directories +# is/are not created by user they will make by software. +# + YES, Create log directory/directories if not allready exist. +# + NO, Log directory/directories not created. Only created one is used. +# +# - Overwrite emulator path setting. +# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined +# Logger's path 'D:\\LOGS\\Module\\' with those definition the path +# will be 'C:\LOGS\TestFramework\LOGS\Module\' +# +# - Overwrite emulator's logging format. +# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'. +# + HTML, Log file(s) will be html type(s), for example 'Module.html'. +# +# - Overwrited emulator logging output source. +# + FILE, Logging to file(s). +# + RDEBUG, Logging to using rdebug(s). +# +# - Overwrite hardware path setting (Same description as above in emulator path). +# - Overwrite hardware's logging format(Same description as above in emulator format). +# - Overwrite hardware's logging output source(Same description as above in emulator output). +# +# - File Creation Mode indicates file overwriting if file exist. +# + OVERWRITE, Overwrites if file(s) exist. +# + APPEND, Continue logging after the old logging information if file(s) exist. +# +# - Will thread id include to the log filename. +# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'. +# + NO, No thread id to log file(s), Example filename 'Module.txt'. +# +# - Will time stamps include the to log file. +# + YES, Time stamp added to each line in log file(s). Time stamp is +# for example'12.Nov.2003 115958 LOGGING INFO' +# + NO, No time stamp(s). +# +# - Will line breaks include to the log file. +# + YES, Each logging event includes line break and next log event is in own line. +# + NO, No line break(s). +# +# - Will event ranking include to the log file. +# + YES, Event ranking number added to each line in log file(s). Ranking number +# depends on environment's tics, for example(includes time stamp also) +# '012 12.Nov.2003 115958 LOGGING INFO' +# + NO, No event ranking. +# + +[Logger_Defaults] + +#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' + +#CreateLogDirectories= YES # Possible values: YES or NO + +#EmulatorBasePath= C:\LOGS\TestFramework\ +#EmulatorFormat= HTML # Possible values: TXT or HTML +#EmulatorOutput= FILE # Possible values: FILE or RDEBUG + +#HardwareBasePath= D:\LOGS\TestFramework\ +#HardwareFormat= HTML # Possible values: TXT or HTML +#HardwareOutput= FILE # Possible values: FILE or RDEBUG + +#FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +#ThreadIdToLogFile= YES # Possible values: YES or NO +#WithTimeStamp= YES # Possible values: YES or NO +#WithLineBreak= YES # Possible values: YES or NO +#WithEventRanking= YES # Possible values: YES or NO + +[End_Logger_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + +# End of file \ No newline at end of file diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_fragment_api/tsrc/bc/senfragment/group/testsf_c.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/xml_fragment_api/tsrc/bc/senfragment/group/testsf_c.bat Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,23 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +copy c:\TestFramework\TestFramework_senfragment.ini c:\TestFramework\TestFramework.ini +md e:\BCTest +md e:\BCTest\results + +ATSINTERFACE.EXE -testmodule SenFragmentBCTest + +copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\WebSrv_SenFragment.txt \ No newline at end of file diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_fragment_api/tsrc/bc/senfragment/group/testsf_z.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/xml_fragment_api/tsrc/bc/senfragment/group/testsf_z.bat Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,24 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +copy z:\TestFramework\TestFramework_senfragment.ini c:\TestFramework\TestFramework.ini + +md e:\BCTest +md e:\BCTest\results + +ATSINTERFACE.EXE -testmodule SenFragmentBCTest + +copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\WebSrv_SenFragment.txt \ No newline at end of file diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_fragment_api/tsrc/bc/senfragment/inc/TestFragment.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/xml_fragment_api/tsrc/bc/senfragment/inc/TestFragment.h Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: senfragment header declaration +* +*/ + + + + + + + + + +#ifndef TESTFRAGMENT_H +#define TESTFRAGMENT_H + +#include +#include +#include "SenFragmentBase.h" +#include "SenDomFragmentBase.h" + + + +class CTestFragmentBase :public CSenFragmentBase +{ +public: + static CTestFragmentBase* NewL(const TDesC8& aLocalName); + IMPORT_C void SetContentL(const TDesC8& aContent); + IMPORT_C void AddContentL(const TDesC8& aContent); +}; + + + +class CTestDomFragmentBase :public CSenDomFragmentBase +{ +public: + static CTestDomFragmentBase* NewL(const TDesC8& aLocalName); + IMPORT_C TXmlEngElement SetContentOfL(const TDesC8& aLocalName, + const TDesC8& aContent); + IMPORT_C TPtrC8 ContentOf(const TDesC8& aLocalName); + +}; + + +#endif \ No newline at end of file diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_fragment_api/tsrc/bc/senfragment/inc/delegatedomfragment.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/xml_fragment_api/tsrc/bc/senfragment/inc/delegatedomfragment.h Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: domfragment header declaration +* +*/ + + + + + + + + +#ifndef DELEGATE_DOM_FRAGMENT_H +#define DELEGATE_DOM_FRAGMENT_H + +// INCLUDES +#include "SenDomFragmentBase.h" + +class CDelegateDomFragment : public CSenDomFragmentBase + { + public: // Constructors and destructor + + static CDelegateDomFragment* NewL(const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName, + const RAttributeArray& aAttributes); + + static CDelegateDomFragment* NewLC(const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName, + const RAttributeArray& aAttributes); + + static CDelegateDomFragment* NewL(const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName, + const RAttributeArray& aAttributes, + TXmlEngElement& aParent); + + static CDelegateDomFragment* NewLC(const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName, + const RAttributeArray& aAttributes, + TXmlEngElement& aParent); + + static CDelegateDomFragment* NewL(const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName, + const RAttributeArray& aAttrs, + TXmlEngElement& aParent, + RSenDocument& aOwnerDocument); + + static CDelegateDomFragment* NewLC(const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName, + const RAttributeArray& aAttrs, + TXmlEngElement& aParent, + RSenDocument& aOwnerDocument); + /** + * Destructor. + */ + virtual ~CDelegateDomFragment(); + + private: + + /** + * C++ default constructor. + */ + CDelegateDomFragment(); + }; + +#endif // DELEGATE_DOM_FRAGMENT_H + +// End of File + + diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_fragment_api/tsrc/bc/senfragment/inc/delegatefragment.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/xml_fragment_api/tsrc/bc/senfragment/inc/delegatefragment.h Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: senfragment header declaration +* +*/ + + + + + + + + +#ifndef DELEGATE_FRAGMENT_H +#define DELEGATE_FRAGMENT_H + +// INCLUDES +#include "SenFragmentBase.h" + +class CDelegateFragment : public CSenFragmentBase + { + public: // Constructors and destructor + + static CDelegateFragment* NewL(const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName, + const RAttributeArray& aAttributes); + + static CDelegateFragment* NewLC(const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName, + const RAttributeArray& aAttributes); + + static CDelegateFragment* NewL(const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName, + const RAttributeArray& aAttributes, + TXmlEngElement& aParent); + + static CDelegateFragment* NewLC(const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName, + const RAttributeArray& aAttributes, + TXmlEngElement& aParent); + + /** + * Destructor. + */ + virtual ~CDelegateFragment(); + + private: + + /** + * C++ default constructor. + */ + CDelegateFragment(); + }; + +#endif // DELEGATE_FRAGMENT_H + +// End of File + + diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_fragment_api/tsrc/bc/senfragment/inc/maindomfragment.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/xml_fragment_api/tsrc/bc/senfragment/inc/maindomfragment.h Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: senfragment header declaration +* +*/ + + + + + + + + +#ifndef MAIN_DOM_FRAGMENT_H +#define MAIN_DOM_FRAGMENT_H + +// INCLUDES +#include "SenDomFragmentBase.h" +#include "delegatedomfragment.h" + +// CLASS DECLARATIONS +class CMainDomFragment : public CSenDomFragmentBase + { + public: // Constructors and destructor + + static CMainDomFragment* NewL(); + static CMainDomFragment* NewLC(); + static CMainDomFragment* NewL(const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName); + static CMainDomFragment* NewLC(const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName); + virtual ~CMainDomFragment(); + + CDelegateDomFragment& DelegateFragment(); + + protected: + + /** + * C++ default constructor. + */ + CMainDomFragment(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void BaseConstructL(); + void BaseConstructL(const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName); + + virtual void OnStartElementL(const RTagInfo& aElement, + const RAttributeArray& aAttributes, + TInt aErrorCode); + + virtual void OnEndElementL(const RTagInfo& aElement, + TInt aErrorCode); + + virtual void OnResumeParsingFromL(const RTagInfo& aElement, TInt aErrorCode); + private: // Data + CDelegateDomFragment* ipDelegateFragment; // Owned + }; + +#endif // MAIN_DOM_FRAGMENT_H + +// End of File + + diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_fragment_api/tsrc/bc/senfragment/inc/mainfragment.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/xml_fragment_api/tsrc/bc/senfragment/inc/mainfragment.h Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: senfragment header declaration +* +*/ + + + + + + + + +#ifndef MAIN_FRAGMENT_H +#define MAIN_FRAGMENT_H + +// INCLUDES +#include "SenFragmentBase.h" +#include "delegatefragment.h" + +// CLASS DECLARATIONS +class CMainFragment : public CSenFragmentBase + { + public: // Constructors and destructor + + static CMainFragment* NewL(); + static CMainFragment* NewLC(); + static CMainFragment* NewL(const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName); + static CMainFragment* NewLC(const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName); + virtual ~CMainFragment(); + + CDelegateFragment& DelegateFragment(); + + protected: + + /** + * C++ default constructor. + */ + CMainFragment(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void BaseConstructL(); + void BaseConstructL(const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName); + + // Functions from base classes + + // From CSenBaseFragment + virtual void OnStartElementL(const RTagInfo& aElement, + const RAttributeArray& aAttributes, + TInt aErrorCode); + + virtual void OnEndElementL(const RTagInfo& aElement, + TInt aErrorCode); + + private: // Data + CDelegateFragment* ipDelegateFragment; // Owned + }; + +#endif // MAIN_FRAGMENT_H + +// End of File + diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_fragment_api/tsrc/bc/senfragment/inc/senfragmentbctest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/xml_fragment_api/tsrc/bc/senfragment/inc/senfragmentbctest.h Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,612 @@ +/* +* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: SenFragment test module. +* +*/ + + + + + + + + + + + +#ifndef SENFRAGMENT_H +#define SENFRAGMENT_H + +// INCLUDES +#include +#include +#include "TestFragment.h" + +#include +#include +#include +#include +//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include +//#include +#include +#include +//#include +//#include + +#include // for TParserFeature enumeration +//#include // needed for TSerializationOptions +//#include +#include + +// INCLUDES +#include "SenFragmentBase.h" +#include "delegatefragment.h" + + + +// FORWARD DECLARATIONS +class CSenBaseAttribute; +class CSenBaseFragment; +class CSenSoapMessage; +class CSenIdentityProvider; +class CSenGuidGen; +class CSenDomFragment; +class CSenSoapFault; +class CSenXmlServiceDescription; +class CSenSoapEnvelope; +class CSenWsSecurityHeader; +class SenXmlFragment; +class CSenBaseElement; +class MSenElement; +class CSenXmlReader; +class SenDateFragment; +class CSenNamespace; +class CSenParser; +class CSenDomFragmentBase; +class RSenDocument; +class CSenFragmentBase; +class CTestFragmentBase; +class CTestDomFragmentBase; + +// MACROS +//#define ?macro ?macro_def +#define TEST_MODULE_VERSION_MAJOR 50 +#define TEST_MODULE_VERSION_MINOR 8 +#define TEST_MODULE_VERSION_BUILD 48 + +// Logging path +_LIT( KSenFragmentLogPath, "\\logs\\testframework\\SenFragmentBCTest\\" ); +// Log file +_LIT( KSenFragmentLogFile, "SenFragmentBCTest.txt" ); + +// Function pointer related internal definitions +// Visual studio 6.0 (__VC32__) needs different type of handling +#ifdef __VC32__ +#define GETPTR +#else +#define GETPTR & +#endif +#define ENTRY(str,func) {_S(str), GETPTR func,0,0,0} +#define FUNCENTRY(func) {_S(#func), GETPTR func,0,0,0} +#define OOM_ENTRY(str,func,a,b,c) {_S(str), GETPTR func,a,b,c} +#define OOM_FUNCENTRY(func,a,b,c) {_S(#func), GETPTR func,a,b,c} + +// FUNCTION PROTOTYPES +//?type ?function_name(?arg_list); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; +class CSenFragmentBCTest; + +// DATA TYPES +//enum ?declaration +//typedef ?declaration +//extern ?data_type; +// A typedef for function that does the actual testing, +// function is a type +// TInt CSenFragmentBCTest:: ( TTestResult& aResult ) +typedef TInt (CSenFragmentBCTest::* TestFunction)(TTestResult&); + +// CLASS DECLARATION + +/** +* An internal structure containing a test case name and +* the pointer to function doing the test +* +* @lib ?library +* @since ?Series60_version +*/ +class TCaseInfoInternal + { + public: + const TText* iCaseName; + TestFunction iMethod; + TBool iIsOOMTest; + TInt iFirstMemoryAllocation; + TInt iLastMemoryAllocation; + }; + +// CLASS DECLARATION + +/** +* A structure containing a test case name and +* the pointer to function doing the test +* +* @lib ?library +* @since ?Series60_version +*/ +class TCaseInfo + { + public: + TPtrC iCaseName; + TestFunction iMethod; + TBool iIsOOMTest; + TInt iFirstMemoryAllocation; + TInt iLastMemoryAllocation; + + TCaseInfo( const TText* a ) : iCaseName( (TText*) a ) + { + }; + + }; + + +// CLASS DECLARATION + +/** +* This a SenFragment class. +* ?other_description_lines +* +* @lib ?library +* @since ?Series60_version +*/ +NONSHARABLE_CLASS(CSenFragmentBCTest) : public CTestModuleBase + { + public: // Constructors and destructor + + + /** + * Two-phased constructor. + */ + static CSenFragmentBCTest* NewL(); + + /** + * Destructor. + */ + virtual ~CSenFragmentBCTest(); + + public: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + public: // Functions from base classes + + /** + * From CTestModuleBase InitL is used to initialize the + * SenFragment. It is called once for every instance of + * TestModuleSenFragment after its creation. + * @since ?Series60_version + * @param aIniFile Initialization file for the test module (optional) + * @param aFirstTime Flag is true when InitL is executed for first + * created instance of SenFragment. + * @return Symbian OS error code + */ + TInt InitL( TFileName& aIniFile, TBool aFirstTime ); + + /** + * From CTestModuleBase GetTestCasesL is used to inquiry test cases + * from SenFragment. + * @since ?Series60_version + * @param aTestCaseFile Test case file (optional) + * @param aTestCases Array of TestCases returned to test framework + * @return Symbian OS error code + */ + TInt GetTestCasesL( const TFileName& aTestCaseFile, + RPointerArray& aTestCases ); + + /** + * From CTestModuleBase RunTestCaseL is used to run an individual + * test case. + * @since ?Series60_version + * @param aCaseNumber Test case number + * @param aTestCaseFile Test case file (optional) + * @param aResult Test case result returned to test framework (PASS/FAIL) + * @return Symbian OS error code (test case execution error, which is + * not reported in aResult parameter as test case failure). + */ + TInt RunTestCaseL( const TInt aCaseNumber, + const TFileName& aTestCaseFile, + TTestResult& aResult ); + + /** + * From CTestModuleBase; OOMTestQueryL is used to specify is particular + * test case going to be executed using OOM conditions + * @param aTestCaseFile Test case file (optional) + * @param aCaseNumber Test case number (optional) + * @param aFailureType OOM failure type (optional) + * @param aFirstMemFailure The first heap memory allocation failure value (optional) + * @param aLastMemFailure The last heap memory allocation failure value (optional) + * @return TBool + */ + virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */, + const TInt /* aCaseNumber */, + TOOMFailureType& aFailureType, + TInt& /* aFirstMemFailure */, + TInt& /* aLastMemFailure */ ); + + /** + * From CTestModuleBase; OOMTestInitializeL may be used to initialize OOM + * test environment + * @param aTestCaseFile Test case file (optional) + * @param aCaseNumber Test case number (optional) + * @return None + */ + virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */, + const TInt /* aCaseNumber */ ); + + /** + * From CTestModuleBase; OOMHandleWarningL + * @param aTestCaseFile Test case file (optional) + * @param aCaseNumber Test case number (optional) + * @param aFailNextValue FailNextValue for OOM test execution (optional) + * @return None + * + * User may add implementation for OOM test warning handling. Usually no + * implementation is required. + */ + virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */, + const TInt /* aCaseNumber */, + TInt& /* aFailNextValue */); + + /** + * From CTestModuleBase; OOMTestFinalizeL may be used to finalize OOM + * test environment + * @param aTestCaseFile Test case file (optional) + * @param aCaseNumber Test case number (optional) + * @return None + * + */ + virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */, + const TInt /* aCaseNumber */ ); + /** + * Method used to log version of test module + */ + void SendTestModuleVersion(); + + private: + + /** + * C++ default constructor. + */ + CSenFragmentBCTest(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + // Prohibit copy constructor if not deriving from CBase. + // ?classname( const ?classname& ); + // Prohibit assigment operator if not deriving from CBase. + // ?classname& operator=( const ?classname& ); + + /** + * Function returning test case name and pointer to test case function. + * @since ?Series60_version + * @param aCaseNumber test case number + * @return TCaseInfo + */ + const TCaseInfo Case ( const TInt aCaseNumber ) const; + + void SetupL(); + void Teardown(); + + + /** + * Actual Hardcoded test case functions are listed below. + */ + TInt MT_CSenDomFragmentBase_NewLL(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_NewL_1L(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_NewL_2L(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_NewL_3L(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_NewL_4L(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_NewL_5L(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_NewL_6L(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_NewL_7L(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_AddAttributesLL(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_AsXmlLL(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_ContentLL(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_NamespaceL(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_ResetContentLL(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_LocalNameL(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_NsUriL(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_NsPrefixL(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_AsElementLL(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_AsDocumentLL(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_ExtractElementL(TTestResult& aResult); + + TInt MT_CSenDomFragmentBase_AsXmlUnicodeLL(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_WriteAsXMLToLL(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_ConsistsOfLL(TTestResult& aResult); + + + + + + TInt MT_CSenDomFragmentBase_Parsing1L(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_Parsing2L(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_Parsing3L(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_Parsing4L(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_Parsing5L(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_Parsing6L(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_Parsing7L(TTestResult& aResult); + + + TInt MT_CSenDomFragmentBase_Parsing8L(TTestResult& aResult); + + TInt MT_CSenDomFragmentBase_OnWriteStartElementLL(TTestResult& aResult); + + TInt MT_CSenDomFragmentBase_OnWriteEndElementLL(TTestResult& aResult); + + TInt MT_CSenDomFragmentBase_OnIgnorableWhiteSpaceLL(TTestResult& aResult); + + TInt MT_CSenDomFragmentBase_OnSkippedEntityLL(TTestResult& aResult); + + TInt MT_CSenDomFragmentBase_OnProcessingInstructionLL(TTestResult& aResult); + + TInt MT_CSenDomFragmentBase_OnErrorL(TTestResult& aResult); + + TInt MT_CSenDomFragmentBase_GetExtendedInterfaceL(TTestResult& aResult); + + + TInt MT_CSenFragmentBase_NewLL(TTestResult& aResult); + + + TInt MT_CSenFragmentBase_NewL_1L(TTestResult& aResult); + + + TInt MT_CSenFragmentBase_NewL_2L(TTestResult& aResult); + + + TInt MT_CSenFragmentBase_NewL_3L(TTestResult& aResult); + + + TInt MT_CSenFragmentBase_NewL_4L(TTestResult& aResult); + + + TInt MT_CSenFragmentBase_NewL_5L(TTestResult& aResult); + + + TInt MT_CSenFragmentBase_NewL_6L(TTestResult& aResult); + + + TInt MT_CSenFragmentBase_NewL_7L(TTestResult& aResult); + + TInt MT_CSenFragmentBase_SetDocumentL(TTestResult& aResult); + + + + TInt MT_CSenFragmentBase_ContentLL(TTestResult& aResult); + + + TInt MT_CSenFragmentBase_NamespaceL(TTestResult& aResult); + + + TInt MT_CSenFragmentBase_ResetContentLL(TTestResult& aResult); + + + TInt MT_CSenFragmentBase_LocalNameL(TTestResult& aResult); + + + TInt MT_CSenFragmentBase_NsUriL(TTestResult& aResult); + + + TInt MT_CSenFragmentBase_NsPrefixL(TTestResult& aResult); + + + TInt MT_CSenFragmentBase_AsElementLL(TTestResult& aResult); + + + TInt MT_CSenFragmentBase_AsDocumentLL(TTestResult& aResult); + + + TInt MT_CSenFragmentBase_ExtractElementL(TTestResult& aResult); + + + TInt MT_CSenFragmentBase_AsXmlUnicodeLL(TTestResult& aResult); + + + TInt MT_CSenFragmentBase_AsXmlLL(TTestResult& aResult); + + + TInt MT_CSenFragmentBase_WriteAsXMLToLL(TTestResult& aResult); + + + TInt MT_CSenFragmentBase_ConsistsOfLL(TTestResult& aResult); + + + TInt MT_CSenFragmentBase_Parsing1L(TTestResult& aResult); + + + TInt MT_CSenFragmentBase_Parsing2L(TTestResult& aResult); + + + TInt MT_CSenFragmentBase_Parsing3L(TTestResult& aResult); + + + TInt MT_CSenFragmentBase_Parsing4L(TTestResult& aResult); + + + TInt MT_CSenFragmentBase_Parsing5L(TTestResult& aResult); + + + TInt MT_CSenParser_NewLL(TTestResult& aResult); + + + TInt MT_CSenParser_NewLCL(TTestResult& aResult); + + + TInt MT_CSenParser_NewL_1L(TTestResult& aResult); + + + TInt MT_CSenParser_NewLC_1L(TTestResult& aResult); + + + TInt MT_CSenParser_NewL_2L(TTestResult& aResult); + + + TInt MT_CSenParser_NewLC_2L(TTestResult& aResult); +/* +#if defined( __SERIES60_31__ ) || (!defined( __SERIES60_30__ ) && defined( SYMBIAN_SWI_POST_INSTALL_REVOCATION) ) + + TInt MT_CSenParser_NewL_3L(TTestResult& aResult); + TInt MT_CSenParser_NewLC_3L(TTestResult& aResult); + +#endif +*/ + + TInt MT_RSenDocument_NewLL(TTestResult& aResult); + + + TInt MT_RSenDocument_NewLCL(TTestResult& aResult); + + TInt MT_RSenDocument_NewL_1L(TTestResult& aResult); + + TInt MT_RSenDocument_NewLC_1L(TTestResult& aResult); + + TInt MT_RSenDocument_CopyL(TTestResult& aResult); + + TInt MT_RSenDocument_CloseL(TTestResult& aResult); + + TInt MT_RSenDocument_DestroyL(TTestResult& aResult); + + TInt MT_RSenDocument_ManualXmlEngineTlsAttachLL(TTestResult& aResult); + + TInt MT_RSenDocument_ManualXmlEngineTlsCleanupL(TTestResult& aResult); + + TInt MT_TestFragmentBase_SetContentLL(TTestResult& aResult); + + TInt MT_TestFragmentBase_AddContentLL(TTestResult& aResult); + + TInt MT_TestDomFragmentBase_SetContentOfLL(TTestResult& aResult); + + TInt MT_TestDomFragmentBase_ContentOfL(TTestResult& aResult); + + + + public: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + protected: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + private: // Data + // Pointer to test (function) to be executed + TestFunction iMethod; + + // Pointer to logger + CStifLogger * iLog; + + CSenXmlReader* iXmlReader; + // ?one_line_short_description_of_data + //?data_declaration; + + // Reserved pointer for future extension + //TAny* iReserved; + + public: // Friend classes + //?friend_class_declaration; + protected: // Friend classes + //?friend_class_declaration; + private: // Friend classes + //?friend_class_declaration; + + }; + +#endif // SENFragment_H + +// End of File \ No newline at end of file diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_fragment_api/tsrc/bc/senfragment/sis/52_websrv_senfragment.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/xml_fragment_api/tsrc/bc/senfragment/sis/52_websrv_senfragment.pkg Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,36 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: +; +; Languages +; none - English only by default +&EN + +; Installation header +; Only one component name as we only support English +; UID is the main app's UID + +#{"WebServices Fragment"},(0x20015A27),3,0,0,TYPE=SA +(0x101F7961),0,0,0,{"Series60ProductID"} + +; Non-localised vendor name +:"Nokia Corporation" + +; Localised vendor names +%{"Nokia Corporation"} + +; Files to install and to where +"\Epoc32\Release\armv5\urel\SenFragmentBCTest.dll"-"!:\sys\bin\SenFragmentBCTest.dll" +"\Epoc32\winscw\c\testSF_c.bat"-"!:\testSF.bat" +"\Epoc32\winscw\c\testframework\testframework_senfragment.ini"-"!:\testframework\testframework_senfragment.ini" \ No newline at end of file diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_fragment_api/tsrc/bc/senfragment/sis/52_websrv_senfragment.sis Binary file websrv_pub/xml_fragment_api/tsrc/bc/senfragment/sis/52_websrv_senfragment.sis has changed diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_fragment_api/tsrc/bc/senfragment/src/TestFragment.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/xml_fragment_api/tsrc/bc/senfragment/src/TestFragment.cpp Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + + + + + + + +#include +#include +#include "TestFragment.h" + + +//CSenFragmentBase// + +CTestFragmentBase* CTestFragmentBase::NewL(const TDesC8& aLocalName) +{ + return((CTestFragmentBase*)CSenFragmentBase::NewL(aLocalName)); +} + +EXPORT_C void CTestFragmentBase::SetContentL(const TDesC8& aContent) +{ + return(CSenFragmentBase::SetContentL(aContent)); +} + +EXPORT_C void CTestFragmentBase::AddContentL(const TDesC8& aContent) +{ + return(CSenFragmentBase::AddContentL(aContent)); +} + + +///CSenDomFragmentBase/// + +CTestDomFragmentBase* CTestDomFragmentBase::NewL(const TDesC8& aLocalName) +{ + return((CTestDomFragmentBase*)CSenDomFragmentBase::NewL(aLocalName)); +} + +EXPORT_C TXmlEngElement CTestDomFragmentBase::SetContentOfL(const TDesC8& aLocalName, + const TDesC8& aContent) +{ + return(CSenDomFragmentBase::SetContentOfL(aLocalName, aContent)); +} + + +EXPORT_C TPtrC8 CTestDomFragmentBase::ContentOf(const TDesC8& aLocalName) +{ + return(CSenDomFragmentBase::ContentOf(aLocalName)); +} + + + diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_fragment_api/tsrc/bc/senfragment/src/delegatedomfragment.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/xml_fragment_api/tsrc/bc/senfragment/src/delegatedomfragment.cpp Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,128 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + + + + + + +#include "delegatedomfragment.h" + +using namespace Xml; + +namespace + { + } + +CDelegateDomFragment* CDelegateDomFragment::NewL( + const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName, + const RAttributeArray& aAttributes + ) + { + CDelegateDomFragment* pNew = NewLC(aNsUri, aLocalName, aQName, aAttributes); + CleanupStack::Pop(); // pNew; + return pNew; + } + +CDelegateDomFragment* CDelegateDomFragment::NewLC( + const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName, + const RAttributeArray& aAttributes + ) + { + CDelegateDomFragment* pNew = new (ELeave) CDelegateDomFragment; + CleanupStack::PushL(pNew); + pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttributes); + return pNew; + } + +CDelegateDomFragment* CDelegateDomFragment::NewL( + const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName, + const RAttributeArray& aAttributes, + TXmlEngElement& aParent + ) + { + CDelegateDomFragment* pNew = NewLC(aNsUri, aLocalName, + aQName, aAttributes, aParent); + CleanupStack::Pop(); // pNew; + return pNew; + } + +CDelegateDomFragment* CDelegateDomFragment::NewLC( + const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName, + const RAttributeArray& aAttributes, + TXmlEngElement& aParent + ) + { + CDelegateDomFragment* pNew = new (ELeave) CDelegateDomFragment; + CleanupStack::PushL(pNew); + pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttributes, aParent); + return pNew; + } + +CDelegateDomFragment* CDelegateDomFragment::NewL( + const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName, + const RAttributeArray& aAttributes, + TXmlEngElement& aParent, + RSenDocument& aOwnerDocument + ) + { + CDelegateDomFragment* pNew = NewLC(aNsUri, aLocalName, + aQName, aAttributes, + aParent, aOwnerDocument); + CleanupStack::Pop(); // pNew; + return pNew; + } + +CDelegateDomFragment* CDelegateDomFragment::NewLC( + const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName, + const RAttributeArray& aAttributes, + TXmlEngElement& aParent, + RSenDocument& aOwnerDocument + ) + { + CDelegateDomFragment* pNew = new (ELeave) CDelegateDomFragment; + CleanupStack::PushL(pNew); + pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttributes, aParent, + aOwnerDocument); + return pNew; + } + + +CDelegateDomFragment::CDelegateDomFragment() + { + } + +CDelegateDomFragment::~CDelegateDomFragment() + { + } + +// END OF FILE + diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_fragment_api/tsrc/bc/senfragment/src/delegatefragment.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/xml_fragment_api/tsrc/bc/senfragment/src/delegatefragment.cpp Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + + + + + + +#include "delegatefragment.h" + +using namespace Xml; + +namespace + { + } + +CDelegateFragment* CDelegateFragment::NewL( + const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName, + const RAttributeArray& aAttributes + ) + { + CDelegateFragment* pNew = NewLC(aNsUri, aLocalName, aQName, aAttributes); + CleanupStack::Pop(); // pNew; + return pNew; + } + +CDelegateFragment* CDelegateFragment::NewLC( + const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName, + const RAttributeArray& aAttributes + ) + { + CDelegateFragment* pNew = new (ELeave) CDelegateFragment; + CleanupStack::PushL(pNew); + pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttributes); + return pNew; + } + +CDelegateFragment* CDelegateFragment::NewL( + const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName, + const RAttributeArray& aAttributes, + TXmlEngElement& aParent + ) + { + CDelegateFragment* pNew = NewLC(aNsUri, aLocalName, + aQName, aAttributes, aParent); + CleanupStack::Pop(); // pNew; + return pNew; + } + +CDelegateFragment* CDelegateFragment::NewLC( + const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName, + const RAttributeArray& aAttributes, + TXmlEngElement& aParent + ) + { + CDelegateFragment* pNew = new (ELeave) CDelegateFragment; + CleanupStack::PushL(pNew); + pNew->BaseConstructL(aNsUri, aLocalName, aQName, aAttributes, aParent); + return pNew; + } + +CDelegateFragment::CDelegateFragment() + { + } + +CDelegateFragment::~CDelegateFragment() + { + } + +// End of File + + diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_fragment_api/tsrc/bc/senfragment/src/maindomfragment.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/xml_fragment_api/tsrc/bc/senfragment/src/maindomfragment.cpp Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,191 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + + + + + + +#include "maindomfragment.h" +#include "SenFragmentBase.h" + +namespace + { + const TInt KStateParsingDelegate = 100; + _LIT8(KMainFragmentXmlns, "urn:main:fragment"); + _LIT8(KMainFragmentName, "MainFragment"); + _LIT8(KMainFragmentQName, "mn:MainFragment"); + _LIT8(KDelegateName, "DelegateFragment"); + } + +CMainDomFragment* CMainDomFragment::NewL() + { + CMainDomFragment* pNew = NewLC(); + CleanupStack::Pop(); // pNew; + return pNew; + } + +CMainDomFragment* CMainDomFragment::NewLC() + { + CMainDomFragment* pNew = new (ELeave) CMainDomFragment; + CleanupStack::PushL(pNew); + pNew->BaseConstructL(); + return pNew; + } + + +CMainDomFragment* CMainDomFragment::NewL( + const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName + ) + { + CMainDomFragment* pNew = NewLC( aNsUri, aLocalName, aQName ); + CleanupStack::Pop(); // pNew; + return pNew; + } + +CMainDomFragment* CMainDomFragment::NewLC( + const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName + ) + { + CMainDomFragment* pNew = new (ELeave) CMainDomFragment; + CleanupStack::PushL(pNew); + pNew->BaseConstructL(aNsUri, aLocalName, aQName); + return pNew; + } + + +CMainDomFragment::CMainDomFragment() +: ipDelegateFragment(NULL) + { + } + +void CMainDomFragment::BaseConstructL() + { + CSenDomFragmentBase::BaseConstructL( + KMainFragmentXmlns, + KMainFragmentName, + KMainFragmentQName + ); + } + +void CMainDomFragment::BaseConstructL( + const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName + ) + { + CSenDomFragmentBase::BaseConstructL(aNsUri, aLocalName, aQName); + } + +CMainDomFragment::~CMainDomFragment() + { + delete ipDelegateFragment; + } + +void CMainDomFragment::OnStartElementL(const RTagInfo& aElement, + const RAttributeArray& aAttributes, + TInt aErrorCode) + { + switch (iState) + { + case KSenStateSave: + { + const TPtrC8 saxLocalName = aElement.LocalName().DesC(); + + if (saxLocalName == KDelegateName) + { + const TPtrC8 saxNsUri = aElement.Uri().DesC(); + const TPtrC8 saxPrefix = aElement.Prefix().DesC(); + + TXmlEngElement element = AsElementL(); + RSenDocument& document = AsDocumentL(); + + ipDelegateFragment = CDelegateDomFragment::NewL( + saxNsUri, saxLocalName, + saxPrefix, aAttributes, + element, document + ); + + iState = KStateParsingDelegate; + + OnDelegateParsingL(*ipDelegateFragment); + } + else + { + CSenDomFragmentBase::OnStartElementL(aElement, aAttributes, + aErrorCode); + } + break; + } + default: + { + CSenDomFragmentBase::OnStartElementL(aElement, aAttributes, + aErrorCode); + break; + } + } + } + +void CMainDomFragment::OnEndElementL(const RTagInfo& aElement, + TInt aErrorCode) + + { + switch(iState) + { + case KStateParsingDelegate: + { + iState = KSenStateSave; + break; + } + + default: + { + CSenDomFragmentBase::OnEndElementL(aElement, aErrorCode); + break; + } + } + } + +void CMainDomFragment::OnResumeParsingFromL(const RTagInfo& aElement, + TInt aErrorCode) + { + SetContentHandler(*this); + + switch (iState) + { + // no other states may be resumed(!) + case KStateParsingDelegate: + { + OnEndElementL(aElement, aErrorCode); + } + break; + } + } + +CDelegateDomFragment& CMainDomFragment::DelegateFragment() + { + return *ipDelegateFragment; + } + +// END OF FILE + diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_fragment_api/tsrc/bc/senfragment/src/mainfragment.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/xml_fragment_api/tsrc/bc/senfragment/src/mainfragment.cpp Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,173 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + + + + + + +#include "mainfragment.h" +#include "SenFragmentBase.h" + +namespace + { + const TInt KStateParsingDelegate = 100; + _LIT8(KMainFragmentXmlns, "urn:main:fragment"); + _LIT8(KMainFragmentName, "MainFragment"); + _LIT8(KMainFragmentQName, "mn:MainFragment"); + _LIT8(KDelegateName, "DelegateFragment"); + } + +CMainFragment* CMainFragment::NewL() + { + CMainFragment* pNew = NewLC(); + CleanupStack::Pop(); // pNew; + return pNew; + } + +CMainFragment* CMainFragment::NewLC() + { + CMainFragment* pNew = new (ELeave) CMainFragment; + CleanupStack::PushL(pNew); + pNew->BaseConstructL(); + return pNew; + } + + +CMainFragment* CMainFragment::NewL( + const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName + ) + { + CMainFragment* pNew = NewLC( aNsUri, aLocalName, aQName ); + CleanupStack::Pop(); // pNew; + return pNew; + } + +CMainFragment* CMainFragment::NewLC( + const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName + ) + { + CMainFragment* pNew = new (ELeave) CMainFragment; + CleanupStack::PushL(pNew); + pNew->BaseConstructL(aNsUri, aLocalName, aQName); + return pNew; + } + + +CMainFragment::CMainFragment() +: ipDelegateFragment(NULL) + { + } + +void CMainFragment::BaseConstructL() + { + CSenFragmentBase::BaseConstructL( + KMainFragmentXmlns, + KMainFragmentName, + KMainFragmentQName + ); + } + +void CMainFragment::BaseConstructL( + const TDesC8& aNsUri, + const TDesC8& aLocalName, + const TDesC8& aQName + ) + { + CSenFragmentBase::BaseConstructL(aNsUri, aLocalName, aQName); + } + +CMainFragment::~CMainFragment() + { + delete ipDelegateFragment; + } + +void CMainFragment::OnStartElementL(const RTagInfo& aElement, + const RAttributeArray& aAttributes, + TInt aErrorCode) + { + switch (iState) + { + case KSenStateSave: + { + const TPtrC8 saxLocalName = aElement.LocalName().DesC(); + + if (saxLocalName == KDelegateName) + { + const TPtrC8 saxNsUri = aElement.Uri().DesC(); + const TPtrC8 saxPrefix = aElement.Prefix().DesC(); + + TXmlEngElement element = AsElementL(); + + ipDelegateFragment = CDelegateFragment::NewL( + saxNsUri, saxLocalName, + saxPrefix, aAttributes + ); + + iState = KStateParsingDelegate; + + OnDelegateParsingL(*ipDelegateFragment); + } + else + { + CSenFragmentBase::OnStartElementL(aElement, aAttributes, + aErrorCode); + } + break; + } + default: + { + CSenFragmentBase::OnStartElementL(aElement, aAttributes, + aErrorCode); + break; + } + } + } + +void CMainFragment::OnEndElementL(const RTagInfo& aElement, + TInt aErrorCode) + + { + switch(iState) + { + case KStateParsingDelegate: + { + iState = KSenStateSave; + break; + } + + default: + { + CSenFragmentBase::OnEndElementL(aElement, aErrorCode); + break; + } + } + } + +CDelegateFragment& CMainFragment::DelegateFragment() + { + return *ipDelegateFragment; + } + +// End of File + diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_fragment_api/tsrc/bc/senfragment/src/senfragment.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/xml_fragment_api/tsrc/bc/senfragment/src/senfragment.cpp Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,414 @@ +/* +* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: SenFragment class member functions +* +*/ + + + + + + + + + + + +// INCLUDE FILES +#include +#include "senfragmentbctest.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CSenFragmentBCTest::CSenFragmentBCTest +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CSenFragmentBCTest::CSenFragmentBCTest() + { + + } + +// ----------------------------------------------------------------------------- +// CSenFragmentBCTest::ConstructL +// Symbian 2nd phase constructor can leave. +// +// Note: If OOM test case uses STIF Logger, then STIF Logger must be created +// with static buffer size parameter (aStaticBufferSize). Otherwise Logger +// allocates memory from heap and therefore causes error situations with OOM +// testing. For more information about STIF Logger construction, see STIF Users +// Guide. +// ----------------------------------------------------------------------------- +// +void CSenFragmentBCTest::ConstructL() + { + iLog = CStifLogger::NewL( KSenFragmentLogPath, + KSenFragmentLogFile); + + // Sample how to use logging + _LIT( KLogStart, "SenFragment logging starts!" ); + iLog->Log( KLogStart ); + + // if ( iXmlReader ){ + // delete iXmlReader; + //} + //iXmlReader = CSenXmlReader::NewL(); + + } +//----------------------------------------------------------------------------- +// CSenFragmentBCTest::SendTestClassVersion +// Method used to send version of test class +//----------------------------------------------------------------------------- +// +void CSenFragmentBCTest::SendTestModuleVersion() + { + TVersion moduleVersion; + moduleVersion.iMajor = TEST_MODULE_VERSION_MAJOR; + moduleVersion.iMinor = TEST_MODULE_VERSION_MINOR; + moduleVersion.iBuild = TEST_MODULE_VERSION_BUILD; + + TFileName moduleName; + moduleName = _L("SenFragmentBCTest.dll"); + + + TBool newVersionOfMethod = ETrue; + CTestModuleIf &test=TestModuleIf(); + test.SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod); + test.SetBehavior(CTestModuleIf::ETestLeaksHandles); + } + +// ----------------------------------------------------------------------------- +// CSenFragmentBCTest::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CSenFragmentBCTest* CSenFragmentBCTest::NewL() + { + CSenFragmentBCTest* self = new (ELeave) CSenFragmentBCTest; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + + } + +// Destructor +CSenFragmentBCTest::~CSenFragmentBCTest() + { + if (iLog) delete iLog; + //if ( iXmlReader) + //{ + //delete iXmlReader; + // iXmlReader = NULL; + // } + } + +// ----------------------------------------------------------------------------- +// CSenFragmentBCTest::InitL +// InitL is used to initialize the Test Module. +// ----------------------------------------------------------------------------- +// +TInt CSenFragmentBCTest::InitL( + TFileName& /*aIniFile*/, + TBool /*aFirstTime*/ ) + { + return KErrNone; + + } + +// ----------------------------------------------------------------------------- +// CSenFragmentBCTest::GetTestCasesL +// GetTestCases is used to inquire test cases from the Test Module. Test +// cases are stored to array of test cases. The Test Framework will be +// the owner of the data in the RPointerArray after GetTestCases return +// and it does the memory deallocation. +// ----------------------------------------------------------------------------- +// +TInt CSenFragmentBCTest::GetTestCasesL( + const TFileName& /*aConfig*/, + RPointerArray& aTestCases ) + { + + // Loop through all test cases and create new + // TTestCaseInfo items and append items to aTestCase array + for( TInt i = 0; Case(i).iMethod != NULL; i++ ) + { + + // Allocate new TTestCaseInfo from heap for a testcase definition. + TTestCaseInfo* newCase = new( ELeave ) TTestCaseInfo(); + + // PushL TTestCaseInfo to CleanupStack. + CleanupStack::PushL( newCase ); + + // Set number for the testcase. + // When the testcase is run, this comes as a parameter to RunTestCaseL. + newCase->iCaseNumber = i; + + // Set title for the test case. This is shown in UI to user. + newCase->iTitle.Copy( Case(i).iCaseName ); + + // Append TTestCaseInfo to the testcase array. After appended + // successfully the TTestCaseInfo object is owned (and freed) + // by the TestServer. + User::LeaveIfError(aTestCases.Append ( newCase ) ); + + // Pop TTestCaseInfo from the CleanupStack. + CleanupStack::Pop( newCase ); + + } + + return KErrNone; + + } + +// ----------------------------------------------------------------------------- +// CSenFragmentBCTest::RunTestCaseL +// RunTestCaseL is used to run an individual test case specified +// by aTestCase. Test cases that can be run may be requested from +// Test Module by GetTestCases method before calling RunTestCase. +// ----------------------------------------------------------------------------- +// +TInt CSenFragmentBCTest::RunTestCaseL( + const TInt aCaseNumber, + const TFileName& /*aConfig*/, + TTestResult& aResult ) + { + SendTestModuleVersion(); + // Return value + TInt execStatus = KErrNone; + + // Get the pointer to test case function + TCaseInfo tmp = Case ( aCaseNumber ); + iLog->Log( _L("-------------------------------------------------------------")); + _LIT( KLogStartTC, "Starting testcase [%S]" ); + iLog->Log( KLogStartTC, &tmp.iCaseName); + + // Check that case number was valid + if ( tmp.iMethod != NULL ) + { + // Valid case was found, call it via function pointer + iMethod = tmp.iMethod; + execStatus = ( this->*iMethod )( aResult ); + } + else + { + // Valid case was not found, return error. + execStatus = KErrNotFound; + } + + // Return case execution status (not the result of the case execution) + return execStatus; + + } + +// ----------------------------------------------------------------------------- +// CSenFragmentBCTest::OOMTestQueryL +// Used to check if a particular test case should be run in OOM conditions and +// which memory allocations should fail. +// ----------------------------------------------------------------------------- +// +TBool CSenFragmentBCTest::OOMTestQueryL( + const TFileName& /* aTestCaseFile */, + const TInt aCaseNumber, + TOOMFailureType& /* aFailureType */, + TInt& aFirstMemFailure, + TInt& aLastMemFailure ) + { + _LIT( KLogOOMTestQueryL, "CSenFragmentBCTest::OOMTestQueryL" ); + iLog->Log( KLogOOMTestQueryL ); + + aFirstMemFailure = Case( aCaseNumber ).iFirstMemoryAllocation; + aLastMemFailure = Case( aCaseNumber ).iLastMemoryAllocation; + + return Case( aCaseNumber ).iIsOOMTest; + + } + +// ----------------------------------------------------------------------------- +// CSenFragmentBCTest::OOMTestInitializeL +// Used to perform the test environment setup for a particular OOM test case. +// Test Modules may use the initialization file to read parameters for Test +// Module initialization but they can also have their own configure file or +// some other routine to initialize themselves. +// +// NOTE: User may add implementation for OOM test environment initialization. +// Usually no implementation is required. +// ----------------------------------------------------------------------------- +// +void CSenFragmentBCTest::OOMTestInitializeL( + const TFileName& /* aTestCaseFile */, + const TInt /* aCaseNumber */ ) + { + } + +// ----------------------------------------------------------------------------- +// CSenFragmentBCTest::OOMHandleWarningL +// In some cases the heap memory allocation should be skipped, either due to +// problems in the OS code or components used by the code being tested, or even +// inside the tested components which are implemented this way on purpose (by +// design), so it is important to give the tester a way to bypass allocation +// failures. +// +// NOTE: User may add implementation for OOM test warning handling. Usually no +// implementation is required. +// ----------------------------------------------------------------------------- +// +void CSenFragmentBCTest::OOMHandleWarningL( + const TFileName& /* aTestCaseFile */, + const TInt /* aCaseNumber */, + TInt& /* aFailNextValue */ ) + { + } + +// ----------------------------------------------------------------------------- +// CSenFragmentBCTest::OOMTestFinalizeL +// Used to perform the test environment cleanup for a particular OOM test case. +// +// NOTE: User may add implementation for OOM test environment finalization. +// Usually no implementation is required. +// ----------------------------------------------------------------------------- +// +void CSenFragmentBCTest::OOMTestFinalizeL( + const TFileName& /* aTestCaseFile */, + const TInt /* aCaseNumber */ ) + { + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// LibEntryL is a polymorphic Dll entry point +// Returns: CTestModuleBase*: Pointer to Test Module object +// ----------------------------------------------------------------------------- +// +EXPORT_C CTestModuleBase* LibEntryL() + { + return CSenFragmentBCTest::NewL(); + + } + +// ----------------------------------------------------------------------------- +// SetRequirements handles test module parameters(implements evolution +// version 1 for test module's heap and stack sizes configuring). +// Returns: TInt: Symbian error code. +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt SetRequirements( CTestModuleParam*& /*aTestModuleParam*/, + TUint32& /*aParameterValid*/ ) + { + + /* --------------------------------- NOTE --------------------------------- + USER PANICS occurs in test thread creation when: + 1) "The panic occurs when the value of the stack size is negative." + 2) "The panic occurs if the minimum heap size specified is less + than KMinHeapSize". + KMinHeapSize: "Functions that require a new heap to be allocated will + either panic, or will reset the required heap size to this value if + a smaller heap size is specified". + 3) "The panic occurs if the minimum heap size specified is greater than + the maximum size to which the heap can grow". + Other: + 1) Make sure that your hardware or Symbian OS is supporting given sizes. + e.g. Hardware might support only sizes that are divisible by four. + ------------------------------- NOTE end ------------------------------- */ + + // Normally STIF uses default heap and stack sizes for test thread, see: + // KTestThreadMinHeap, KTestThreadMinHeap and KStackSize. + // If needed heap and stack sizes can be configured here by user. Remove + // comments and define sizes. + +/* + aParameterValid = KStifTestModuleParameterChanged; + + CTestModuleParamVer01* param = CTestModuleParamVer01::NewL(); + // Stack size + param->iTestThreadStackSize= 16384; // 16K stack + // Heap sizes + param->iTestThreadMinHeap = 4096; // 4K heap min + param->iTestThreadMaxHeap = 1048576;// 1M heap max + + aTestModuleParam = param; +*/ + return KErrNone; + + } + +// ----------------------------------------------------------------------------- +// E32Dll is a DLL entry point function +// Returns: KErrNone: No error +// ----------------------------------------------------------------------------- +// +#ifndef EKA2 // Hide Dll entry point to EKA2 +GLDEF_C TInt E32Dll( + TDllReason /*aReason*/) // Reason + { + return(KErrNone); + + } +#endif // EKA2 + +// End of File diff -r a1df79fa35b4 -r a8ae8e6fbd42 websrv_pub/xml_fragment_api/tsrc/bc/senfragment/src/senfragmentcases.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/websrv_pub/xml_fragment_api/tsrc/bc/senfragment/src/senfragmentcases.cpp Tue Jul 06 15:29:11 2010 +0300 @@ -0,0 +1,2932 @@ +/* +* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + +// INCLUDE FILES +#include +#include +#include +#include +#include "senfragmentbctest.h" +#include "maindomfragment.h" +#include "mainfragment.h" +#include "TestFragment.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CSenFragmentBCTest::Case +// Returns a test case by number. +// +// This function contains an array of all available test cases +// i.e pair of case name and test function. If case specified by parameter +// aCaseNumber is found from array, then that item is returned. +// +// The reason for this rather complicated function is to specify all the +// test cases only in one place. It is not necessary to understand how +// function pointers to class member functions works when adding new test +// cases. See function body for instructions how to add new test case. +// ----------------------------------------------------------------------------- +// +const TCaseInfo CSenFragmentBCTest::Case ( + const TInt aCaseNumber ) const + { + + /** + * To add new test cases, implement new test case function and add new + * line to KCases array specify the name of the case and the function + * doing the test case + * In practice, do following + * 1) Make copy of existing test case function and change its name + * and functionality. Note that the function must be added to + * SenFragment.cpp file and to SenFragment.h + * header file. + * + * 2) Add entry to following KCases array either by using: + * + * 2.1: FUNCENTRY or ENTRY macro + * ENTRY macro takes two parameters: test case name and test case + * function name. + * + * FUNCENTRY macro takes only test case function name as a parameter and + * uses that as a test case name and test case function name. + * + * Or + * + * 2.2: OOM_FUNCENTRY or OOM_ENTRY macro. Note that these macros are used + * only with OOM (Out-Of-Memory) testing! + * + * OOM_ENTRY macro takes five parameters: test case name, test case + * function name, TBool which specifies is method supposed to be run using + * OOM conditions, TInt value for first heap memory allocation failure and + * TInt value for last heap memory allocation failure. + * + * OOM_FUNCENTRY macro takes test case function name as a parameter and uses + * that as a test case name, TBool which specifies is method supposed to be + * run using OOM conditions, TInt value for first heap memory allocation + * failure and TInt value for last heap memory allocation failure. + */ + + static TCaseInfoInternal const KCases[] = + { + + ENTRY( "NewL - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_NewLL ), + ENTRY( "NewL - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_NewL_1L ), + ENTRY( "NewL - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_NewL_2L ), + ENTRY( "NewL - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_NewL_3L ), + ENTRY( "NewL - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_NewL_4L ), + ENTRY( "NewL - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_NewL_5L ), + ENTRY( "NewL - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_NewL_6L ), + ENTRY( "NewL - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_NewL_7L ), + ENTRY( "AddAttributesL - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_AddAttributesLL ), + ENTRY( "AsXmlL - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_AsXmlLL ), + ENTRY( "ContentL - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_ContentLL ), + ENTRY( "Namespace - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_NamespaceL ), + ENTRY( "ResetContentL - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_ResetContentLL ), + ENTRY( "LocalName - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_LocalNameL ), + ENTRY( "NsUri - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_NsUriL ), + ENTRY( "NsPrefix - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_NsPrefixL ), + ENTRY( "AsElementL - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_AsElementLL ), + ENTRY( "AsDocumentL - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_AsDocumentLL ), + ENTRY( "ExtractElement - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_ExtractElementL ), + ENTRY( "AsXmlUnicodeL - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_AsXmlUnicodeLL ), + ENTRY( "WriteAsXMLToL - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_WriteAsXMLToLL ), + ENTRY( "ConsistsOfL - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_ConsistsOfLL ), + ENTRY( "Parsing1 - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_Parsing1L ), + ENTRY( "Parsing2 - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_Parsing2L ), + ENTRY( "Parsing3 - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_Parsing3L ), + ENTRY( "Parsing4 - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_Parsing4L ), + ENTRY( "Parsing5 - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_Parsing5L ), + ENTRY( "Parsing6 - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_Parsing6L ), + ENTRY( "Parsing7 - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_Parsing7L ), + ENTRY( "Parsing8 - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_Parsing8L ), + //ENTRY( "SetContentOfL - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_SetContentOfLL ), + //ENTRY( "ContentOf - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_ContentOfL ), + ENTRY( "OnWriteStartElementL - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_OnWriteStartElementLL ), + ENTRY( "OnWriteEndElementL - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_OnWriteEndElementLL ), + ENTRY( "OnIgnorableWhiteSpaceL - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_OnIgnorableWhiteSpaceLL ), + ENTRY( "OnSkippedEntityL - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_OnSkippedEntityLL ), + ENTRY( "OnProcessingInstructionL - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_OnProcessingInstructionLL ), + ENTRY( "OnError - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_OnErrorL ), + ENTRY( "GetExtendedInterface - CSenDomFragmentBase", CSenFragmentBCTest::MT_CSenDomFragmentBase_GetExtendedInterfaceL ), + ENTRY( "NewL - CSenFragmentBase", CSenFragmentBCTest::MT_CSenFragmentBase_NewLL ), + ENTRY( "NewL - CSenFragmentBase", CSenFragmentBCTest::MT_CSenFragmentBase_NewL_2L ), + ENTRY( "NewL - CSenFragmentBase", CSenFragmentBCTest::MT_CSenFragmentBase_NewL_3L ), + ENTRY( "NewL - CSenFragmentBase", CSenFragmentBCTest::MT_CSenFragmentBase_NewL_4L ), + ENTRY( "NewL - CSenFragmentBase", CSenFragmentBCTest::MT_CSenFragmentBase_NewL_5L ), + ENTRY( "NewL - CSenFragmentBase", CSenFragmentBCTest::MT_CSenFragmentBase_NewL_6L ), + ENTRY( "NewL - CSenFragmentBase", CSenFragmentBCTest::MT_CSenFragmentBase_NewL_7L ), + ENTRY( "SetDocument - CSenFragmentBase", CSenFragmentBCTest::MT_CSenFragmentBase_SetDocumentL ), + + ENTRY( "ContentL - CSenFragmentBase", CSenFragmentBCTest::MT_CSenFragmentBase_ContentLL ), + ENTRY( "Namespace - CSenFragmentBase", CSenFragmentBCTest::MT_CSenFragmentBase_NamespaceL ), + ENTRY( "ResetContentL - CSenFragmentBase", CSenFragmentBCTest::MT_CSenFragmentBase_ResetContentLL ), + ENTRY( "LocalName - CSenFragmentBase", CSenFragmentBCTest::MT_CSenFragmentBase_LocalNameL ), + ENTRY( "NsUri - CSenFragmentBase", CSenFragmentBCTest::MT_CSenFragmentBase_NsUriL ), + ENTRY( "NsPrefix - CSenFragmentBase", CSenFragmentBCTest::MT_CSenFragmentBase_NsPrefixL ), + ENTRY( "AsElementL - CSenFragmentBase", CSenFragmentBCTest::MT_CSenFragmentBase_AsElementLL ), + ENTRY( "AsDocumentL - CSenFragmentBase", CSenFragmentBCTest::MT_CSenFragmentBase_AsDocumentLL ), + ENTRY( "ExtractElement - CSenFragmentBase", CSenFragmentBCTest::MT_CSenFragmentBase_ExtractElementL ), + ENTRY( "AsXmlUnicodeL - CSenFragmentBase", CSenFragmentBCTest::MT_CSenFragmentBase_AsXmlUnicodeLL ), + ENTRY( "AsXmlL - CSenFragmentBase", CSenFragmentBCTest::MT_CSenFragmentBase_AsXmlLL ), + ENTRY( "WriteAsXMLToL - CSenFragmentBase", CSenFragmentBCTest::MT_CSenFragmentBase_WriteAsXMLToLL ), + ENTRY( "ConsistsOfL - CSenFragmentBase", CSenFragmentBCTest::MT_CSenFragmentBase_ConsistsOfLL ), + ENTRY( "Parsing1 - CSenFragmentBase", CSenFragmentBCTest::MT_CSenFragmentBase_Parsing1L ), + ENTRY( "Parsing2 - CSenFragmentBase", CSenFragmentBCTest::MT_CSenFragmentBase_Parsing2L ), + ENTRY( "Parsing3 - CSenFragmentBase", CSenFragmentBCTest::MT_CSenFragmentBase_Parsing3L ), + ENTRY( "Parsing4 - CSenFragmentBase", CSenFragmentBCTest::MT_CSenFragmentBase_Parsing4L ), + ENTRY( "Parsing5 - CSenFragmentBase", CSenFragmentBCTest::MT_CSenFragmentBase_Parsing5L ), + ENTRY( "NewL - CSenParser", CSenFragmentBCTest::MT_CSenParser_NewLL ), + ENTRY( "NewLC - CSenParser", CSenFragmentBCTest::MT_CSenParser_NewLCL ), + ENTRY( "NewL - CSenParser", CSenFragmentBCTest::MT_CSenParser_NewL_1L ), + ENTRY( "NewLC - CSenParser", CSenFragmentBCTest::MT_CSenParser_NewLC_1L ), + ENTRY( "NewL - CSenParser", CSenFragmentBCTest::MT_CSenParser_NewL_2L ), + ENTRY( "NewLC - CSenParser", CSenFragmentBCTest::MT_CSenParser_NewLC_2L ), +// ENTRY( "NewL - CSenParser", CSenFragmentBCTest::MT_CSenParser_NewL_3L ), +// ENTRY( "NewLC - CSenParser", CSenFragmentBCTest::MT_CSenParser_NewLC_3L ), + ENTRY( "NewL - RSenDocument", CSenFragmentBCTest::MT_RSenDocument_NewLL ), + ENTRY( "NewLC - RSenDocument", CSenFragmentBCTest::MT_RSenDocument_NewLCL ), + ENTRY( "NewL - RSenDocument", CSenFragmentBCTest::MT_RSenDocument_NewL_1L ), + ENTRY( "NewLC - RSenDocument", CSenFragmentBCTest::MT_RSenDocument_NewLC_1L ), + ENTRY( "Copy - RSenDocument", CSenFragmentBCTest::MT_RSenDocument_CopyL ), + ENTRY( "Close - RSenDocument", CSenFragmentBCTest::MT_RSenDocument_CloseL ), + ENTRY( "Destroy - RSenDocument", CSenFragmentBCTest::MT_RSenDocument_DestroyL ), + ENTRY( "Destroy - RSenDocument", CSenFragmentBCTest::MT_RSenDocument_DestroyL ), + + ENTRY( "ManualXmlEngineTlsAttachL - RSenDocument", CSenFragmentBCTest::MT_RSenDocument_ManualXmlEngineTlsAttachLL ), + ENTRY( "ManualXmlEngineTlsAttachL - RSenDocument", CSenFragmentBCTest::MT_RSenDocument_ManualXmlEngineTlsCleanupL ), + ENTRY( "SetContentL - TestFragmentBase", CSenFragmentBCTest::MT_TestFragmentBase_SetContentLL ), + ENTRY( "AddContentL - TestFragmentBase", CSenFragmentBCTest::MT_TestFragmentBase_AddContentLL ), + ENTRY( "SetContentOfL - TestDomFragmentBase", CSenFragmentBCTest::MT_TestDomFragmentBase_SetContentOfLL ), + //ENTRY( "ContentOf - TestDomFragmentBase", CSenFragmentBCTest::MT_TestDomFragmentBase_ContentOfL ), + + // Example how to use OOM functionality + //OOM_ENTRY( "Loop test with OOM", CSenFragmentBCTest::LoopTest, ETrue, 2, 3), + //OOM_FUNCENTRY( CSenFragmentBCTest::PrintTest, ETrue, 1, 3 ), + }; + + // Verify that case number is valid + if( (TUint) aCaseNumber >= sizeof( KCases ) / + sizeof( TCaseInfoInternal ) ) + { + // Invalid case, construct empty object + TCaseInfo null( (const TText*) L"" ); + null.iMethod = NULL; + null.iIsOOMTest = EFalse; + null.iFirstMemoryAllocation = 0; + null.iLastMemoryAllocation = 0; + return null; + } + + // Construct TCaseInfo object and return it + TCaseInfo tmp ( KCases[ aCaseNumber ].iCaseName ); + tmp.iMethod = KCases[ aCaseNumber ].iMethod; + tmp.iIsOOMTest = KCases[ aCaseNumber ].iIsOOMTest; + tmp.iFirstMemoryAllocation = KCases[ aCaseNumber ].iFirstMemoryAllocation; + tmp.iLastMemoryAllocation = KCases[ aCaseNumber ].iLastMemoryAllocation; + return tmp; + + } + +void CSenFragmentBCTest::SetupL( ){ + if ( iXmlReader ){ + delete iXmlReader; + iXmlReader = NULL; + } + iXmlReader = CSenXmlReader::NewL(); +} + +void CSenFragmentBCTest::Teardown( ){ + if ( iXmlReader){ + delete iXmlReader; + iXmlReader = NULL; + } +} + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_NewLL(TTestResult& aResult) + { + SetupL(); + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(); + TL(pFragment != (CSenDomFragmentBase*)NULL); + __ASSERT_ALWAYS_NO_LEAVE(delete pFragment); + pFragment = NULL; + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_NewL_1L(TTestResult& aResult) + { + SetupL(); + RSenDocument document = RSenDocument::NewL(); + CleanupClosePushL(document); + TXmlEngElement element = document.CreateDocumentElementL(_L8("Test")); + element.SetEscapedTextL(_L8("")); + + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(element); + CleanupStack::PushL(pFragment); + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + // Test that when CSenDomFragmentBase is serialized '<' and '>' characters + // are encoded (as all basic entities in content should be). + if(!( *pAsXml == _L8("<Element/>") ))return KErrArgument; + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); + CleanupStack::Pop(1); + //CleanupStack::PopAndDestroy(&document); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_NewL_2L(TTestResult& aResult) + { + SetupL(); + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("Test")); + CleanupStack::PushL(pFragment); + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + if(!( *pAsXml == _L8("") )) return KErrArgument; + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_NewL_3L(TTestResult& aResult) + { + SetupL(); + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"), + _L8("Test")); + CleanupStack::PushL(pFragment); + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + if(!( *pAsXml == _L8("") )) return KErrArgument; + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_NewL_4L(TTestResult& aResult) + { + SetupL(); + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t")); + CleanupStack::PushL(pFragment); + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + if(!( *pAsXml == _L8("") )) return KErrArgument; + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_NewL_5L(TTestResult& aResult) + { + SetupL(); + RStringPool stringPool; + stringPool.OpenL(); + CleanupClosePushL(stringPool); + + RString nsUriRString = stringPool.OpenStringL(_L8("nsuri")); + CleanupClosePushL(nsUriRString); + RString nsPrefixRString = stringPool.OpenStringL(_L8("pr")); + CleanupClosePushL(nsPrefixRString); + RString localNameRString = stringPool.OpenStringL(_L8("LocalName")); + CleanupClosePushL(localNameRString); + RString valueRString = stringPool.OpenStringL(_L8("Value")); + CleanupClosePushL(valueRString); + + RAttribute attribute; + attribute.Open( nsUriRString, nsPrefixRString, localNameRString, + valueRString ); + // attribute took ownership of all RStrings + // => All RStrings can be pop from CleanupStack + CleanupStack::Pop(&valueRString); + CleanupStack::Pop(&localNameRString); + CleanupStack::Pop(&nsPrefixRString); + CleanupStack::Pop(&nsUriRString); + + CleanupClosePushL(attribute); + + RAttributeArray attrArray; + // append the namespace attribute (declaration) + attrArray.AppendL(attribute); + CleanupClosePushL(attrArray); + + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t"), + attrArray); + CleanupStack::PushL(pFragment); + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + if(!( *pAsXml == _L8("") )) return KErrArgument; + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); + CleanupStack::PopAndDestroy(&attrArray); + CleanupStack::PopAndDestroy(&attribute); + CleanupStack::PopAndDestroy(&stringPool); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_NewL_6L(TTestResult& aResult) + { + SetupL(); + RSenDocument document = RSenDocument::NewL(); + CleanupClosePushL(document); + TXmlEngElement parentElement = document.CreateDocumentElementL(_L8("Parent")); + + RStringPool stringPool; + stringPool.OpenL(); + CleanupClosePushL(stringPool); + + RString nsUriRString = stringPool.OpenStringL(_L8("nsuri")); + CleanupClosePushL(nsUriRString); + RString nsPrefixRString = stringPool.OpenStringL(_L8("pr")); + CleanupClosePushL(nsPrefixRString); + RString localNameRString = stringPool.OpenStringL(_L8("LocalName")); + CleanupClosePushL(localNameRString); + RString valueRString = stringPool.OpenStringL(_L8("Value")); + CleanupClosePushL(valueRString); + + RAttribute attribute; + attribute.Open(nsUriRString, nsPrefixRString, localNameRString, + valueRString); + // attribute took ownership of all RStrings + // => All RStrings can be pop from CleanupStack + CleanupStack::Pop(&valueRString); + CleanupStack::Pop(&localNameRString); + CleanupStack::Pop(&nsPrefixRString); + CleanupStack::Pop(&nsUriRString); + + CleanupClosePushL(attribute); + + RAttributeArray attrArray; + // append the namespace attribute (declaration) + attrArray.AppendL(attribute); + CleanupClosePushL(attrArray); + + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t"), + attrArray, + parentElement); + CleanupStack::PushL(pFragment); + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + if(!( *pAsXml == _L8("") )) return KErrArgument; + + RBuf8 buffer; + parentElement.OuterXmlL(buffer); + + if(!( buffer == _L8("") )) return KErrArgument; + buffer.Close(); + + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); + CleanupStack::PopAndDestroy(&attrArray); + CleanupStack::PopAndDestroy(&attribute); + CleanupStack::PopAndDestroy(&stringPool); + CleanupStack::PopAndDestroy(&document); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_NewL_7L(TTestResult& aResult) + { + SetupL(); + RSenDocument document = RSenDocument::NewL(); + CleanupClosePushL(document); + TXmlEngElement parentElement = document.CreateDocumentElementL(_L8("Parent")); + + RStringPool stringPool; + stringPool.OpenL(); + CleanupClosePushL(stringPool); + + RString nsUriRString = stringPool.OpenStringL(_L8("nsuri")); + CleanupClosePushL(nsUriRString); + RString nsPrefixRString = stringPool.OpenStringL(_L8("pr")); + CleanupClosePushL(nsPrefixRString); + RString localNameRString = stringPool.OpenStringL(_L8("LocalName")); + CleanupClosePushL(localNameRString); + RString valueRString = stringPool.OpenStringL(_L8("Value")); + CleanupClosePushL(valueRString); + + RAttribute attribute; + attribute.Open(nsUriRString, nsPrefixRString, localNameRString, + valueRString); + // attribute took ownership of all RStrings + // => All RStrings can be pop from CleanupStack + CleanupStack::Pop(&valueRString); + CleanupStack::Pop(&localNameRString); + CleanupStack::Pop(&nsPrefixRString); + CleanupStack::Pop(&nsUriRString); + + CleanupClosePushL(attribute); + + RAttributeArray attrArray; + // append the namespace attribute (declaration) + attrArray.AppendL(attribute); + CleanupClosePushL(attrArray); + + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8(""), + attrArray, + parentElement, + document); + CleanupStack::PushL(pFragment); + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + if(!( *pAsXml == _L8("") )) return KErrArgument; + + RBuf8 buffer; + parentElement.OuterXmlL(buffer); + + if(!( buffer == _L8("") )) return KErrArgument; + buffer.Close(); + + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); + CleanupStack::PopAndDestroy(&attrArray); + CleanupStack::PopAndDestroy(&attribute); + CleanupStack::PopAndDestroy(&stringPool); + CleanupStack::PopAndDestroy(&document); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_AddAttributesLL(TTestResult& aResult) + { + SetupL(); + RStringPool stringPool; + stringPool.OpenL(); + CleanupClosePushL(stringPool); + + RString nsUriRString = stringPool.OpenStringL(_L8("nsuri")); + CleanupClosePushL(nsUriRString); + RString nsPrefixRString = stringPool.OpenStringL(_L8("pr")); + CleanupClosePushL(nsPrefixRString); + RString localNameRString = stringPool.OpenStringL(_L8("LocalName")); + CleanupClosePushL(localNameRString); + RString valueRString = stringPool.OpenStringL(_L8("Value")); + CleanupClosePushL(valueRString); + + RAttribute attribute; + attribute.Open(nsUriRString, nsPrefixRString, localNameRString, + valueRString); + // attribute took ownership of all RStrings + // => All RStrings can be pop from CleanupStack + CleanupStack::Pop(4); // nsUriRString, nsPrefixRString, localNameRString, + // valueRString + CleanupClosePushL(attribute); + + RAttributeArray attrArray; + // append the namespace attribute (declaration) + attrArray.AppendL(attribute); + CleanupClosePushL(attrArray); + + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("Test")); + CleanupStack::PushL(pFragment); + + pFragment->AddAttributesL(attrArray); + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + if(!( *pAsXml == _L8("") )) return KErrArgument; + CleanupStack::PopAndDestroy(pAsXml); + + CleanupStack::PopAndDestroy(pFragment); + + CleanupStack::PopAndDestroy(&attrArray); + CleanupStack::PopAndDestroy(&attribute); + CleanupStack::PopAndDestroy(&stringPool); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_AsXmlLL(TTestResult& aResult) + { + SetupL(); + // Test serialization of Dom tree which has two child elements + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("Test")); + CleanupStack::PushL(pFragment); + TXmlEngElement element = pFragment->AsElementL(); + + TXmlEngElement element2 = element.AddNewElementL(_L8("Child"), _L8("nsuri"), _L8("prefix")); + + element2.AddNewElementL(_L8("Child2"), _L8("nsuri2"), _L8("prefix2")); + + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + if(!( *pAsXml == _L8("") ) ) return KErrArgument; + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_ContentLL(TTestResult& aResult) + { + SetupL(); + RSenDocument document = RSenDocument::NewL(); + CleanupClosePushL(document); + TXmlEngElement element = document.CreateDocumentElementL(_L8("Test")); + element.SetEscapedTextL(_L8("")); + + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(element); + CleanupStack::PushL(pFragment); + + TPtrC8 content = pFragment->ContentL(); + if(!( content == _L8("") ) ) return KErrArgument; + + CleanupStack::PopAndDestroy(pFragment); + CleanupStack::PopAndDestroy(&document); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_NamespaceL(TTestResult& aResult) + { + SetupL(); + RStringPool stringPool; + stringPool.OpenL(); + CleanupClosePushL(stringPool); + + RString nsUriRString = stringPool.OpenStringL(_L8("nsuri")); + CleanupClosePushL(nsUriRString); + RString nsPrefixRString = stringPool.OpenStringL(_L8("pr")); + CleanupClosePushL(nsPrefixRString); + RString localNameRString = stringPool.OpenStringL(_L8("LocalName")); + CleanupClosePushL(localNameRString); + RString valueRString = stringPool.OpenStringL(_L8("Value")); + CleanupClosePushL(valueRString); + + RAttribute attribute; + attribute.Open(stringPool.OpenStringL(_L8("nsuri")), + stringPool.OpenStringL(_L8("pr")), + stringPool.OpenStringL(_L8("LocalName")), + stringPool.OpenStringL(_L8("Value")) ); + // attribute took copies of all RStrings + // => All RStrings can be destroyed + CleanupStack::PopAndDestroy(4); // nsUriRString, nsPrefixRString, localNameRString, + // valueRString + CleanupClosePushL(attribute); + + RAttributeArray attrArray; + // append the namespace attribute (declaration) + attrArray.AppendL(attribute); + CleanupClosePushL(attrArray); + + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t"), + attrArray); + CleanupStack::PushL(pFragment); + + TXmlEngNamespace ns = pFragment->Namespace(_L8("pr")); + if(!( ns.Uri() == _L8("nsuri") ) ) return KErrArgument; + + TXmlEngNamespace ns2 = pFragment->Namespace(_L8("x")); + if(!( ns2.IsNull() ) ) return KErrArgument; + + CleanupStack::PopAndDestroy(pFragment); + CleanupStack::PopAndDestroy(); // attribute + CleanupStack::PopAndDestroy(); // attrArray + CleanupStack::PopAndDestroy(); // stringPool + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_ResetContentLL(TTestResult& aResult) + { + SetupL(); + RSenDocument document = RSenDocument::NewL(); + CleanupClosePushL(document); + TXmlEngElement element = document.CreateDocumentElementL(_L8("Test")); + element.SetEscapedTextL(_L8("Content")); + + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(element); + CleanupStack::PushL(pFragment); + + // Test that CSenFragmentBase has content before reset + TPtrC8 content = pFragment->ContentL(); + if(!( content == _L8("Content") )) return KErrArgument; + + pFragment->ResetContentL(); + + // Test that CSenFragmentBase has no content after reset + TPtrC8 content2 = pFragment->ContentL(); + if(!( content2 == KNullDesC8 )) return KErrArgument; + + CleanupStack::PopAndDestroy(pFragment); + CleanupStack::PopAndDestroy(&document); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_LocalNameL(TTestResult& aResult) + { + SetupL(); + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t")); + CleanupStack::PushL(pFragment); + TPtrC8 localName = pFragment->LocalName(); + if(!( localName == _L8("Test") ) ) return KErrArgument; + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_NsUriL(TTestResult& aResult) + { + SetupL(); + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t")); + CleanupStack::PushL(pFragment); + TPtrC8 localName = pFragment->NsUri(); + if(!( localName == _L8("NsUri") ) ) return KErrArgument; + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_NsPrefixL(TTestResult& aResult) + { + SetupL(); + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t")); + CleanupStack::PushL(pFragment); + TPtrC8 localName = pFragment->NsPrefix(); + if(!( localName == _L8("t") ) ) return KErrArgument; + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_AsElementLL(TTestResult& aResult) + { + SetupL(); + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t")); + CleanupStack::PushL(pFragment); + TXmlEngElement element = pFragment->AsElementL(); + RBuf8 buffer; + CleanupClosePushL(buffer); + element.OuterXmlL(buffer); + // Serialized element should contain all the Fragment data as XML. + if(!( buffer == _L8("") ) ) return KErrArgument; + CleanupStack::PopAndDestroy(&buffer); + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_AsDocumentLL(TTestResult& aResult) + { + SetupL(); + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t")); + CleanupStack::PushL(pFragment); + RSenDocument document = pFragment->AsDocumentL(); + TXmlEngElement element = document.DocumentElement(); + + TXmlEngSerializationOptions options; + // Omit following declarations from the beginning of XML Document: + // + options.iOptions = options.iOptions | + TXmlEngSerializationOptions::KOptionOmitXMLDeclaration; + RBuf8 asXml; + document.SaveL(asXml, element, options); + CleanupClosePushL(asXml); + + // Serialized document should contain all the Fragment data as XML. + if(!( asXml == _L8("") ) ) return KErrArgument; + + CleanupStack::PopAndDestroy(&asXml); + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_ExtractElementL(TTestResult& aResult) + { + SetupL(); + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t")); + CleanupStack::PushL(pFragment); + TXmlEngElement element = pFragment->ExtractElement(); + if(!( element.Name() == _L8("Test") )) return KErrArgument; + element.Remove(); + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_AsXmlUnicodeLL(TTestResult& aResult) + { + SetupL(); + // Test serialization of Dom tree which has two child elements + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("Test")); + CleanupStack::PushL(pFragment); + TXmlEngElement element = pFragment->AsElementL(); + + TXmlEngElement element2 = element.AddNewElementL(_L8("Child"), _L8("nsuri"), _L8("prefix")); + + element2.AddNewElementL(_L8("Child2"), _L8("nsuri2"), _L8("prefix2")); + + HBufC* pAsXml = pFragment->AsXmlUnicodeL(); + CleanupStack::PushL(pAsXml); + if(!( *pAsXml == _L("") )) return KErrArgument; + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_WriteAsXMLToLL(TTestResult& aResult) + { + SetupL(); + // Test serialization of Dom tree which has two child elements + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("Test")); + CleanupStack::PushL(pFragment); + TXmlEngElement element = pFragment->AsElementL(); + + TXmlEngElement element2 = element.AddNewElementL(_L8("Child"), _L8("nsuri"), _L8("prefix")); + + element2.AddNewElementL(_L8("Child2"), _L8("nsuri2"), _L8("prefix2")); + + CBufFlat* pBuf = CBufFlat::NewL(200); + CleanupStack::PushL(pBuf); + RBufWriteStream bufWs(*pBuf); + CleanupClosePushL(bufWs); + pFragment->WriteAsXMLToL(bufWs); + + + if(!( pBuf->Ptr(0) == _L8("") )) return KErrArgument; + + CleanupStack::PopAndDestroy(&bufWs); + CleanupStack::PopAndDestroy(pBuf); + + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_ConsistsOfLL(TTestResult& aResult) + { + SetupL(); + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("Test")); + CleanupStack::PushL(pFragment); + TXmlEngElement element = pFragment->AsElementL(); + + TXmlEngElement elementchild1 = element.AddNewElementL(_L8("DirectChild")); + elementchild1.AddNamespaceDeclarationL(_L8("nsuri"), _L8("prefix")); + + //TDomUtils domUtils1; + //domUtils1.XmlEngRenameElementL(elementchild1, _L8("DirectChild"), _L8("nsuri"), _L8("prefix")); + + TXmlEngElement elementchild2 = element.AddNewElementL(_L8("DirectChild")); + elementchild2.AddNamespaceDeclarationL(_L8("nsuri"), _L8("prefix")); + //TDomUtils domUtils2; + //domUtils2.XmlEngRenameElementL(elementchild2, _L8("DirectChild"), _L8("nsuri"), _L8("prefix")); + elementchild2.AddNewElementL(_L8("Child"), _L8("nsuri2"), _L8("prefix2")); + + CSenDomFragmentBase* pFragment2 = CSenDomFragmentBase::NewL(_L8("Test")); + CleanupStack::PushL(pFragment2); + TXmlEngElement element2 = pFragment2->AsElementL(); + + TXmlEngElement elementchild22 = element2.AddNewElementL(_L8("DirectChild")); + elementchild22.AddNamespaceDeclarationL(_L8("nsuri"), _L8("prefix")); + //TDomUtils domUtils22; + //domUtils22.XmlEngRenameElementL(elementchild22, _L8("DirectChild"), _L8("nsuri"), _L8("prefix")); + elementchild22.AddNewElementL(_L8("Child"), _L8("nsuri2"), _L8("prefix2")); + + // ConsistOfL should return ETrue because + // root elements of both fragments match and the only element + // of pFragment2 = elementchild22 is exactly the same element as + // elementchild2. + if(!( pFragment->ConsistsOfL(*pFragment2) )) return KErrArgument; + + // ConsistOfL should return EFalse because + // Even though root elements of both fragments match + // there is extra element (= elementchild1) in pFragment. + // + // elementchild1 (of pFragment) can not be found from pFragment2 + // and because of that pFragment2 does not consist of pFragment. + if(!( !pFragment2->ConsistsOfL(*pFragment) )) return KErrArgument; + CleanupStack::PopAndDestroy(pFragment2); + + CSenDomFragmentBase* pFragment3 = CSenDomFragmentBase::NewL(_L8("Test")); + CleanupStack::PushL(pFragment3); + TXmlEngElement element3 = pFragment3->AsElementL(); + + TXmlEngElement elementchild32 = element3.AddNewElementL(_L8("DirectChild")); + elementchild32.AddNamespaceDeclarationL(_L8("nsuri"), _L8("prefix")); + //TDomUtils domUtils32; + //domUtils32.XmlEngRenameElementL(elementchild32, _L8("DirectChild"), _L8("nsuri"), _L8("prefix")); + elementchild32.AddNewElementL(_L8("Child"), _L8("nsuri2"), _L8("prefix2")); + elementchild32.SetEscapedTextL(_L8("Text")); + + // ConsistOfL should return EFalse because + // elementchild32 has content ("Text") which doesn't match + // to any child element of pFragment. + if(!( !pFragment->ConsistsOfL(*pFragment3) )) return KErrArgument; + CleanupStack::PopAndDestroy(pFragment3); + + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_Parsing1L(TTestResult& aResult) + { + SetupL(); + // Parsing of XML document to CSenDomFragmentBase + _LIT8(KInputString, "\ +Content1\ +Content2\ +Content3\ +"); + + // Default namespace declaration (xmlns="nsuri") from Parent element (Test) + // will be moved to all child elements (Element1, Element2, Element3 and + // Element4) when EReportNamespaceMapping is _NOT_ enabled. That's because + // the way CParser works <=> Namespaces are reported when namespaces are used + // for the first time. + _LIT8(KOutputString1, "\ +Content1\ +Content2\ +Content3\ +"); + + // When EReportNamespaceMapping is enabled all the namespace declarations + // are reported in exactly the same element as they are defined in parsed + // XML document. + // Note: The Order of namespace declarations in root element tag may change. + // Namespace declaration for root tag is created when fragment is created + // and because of that namespace declaration for root tag will be the first. + // In this particular case namespace declaration for prefix "a" will be + // the first namespace declaration because it is declared when + // CSenDomFragmentBase is created. + _LIT8(KOutputString2, "\ +Content1\ +Content2\ +Content3\ +"); + + CSenParser* pParser = CSenParser::NewLC(); + + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("nasuria"),_L8("Test"),_L8("a")); + CleanupStack::PushL(pFragment); + + pParser->ParseL(KInputString, *pFragment); + + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + + if(!( *pAsXml == KOutputString1 )) return KErrArgument; + + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); +/* + pParser->EnableFeature(EReportNamespaceMapping); + //tma + pParser->DisableFeature(EReportNamespaceMapping); + TBool fEneabled(EFalse); + fEneabled = pParser->IsFeatureEnabled(EReportNamespaceMapping); + EUNIT_ASSERT( fEneabled == EFalse); + pParser->EnableFeature(EReportNamespaceMapping); + //tma +*/ + pParser->EnableFeature(EReportNamespaceMapping); + + CSenDomFragmentBase* pFragment2 = CSenDomFragmentBase::NewL(_L8("nasuria"),_L8("Test"),_L8("a")); + CleanupStack::PushL(pFragment2); + + pParser->ParseL(KInputString, *pFragment2); + + HBufC8* pAsXml2 = pFragment2->AsXmlL(); + CleanupStack::PushL(pAsXml2); + + if(!( *pAsXml2 == KOutputString2 )) return KErrArgument; + + CleanupStack::PopAndDestroy(pAsXml2); + CleanupStack::PopAndDestroy(pFragment2); + + CleanupStack::PopAndDestroy(pParser); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_Parsing2L(TTestResult& aResult) + { + SetupL(); + // Parsing of XML document to CSenDomFragmentBase which uses + // delegation. + _LIT8(KInputString, "\ +DelegateContent\ +Content1\ +Content2"); + + // Default namespace declaration (xmlns="nsuri") from Parent element (Test) + // will be moved to all child elements (Element1, Element2, Element3 and + // Element4) when EReportNamespaceMapping is _NOT_ enabled. That's because + // the way CParser works <=> Namespaces are reported when namespaces are used + // for the first time. + _LIT8(KOutputString1, "\ +DelegateContent\ +Content1\ +Content2"); + + // When EReportNamespaceMapping is enabled all the namespace declarations + // are reported in exactly the same element as they are defined in parsed + // XML document. + // Note: The Order of namespace declarations in root element tag may change. + // Namespace declaration for root tag is created when fragment is created + // and because of that namespace declaration for root tag will be the first. + _LIT8(KOutputString2, "\ +DelegateContent\ +Content1\ +Content2"); + + CSenParser* pParser = CSenParser::NewLC(); + + CMainDomFragment* pFragment = CMainDomFragment::NewL(_L8("nasuria"),_L8("Test"),_L8("a")); + CleanupStack::PushL(pFragment); + + pParser->ParseL(KInputString, *pFragment); + + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + if(!( *pAsXml == KOutputString1 )) return KErrArgument; + CleanupStack::PopAndDestroy(pAsXml); + + CDelegateDomFragment& delegate = pFragment->DelegateFragment(); + HBufC8* pDelegateAsXml = delegate.AsXmlL(); + CleanupStack::PushL(pDelegateAsXml); + // Note: When EReportNamespaceMapping is _NOT_ enabled namespace declaration + // is added to delegate even though that namespace declaration was + // originally declared (but not used) in root element of parsed document. + if(!( *pDelegateAsXml == + _L8("DelegateContent") )) return KErrArgument; + CleanupStack::PopAndDestroy(pDelegateAsXml); + + CleanupStack::PopAndDestroy(pFragment); + + pParser->EnableFeature(EReportNamespaceMapping); + + CMainDomFragment* pFragment2 = CMainDomFragment::NewL(_L8("nasuria"),_L8("Test"),_L8("a")); + CleanupStack::PushL(pFragment2); + + pParser->ParseL(KInputString, *pFragment2); + + HBufC8* pAsXml2 = pFragment2->AsXmlL(); + CleanupStack::PushL(pAsXml2); + if(!( *pAsXml2 == KOutputString2 )) return KErrArgument; + CleanupStack::PopAndDestroy(pAsXml2); + + CDelegateDomFragment& delegate2 = pFragment2->DelegateFragment(); + HBufC8* pDelegateAsXml2 = delegate2.AsXmlL(); + CleanupStack::PushL(pDelegateAsXml2); + if(!( *pDelegateAsXml2 == + _L8("DelegateContent") )) return KErrArgument; + CleanupStack::PopAndDestroy(pDelegateAsXml2); + + CleanupStack::PopAndDestroy(pFragment2); + + CleanupStack::PopAndDestroy(pParser); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_Parsing3L(TTestResult& aResult) + { + SetupL(); + // Parsing of XML document to CSenDomFragmentBase + // In this test same namespaceuri is defined as default namespace in + // root element and 'c' prefixed namespace in Element2. + _LIT8(KInputString, "\ +Content1\ +Content2\ +Content3\ +"); + + // Namespace declaration for prefix 'x' (and namespaceuri "nsuri") + // disappears from Element2 after parsing because default namespace + // declaration already declares namespace for uri "nsuri". + // => Double declaration for namespaceuri "nsuri" is not needed. + _LIT8(KOutputString, "\ +Content1\ +Content2\ +Content3\ +"); + + CSenParser* pParser = CSenParser::NewLC(); + + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("nasuria"),_L8("Test"),_L8("a")); + CleanupStack::PushL(pFragment); + pParser->EnableFeature(EReportNamespaceMapping); + + pParser->ParseL(KInputString, *pFragment); + + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + + if(!( *pAsXml == KOutputString )) return KErrArgument; + + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); + CleanupStack::PopAndDestroy(pParser); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_Parsing4L(TTestResult& aResult) + { + SetupL(); + // Parsing of XML document to CSenDomFragmentBase + // In this test nested elements (which have same name) are tested. + _LIT8(KInputString, "\ +\ +Content\ +\ +Content3\ +"); + + _LIT8(KInputString2, "\ +Content\ +"); + + // Only namespace declaration order changes for output. + _LIT8(KOutputString, "\ +\ +Content\ +\ +Content3\ +"); + + CSenParser* pParser = CSenParser::NewLC(); + + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("nasuria"),_L8("Test"),_L8("a")); + CleanupStack::PushL(pFragment); + pParser->EnableFeature(EReportNamespaceMapping); + + pParser->ParseL(KInputString, *pFragment); + + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + + if(!( *pAsXml == KOutputString )) return KErrArgument; + + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); + + pFragment = CSenDomFragmentBase::NewL(_L8("nsuri"),_L8("Nested")); + CleanupStack::PushL(pFragment); + pParser->EnableFeature(EReportNamespaceMapping); + + pParser->ParseL(KInputString2, *pFragment); + + pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + + if(!( *pAsXml == KInputString2 )) return KErrArgument; + + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); + + CleanupStack::PopAndDestroy(pParser); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_Parsing5L(TTestResult& aResult) + { + SetupL(); + // Parsing of XML document to CSenDomFragmentBase + // In this test nulling of default namespace is tested. +/* + _LIT8(KInputString, "\ +\ +Content\ +\ +Content3\ +"); +*/ + +/* + // Only namespace declaration order changes for output. + _LIT8(KOutputString, "\ +\ +Content\ +\ +Content3\ +"); +*/ + + CSenParser* pParser = CSenParser::NewLC(); + + /*CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("nasuria"),_L8("Test"),_L8("a")); + CleanupStack::PushL(pFragment); + pParser->EnableFeature(EReportNamespaceMapping); + + pParser->ParseL(KInputString, *pFragment); + + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + + EUNIT_ASSERT( *pAsXml == KOutputString ); + + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment);*/ + CleanupStack::PopAndDestroy(pParser); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_Parsing6L(TTestResult& aResult) + { + SetupL(); + // Parsing of XML document to CSenDomFragmentBase + // when constructor CSenDomFragmentBase::NewL() is used. + _LIT8(KInputString, "\ +Content1\ +Content2\ +Content3\ +"); + + // Default namespace declaration (xmlns="nsuri") from Parent element (Test) + // will be moved to all child elements (Element1, Element2, Element3 and + // Element4) when EReportNamespaceMapping is _NOT_ enabled. That's because + // the way CParser works <=> Namespaces are reported when namespaces are used + // for the first time. + _LIT8(KOutputString, "\ +Content1\ +Content2\ +Content3\ +"); + + CSenParser* pParser = CSenParser::NewLC(); + + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(); + CleanupStack::PushL(pFragment); + + pParser->ParseL(KInputString, *pFragment); + + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + + if(!( *pAsXml == KOutputString )) return KErrArgument; + + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); + + CleanupStack::PopAndDestroy(pParser); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_Parsing7L(TTestResult& aResult) + { + SetupL(); + // Parsing of XML document to CSenDomFragmentBase + // when constructor CSenDomFragmentBase::NewL() is used. + _LIT8(KInputString, "\ +\ +URN:UUID:ACF914D6-86A4-E5CF-4BD2-BD9CC2AD30E1\ +http://10.132.11.35/WSStar/STS.aspx\ +http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue\ +\ +\ +PCNSA15\\wsstar\ +jaszmn\\3\ +\ +\ +\ +\ +\ +http://schemas.xmlsoap.org/ws/2005/02/trust/Issue\ +\ +http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1\ +\ +\ +http://10.132.11.35/WSStar/WSService.aspx\ +\ +\ +\ +\ +"); + + // Note: If EReportNamespaceMapping is not enabled output will be following: + // (Namespace declaration for prefix "wsa" jumps from root element to + // elements (MessageID, To, Action and EndpointReference) which actually + // use above mentioned prefix. <=> Root element Envelope does not use + // "wsa" prefix.) + _LIT8(KOutputString, "\ +\ +URN:UUID:ACF914D6-86A4-E5CF-4BD2-BD9CC2AD30E1\ +http://10.132.11.35/WSStar/STS.aspx\ +http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue\ +\ +\ +PCNSA15\\wsstar\ +jaszmn\\3\ +\ +\ +\ +\ +\ +http://schemas.xmlsoap.org/ws/2005/02/trust/Issue\ +\ +http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1\ +\ +\ +http://10.132.11.35/WSStar/WSService.aspx\ +\ +\ +\ +\ +"); + + CSenParser* parser = CSenParser::NewLC(); + //create a CSenDomFragment + CSenFragmentBase* pBase = CSenDomFragmentBase::NewL(); + CleanupStack::PushL(pBase); + //do the parsing + parser->ParseL(KInputString, *pBase); + + HBufC8* pAsXml = pBase->AsXmlL(); + CleanupStack::PushL(pAsXml); + if(!( *pAsXml == KOutputString )) return KErrArgument; + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pBase); + + pBase = CSenDomFragmentBase::NewL(); + CleanupStack::PushL(pBase); + //Enable NamespaceMapping to ensure that namespace declarations will + //remain in exactly the same place as in original XML document + parser->EnableFeature(EReportNamespaceMapping); + //do the parsing + parser->ParseL(KInputString, *pBase); + + pAsXml = pBase->AsXmlL(); + CleanupStack::PushL(pAsXml); + if(!( *pAsXml == KInputString )) return KErrArgument; + CleanupStack::PopAndDestroy(pAsXml); + + CleanupStack::PopAndDestroy(pBase); + CleanupStack::PopAndDestroy(parser); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_Parsing8L(TTestResult& aResult) + { + SetupL(); + // Parsing of XML document to CSenDomFragmentBase + // when constructor CSenDomFragmentBase::NewL() is used. + _LIT8(KInputString, "\ +\ +URN:UUID:ACF914D6-86A4-E5CF-4BD2-BD9CC2AD30E1\ +http://10.132.11.35/WSStar/STS.aspx\ +http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue\ +\ +\ +PCNSA15\\wsstar\ +jaszmn\\3\ +\ +\ +\ +\ +\ +http://schemas.xmlsoap.org/ws/2005/02/trust/Issue\ +\ +http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1\ +\ +\ +http://10.132.11.35/WSStar/WSService.aspx\ +\ +\ +\ +\ +"); + + // Note: If EReportNamespaceMapping is not enabled output will be following: + // (Namespace declaration for prefix "wsa" jumps from root element to + // elements (MessageID, To, Action and EndpointReference) which actually + // use above mentioned prefix. <=> Root element Envelope does not use + // "wsa" prefix.) + _LIT8(KOutputString1, "\ +\ +http://schemas.xmlsoap.org/ws/2005/02/trust/Issue\ +\ +http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1\ +\ +\ +http://10.132.11.35/WSStar/WSService.aspx\ +\ +\ +\ +"); + + _LIT8(KOutputString2, "\ +\ +http://schemas.xmlsoap.org/ws/2005/02/trust/Issue\ +\ +http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1\ +\ +\ +http://10.132.11.35/WSStar/WSService.aspx\ +\ +\ +\ +"); + + CSenParser* parser = CSenParser::NewLC(); + //create a CSenDomFragment + CSenFragmentBase* pBase = CSenDomFragmentBase::NewL(_L8("http://www.w3.org/2003/05/soap-envelope"), + _L8("Body"), + _L8("S")); + CleanupStack::PushL(pBase); + //do the parsing + parser->ParseL(KInputString, *pBase); + + HBufC8* pAsXml = pBase->AsXmlL(); + CleanupStack::PushL(pAsXml); + if(!( *pAsXml == KOutputString1 )) return KErrArgument; + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pBase); + + pBase = CSenDomFragmentBase::NewL(_L8("http://www.w3.org/2003/05/soap-envelope"), + _L8("Body"), + _L8("S")); + CleanupStack::PushL(pBase); + //Enable NamespaceMapping to ensure that namespace declarations will + //remain in exactly the same place as in original XML document + parser->EnableFeature(EReportNamespaceMapping); + //do the parsing + parser->ParseL(KInputString, *pBase); + + pAsXml = pBase->AsXmlL(); + CleanupStack::PushL(pAsXml); + if(!( *pAsXml == KOutputString2 )) return KErrArgument; + CleanupStack::PopAndDestroy(pAsXml); + + CleanupStack::PopAndDestroy(pBase); + CleanupStack::PopAndDestroy(parser); + Teardown(); + return KErrNone; + } +/* +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_SetContentOfLL(TTestResult& aResult) + { + SetupL(); + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t")); + CleanupStack::PushL(pFragment); + pFragment->SetContentOfL(_L8("name"), _L8("content")); + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_ContentOfL(TTestResult& aResult) + { + SetupL(); + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t")); + CleanupStack::PushL(pFragment); + pFragment->ContentOf(_L8("name")); + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } +*/ + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_OnWriteStartElementLL(TTestResult& aResult) + { + SetupL(); + RTagInfo info; + RAttributeArray array; + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t")); + CleanupStack::PushL(pFragment); + pFragment->OnWriteStartElementL(info, array); + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_OnWriteEndElementLL(TTestResult& aResult) + { + SetupL(); + RTagInfo info; + + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t")); + CleanupStack::PushL(pFragment); + pFragment->OnWriteEndElementL(info); + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_OnIgnorableWhiteSpaceLL(TTestResult& aResult) + { + SetupL(); + TInt var = 0; + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t")); + CleanupStack::PushL(pFragment); + pFragment->OnIgnorableWhiteSpaceL(_L8("test"), var); + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_OnSkippedEntityLL(TTestResult& aResult) + { + SetupL(); + RString str; + TInt var = 0; + + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t")); + CleanupStack::PushL(pFragment); + pFragment->OnSkippedEntityL(str, var); + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_OnProcessingInstructionLL(TTestResult& aResult) + { + SetupL(); + TInt var = 0; + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t")); + CleanupStack::PushL(pFragment); + pFragment->OnProcessingInstructionL(_L8("test"), _L8("test"), var); + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_OnErrorL(TTestResult& aResult) + { + SetupL(); + TInt var = 0; + + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t")); + CleanupStack::PushL(pFragment); + pFragment->OnError(var); + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + +TInt CSenFragmentBCTest::MT_CSenDomFragmentBase_GetExtendedInterfaceL(TTestResult& aResult) + { + SetupL(); + const TInt32 var = 0; + + CSenDomFragmentBase* pFragment = CSenDomFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t")); + CleanupStack::PushL(pFragment); + pFragment->GetExtendedInterface(var); + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_NewLL(TTestResult& aResult) + { + SetupL(); + RSenDocument document = RSenDocument::NewL(); + CleanupClosePushL(document); + TXmlEngElement element = document.CreateDocumentElementL(_L8("Test")); + _LIT8(KElement, ""); + element.SetTextNoEncL(KElement); + + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(element); + CleanupStack::PushL(pFragment); + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + // Test that when CSenFragmentBase is serialized '<' and '>' characters + // are NOT encoded => The content of CSenFragmentBase can include + // XML elements + if(!( *pAsXml == _L8("") )) return KErrArgument; + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); + CleanupStack::PopAndDestroy(&document); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_NewL_1L(TTestResult& aResult) + { + SetupL(); + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("Test")); + CleanupStack::PushL(pFragment); + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + if(!( *pAsXml == _L8("") )) return KErrArgument; + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_NewL_2L(TTestResult& aResult) + { + SetupL(); + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("NsUri"), + _L8("Test")); + CleanupStack::PushL(pFragment); + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + if(!( *pAsXml == _L8("") )) return KErrArgument; + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_NewL_3L(TTestResult& aResult) + { + SetupL(); + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t")); + CleanupStack::PushL(pFragment); + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + if(!( *pAsXml == _L8("") )) return KErrArgument; + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_NewL_4L(TTestResult& aResult) + { + SetupL(); + RStringPool stringPool; + stringPool.OpenL(); + CleanupClosePushL(stringPool); + + RString nsUriRString = stringPool.OpenStringL(_L8("nsuri")); + CleanupClosePushL(nsUriRString); + RString nsPrefixRString = stringPool.OpenStringL(_L8("pr")); + CleanupClosePushL(nsPrefixRString); + RString localNameRString = stringPool.OpenStringL(_L8("LocalName")); + CleanupClosePushL(localNameRString); + RString valueRString = stringPool.OpenStringL(_L8("Value")); + CleanupClosePushL(valueRString); + + RAttribute attribute; + attribute.Open(nsUriRString, nsPrefixRString, localNameRString, + valueRString ); + // attribute took ownership of all RStrings + // => All RStrings can be pop from CleanupStack + CleanupStack::Pop(&valueRString); + CleanupStack::Pop(&localNameRString); + CleanupStack::Pop(&nsPrefixRString); + CleanupStack::Pop(&nsUriRString); + + CleanupClosePushL(attribute); + + RAttributeArray attrArray; + // append the namespace attribute (declaration) + attrArray.AppendL(attribute); + CleanupClosePushL(attrArray); + + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t"), + attrArray); + CleanupStack::PushL(pFragment); + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + if(!( *pAsXml == _L8("") )) return KErrArgument; + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); + CleanupStack::PopAndDestroy(&attrArray); + CleanupStack::PopAndDestroy(&attribute); + CleanupStack::PopAndDestroy(&stringPool); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_NewL_5L(TTestResult& aResult) + { + SetupL(); + RSenDocument document = RSenDocument::NewL(); + CleanupClosePushL(document); + TXmlEngElement parentElement = document.CreateDocumentElementL(_L8("Parent")); + + RStringPool stringPool; + stringPool.OpenL(); + CleanupClosePushL(stringPool); + + RString nsUriRString = stringPool.OpenStringL(_L8("nsuri")); + CleanupClosePushL(nsUriRString); + RString nsPrefixRString = stringPool.OpenStringL(_L8("pr")); + CleanupClosePushL(nsPrefixRString); + RString localNameRString = stringPool.OpenStringL(_L8("LocalName")); + CleanupClosePushL(localNameRString); + RString valueRString = stringPool.OpenStringL(_L8("Value")); + CleanupClosePushL(valueRString); + + RAttribute attribute; + attribute.Open(nsUriRString, nsPrefixRString, localNameRString, + valueRString); + // attribute took ownership of all RStrings + // => All RStrings can be pop from CleanupStack + CleanupStack::Pop(&valueRString); + CleanupStack::Pop(&localNameRString); + CleanupStack::Pop(&nsPrefixRString); + CleanupStack::Pop(&nsUriRString); + + CleanupClosePushL(attribute); + + RAttributeArray attrArray; + // append the namespace attribute (declaration) + attrArray.AppendL(attribute); + CleanupClosePushL(attrArray); + + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t"), + attrArray, + parentElement); + CleanupStack::PushL(pFragment); + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + if(!( *pAsXml == _L8("") )) return KErrArgument; + + RBuf8 buffer; + parentElement.OuterXmlL(buffer); + + if(!( buffer == _L8("") )) return KErrArgument; + buffer.Close(); + + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); + CleanupStack::PopAndDestroy(&attrArray); + CleanupStack::PopAndDestroy(&attribute); + CleanupStack::PopAndDestroy(&stringPool); + CleanupStack::PopAndDestroy(&document); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_NewL_6L(TTestResult& aResult) + { + SetupL(); + RSenDocument document = RSenDocument::NewL(); + CleanupClosePushL(document); + TXmlEngElement parentElement = document.CreateDocumentElementL(_L8("Parent")); + + RStringPool stringPool; + stringPool.OpenL(); + CleanupClosePushL(stringPool); + + RString nsUriRString = stringPool.OpenStringL(_L8("nsuri")); + CleanupClosePushL(nsUriRString); + RString nsPrefixRString = stringPool.OpenStringL(_L8("pr")); + CleanupClosePushL(nsPrefixRString); + RString localNameRString = stringPool.OpenStringL(_L8("LocalName")); + CleanupClosePushL(localNameRString); + RString valueRString = stringPool.OpenStringL(_L8("Value")); + CleanupClosePushL(valueRString); + + RAttribute attribute; + attribute.Open(nsUriRString, nsPrefixRString, localNameRString, + valueRString); + // attribute took ownership of all RStrings + // => All RStrings can be pop from CleanupStack + CleanupStack::Pop(&valueRString); + CleanupStack::Pop(&localNameRString); + CleanupStack::Pop(&nsPrefixRString); + CleanupStack::Pop(&nsUriRString); + + CleanupClosePushL(attribute); + + RAttributeArray attrArray; + // append the namespace attribute (declaration) + attrArray.AppendL(attribute); + CleanupClosePushL(attrArray); + + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8(""), + attrArray, + parentElement, + document); + CleanupStack::PushL(pFragment); + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + if(!( *pAsXml == _L8("") )) return KErrArgument; + + RBuf8 buffer; + parentElement.OuterXmlL(buffer); + + if(!( buffer == _L8("") )) return KErrArgument; + buffer.Close(); + + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); + CleanupStack::PopAndDestroy(&attrArray); + CleanupStack::PopAndDestroy(&attribute); + CleanupStack::PopAndDestroy(&stringPool); + CleanupStack::PopAndDestroy(&document); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_NewL_7L(TTestResult& aResult) + { + SetupL(); + RSenDocument document = RSenDocument::NewL(); + CleanupClosePushL(document); + TXmlEngElement parentElement = document.CreateDocumentElementL(_L8("Parent")); + + RStringPool stringPool; + stringPool.OpenL(); + CleanupClosePushL(stringPool); + + RString nsUriRString = stringPool.OpenStringL(_L8("nsuri")); + CleanupClosePushL(nsUriRString); + RString nsPrefixRString = stringPool.OpenStringL(_L8("pr")); + CleanupClosePushL(nsPrefixRString); + RString localNameRString = stringPool.OpenStringL(_L8("LocalName")); + CleanupClosePushL(localNameRString); + RString valueRString = stringPool.OpenStringL(_L8("Value")); + CleanupClosePushL(valueRString); + + RAttribute attribute; + attribute.Open(nsUriRString, nsPrefixRString, localNameRString, + valueRString); + // attribute took ownership of all RStrings + // => All RStrings can be pop from CleanupStack + CleanupStack::Pop(&valueRString); + CleanupStack::Pop(&localNameRString); + CleanupStack::Pop(&nsPrefixRString); + CleanupStack::Pop(&nsUriRString); + + CleanupClosePushL(attribute); + + RAttributeArray attrArray; + // append the namespace attribute (declaration) + attrArray.AppendL(attribute); + CleanupClosePushL(attrArray); + + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8(""), + attrArray, + parentElement, + document); + CleanupStack::PushL(pFragment); + + RSenDocument doc = pFragment->AsDocumentL(); + TXmlEngElement el = pFragment->AsElementL(); + CSenFragmentBase* pFragment2 = CSenFragmentBase::NewL(el, doc); + + CleanupStack::PopAndDestroy(pFragment); + CleanupStack::PushL(pFragment2); + + HBufC8* pAsXml = pFragment2->AsXmlL(); + CleanupStack::PushL(pAsXml); + if(!( *pAsXml == _L8("") )) return KErrArgument; + + RBuf8 buffer; + parentElement.OuterXmlL(buffer); + + if(!( buffer == _L8("") )) return KErrArgument; + buffer.Close(); + + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment2); + CleanupStack::PopAndDestroy(&attrArray); + CleanupStack::PopAndDestroy(&attribute); + CleanupStack::PopAndDestroy(&stringPool); + CleanupStack::PopAndDestroy(&document); + Teardown(); + return KErrNone; + + } + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_SetDocumentL(TTestResult& aResult) + { + SetupL(); + RSenDocument document ; + document = RSenDocument::NewL(); + + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("Test")); + CleanupStack::PushL(pFragment); + + pFragment->SetDocument(document); + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + + + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_ContentLL(TTestResult& aResult) + { + SetupL(); + RSenDocument document = RSenDocument::NewL(); + CleanupClosePushL(document); + TXmlEngElement element = document.CreateDocumentElementL(_L8("Test")); + element.SetEscapedTextL(_L8("")); + + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(element); + CleanupStack::PushL(pFragment); + + TPtrC8 content = pFragment->ContentL(); + if(!( content == _L8("") )) return KErrArgument; + + CleanupStack::PopAndDestroy(pFragment); + CleanupStack::PopAndDestroy(&document); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_NamespaceL(TTestResult& aResult) + { + SetupL(); + RStringPool stringPool; + stringPool.OpenL(); + CleanupClosePushL(stringPool); + + RString nsUriRString = stringPool.OpenStringL(_L8("nsuri")); + CleanupClosePushL(nsUriRString); + RString nsPrefixRString = stringPool.OpenStringL(_L8("pr")); + CleanupClosePushL(nsPrefixRString); + RString localNameRString = stringPool.OpenStringL(_L8("LocalName")); + CleanupClosePushL(localNameRString); + RString valueRString = stringPool.OpenStringL(_L8("Value")); + CleanupClosePushL(valueRString); + + RAttribute attribute; + attribute.Open(stringPool.OpenStringL(_L8("nsuri")), + stringPool.OpenStringL(_L8("pr")), + stringPool.OpenStringL(_L8("LocalName")), + stringPool.OpenStringL(_L8("Value")) ); + // attribute took copies of all RStrings + // => All RStrings can be destroyed + CleanupStack::PopAndDestroy(4); // nsUriRString, nsPrefixRString, localNameRString, + // valueRString + CleanupClosePushL(attribute); + + RAttributeArray attrArray; + // append the namespace attribute (declaration) + attrArray.AppendL(attribute); + CleanupClosePushL(attrArray); + + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t"), + attrArray); + CleanupStack::PushL(pFragment); + + TXmlEngNamespace ns = pFragment->Namespace(_L8("pr")); + if(!( ns.Uri() == _L8("nsuri") )) return KErrArgument; + + TXmlEngNamespace ns2 = pFragment->Namespace(_L8("x")); + if(!( ns2.IsUndefined() )) return KErrArgument; + + CleanupStack::PopAndDestroy(pFragment); + CleanupStack::PopAndDestroy(); // attribute + CleanupStack::PopAndDestroy(); // attrArray + CleanupStack::PopAndDestroy(); // stringPool + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_ResetContentLL(TTestResult& aResult) + { + SetupL(); + RSenDocument document = RSenDocument::NewL(); + CleanupClosePushL(document); + TXmlEngElement element = document.CreateDocumentElementL(_L8("Test")); + element.SetEscapedTextL(_L8("Content")); + + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(element); + CleanupStack::PushL(pFragment); + + // Test that CSenFragmentBase has content before reset + TPtrC8 content = pFragment->ContentL(); + if(!( content == _L8("Content") )) return KErrArgument; + + pFragment->ResetContentL(); + + // Test that CSenFragmentBase has no content after reset + TPtrC8 content2 = pFragment->ContentL(); + if(!( content2 == KNullDesC8 )) return KErrArgument; + + CleanupStack::PopAndDestroy(pFragment); + CleanupStack::PopAndDestroy(&document); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_LocalNameL(TTestResult& aResult) + { + SetupL(); + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t")); + CleanupStack::PushL(pFragment); + TPtrC8 localName = pFragment->LocalName(); + if(!( localName == _L8("Test") )) return KErrArgument; + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_NsUriL(TTestResult& aResult) + { + SetupL(); + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t")); + CleanupStack::PushL(pFragment); + TPtrC8 localName = pFragment->NsUri(); + if(!( localName == _L8("NsUri") )) return KErrArgument; + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_NsPrefixL(TTestResult& aResult) + { + SetupL(); + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t")); + CleanupStack::PushL(pFragment); + TPtrC8 localName = pFragment->NsPrefix(); + if(!( localName == _L8("t") )) return KErrArgument; + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_AsElementLL(TTestResult& aResult) + { + SetupL(); + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t")); + CleanupStack::PushL(pFragment); + TXmlEngElement element = pFragment->AsElementL(); + RBuf8 buffer; + CleanupClosePushL(buffer); + element.OuterXmlL(buffer); + // Serialized element should contain all the Fragment data as XML. + if(!( buffer == _L8("") )) return KErrArgument; + CleanupStack::PopAndDestroy(&buffer); + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + + } + + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_AsDocumentLL(TTestResult& aResult) + { + SetupL(); + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t")); + CleanupStack::PushL(pFragment); + RSenDocument document = pFragment->AsDocumentL(); + TXmlEngElement element = document.DocumentElement(); + + TXmlEngSerializationOptions options; + // Omit following declarations from the beginning of XML Document: + // + options.iOptions = options.iOptions | + TXmlEngSerializationOptions::KOptionOmitXMLDeclaration; + RBuf8 asXml; + document.SaveL(asXml, element, options); + CleanupClosePushL(asXml); + + // Serialized document should contain all the Fragment data as XML. + if(!( asXml == _L8("") )) return KErrArgument; + + CleanupStack::PopAndDestroy(&asXml); + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_ExtractElementL(TTestResult& aResult) + { + SetupL(); + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("NsUri"), + _L8("Test"), + _L8("t")); + CleanupStack::PushL(pFragment); + TXmlEngElement element = pFragment->ExtractElement(); + if(!( element.Name() == _L8("Test") )) return KErrArgument; + element.Remove(); + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_AsXmlUnicodeLL(TTestResult& aResult) + { + SetupL(); + // Test serialization of Dom tree which has two child elements + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("Test")); + CleanupStack::PushL(pFragment); + TXmlEngElement element = pFragment->AsElementL(); + + TXmlEngElement element2 = element.AddNewElementL(_L8("Child"), _L8("nsuri"), _L8("prefix")); + + element2.AddNewElementL(_L8("Child2"), _L8("nsuri2"), _L8("prefix2")); + + HBufC* pAsXml = pFragment->AsXmlUnicodeL(); + CleanupStack::PushL(pAsXml); + if(!( *pAsXml == _L("") )) return KErrArgument; + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_AsXmlLL(TTestResult& aResult) + { + SetupL(); + // Test serialization of Dom tree which has two child elements + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("Test")); + CleanupStack::PushL(pFragment); + TXmlEngElement element = pFragment->AsElementL(); + + TXmlEngElement element2 = element.AddNewElementL(_L8("Child"), _L8("nsuri"), _L8("prefix")); + + element2.AddNewElementL(_L8("Child2"), _L8("nsuri2"), _L8("prefix2")); + + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + if(!( *pAsXml == _L8("") )) return KErrArgument; + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_WriteAsXMLToLL(TTestResult& aResult) + { + SetupL(); + // Test serialization of Dom tree which has two child elements + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("Test")); + CleanupStack::PushL(pFragment); + TXmlEngElement element = pFragment->AsElementL(); + + TXmlEngElement element2 = element.AddNewElementL(_L8("Child"), _L8("nsuri"), _L8("prefix")); + + element2.AddNewElementL(_L8("Child2"), _L8("nsuri2"), _L8("prefix2")); + + CBufFlat* pBuf = CBufFlat::NewL(200); + CleanupStack::PushL(pBuf); + RBufWriteStream bufWs(*pBuf); + CleanupClosePushL(bufWs); + pFragment->WriteAsXMLToL(bufWs); + + + if(!( pBuf->Ptr(0) == _L8("") )) return KErrArgument; + + CleanupStack::PopAndDestroy(&bufWs); + CleanupStack::PopAndDestroy(pBuf); + + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_ConsistsOfLL(TTestResult& aResult) + { + SetupL(); + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("Test")); + CleanupStack::PushL(pFragment); + TXmlEngElement element = pFragment->AsElementL(); + + TXmlEngElement elementchild1 = element.AddNewElementL(_L8("DirectChild")); + elementchild1.AddNamespaceDeclarationL(_L8("nsuri"), _L8("prefix")); + //elementchild1.RenameNodeL(_L8("DirectChild"), _L8("nsuri"), _L8("prefix")); + //TDomUtils domUtils1; + //domUtils1.XmlEngRenameElementL(elementchild1, _L8("DirectChild"), _L8("nsuri"), _L8("prefix")); + + TXmlEngElement elementchild2 = element.AddNewElementL(_L8("DirectChild")); + elementchild2.AddNamespaceDeclarationL(_L8("nsuri"), _L8("prefix")); + //elementchild2.RenameNodeL(_L8("DirectChild"), _L8("nsuri"), _L8("prefix")); + //TDomUtils domUtils2; + //domUtils2.XmlEngRenameElementL(elementchild2, _L8("DirectChild"), _L8("nsuri"), _L8("prefix")); + elementchild2.AddNewElementL(_L8("Child"), _L8("nsuri2"), _L8("prefix2")); + + CSenFragmentBase* pFragment2 = CSenFragmentBase::NewL(_L8("Test")); + CleanupStack::PushL(pFragment2); + TXmlEngElement element2 = pFragment2->AsElementL(); + + TXmlEngElement elementchild22 = element2.AddNewElementL(_L8("DirectChild")); + elementchild22.AddNamespaceDeclarationL(_L8("nsuri"), _L8("prefix")); + //elementchild22.RenameNodeL(_L8("DirectChild"), _L8("nsuri"), _L8("prefix")); + //TDomUtils domUtils22; + //domUtils22.XmlEngRenameElementL(elementchild22, _L8("DirectChild"), _L8("nsuri"), _L8("prefix")); + elementchild22.AddNewElementL(_L8("Child"), _L8("nsuri2"), _L8("prefix2")); + + // ConsistOfL should return ETrue because + // root elements of both fragments match and the only element + // of pFragment2 = elementchild22 is exactly the same element as + // elementchild2. + if(!( pFragment->ConsistsOfL(*pFragment2) )) return KErrArgument; + + // ConsistOfL should return EFalse because + // Even though root elements of both fragments match + // there is extra element (= elementchild1) in pFragment. + // + // elementchild1 (of pFragment) can not be found from pFragment2 + // and because of that pFragment2 does not consist of pFragment. + if(!( !pFragment2->ConsistsOfL(*pFragment) )) return KErrArgument; + CleanupStack::PopAndDestroy(pFragment2); + + CSenFragmentBase* pFragment3 = CSenFragmentBase::NewL(_L8("Test")); + CleanupStack::PushL(pFragment3); + TXmlEngElement element3 = pFragment3->AsElementL(); + + TXmlEngElement elementchild32 = element3.AddNewElementL(_L8("DirectChild")); + elementchild32.AddNamespaceDeclarationL(_L8("nsuri"), _L8("prefix")); + //elementchild32.RenameNodeL(_L8("DirectChild"), _L8("nsuri"), _L8("prefix")); + //TDomUtils domUtils32; + //domUtils32.XmlEngRenameElementL(elementchild32, _L8("DirectChild"), _L8("nsuri"), _L8("prefix")); + elementchild32.AddNewElementL(_L8("Child"), _L8("nsuri2"), _L8("prefix2")); + elementchild32.SetEscapedTextL(_L8("Text")); + + // ConsistOfL should return EFalse because + // elementchild32 has content ("Text") which doesn't match + // to any child element of pFragment. + if(!( !pFragment->ConsistsOfL(*pFragment3) )) return KErrArgument; + CleanupStack::PopAndDestroy(pFragment3); + + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_Parsing1L(TTestResult& aResult) + { + SetupL(); + // Parsing of XML document to CSenFragmentBase + _LIT8(KInputString, "\ +Content1\ +Content2\ +Content3\ +"); + + // Default namespace declaration (xmlns="nsuri") from Parent element (Test) + // will be moved to all child elements (Element1, Element2, Element3 and + // Element4) when EReportNamespaceMapping is _NOT_ enabled. That's because + // the way CParser works <=> Namespaces are reported when namespaces are used. + _LIT8(KOutputString1, "\ +Content1\ +Content2\ +Content3\ +"); + + // When EReportNamespaceMapping is enabled all the namespace declarations + // are reported in exactly the same element as they are defined in parsed + // XML document. + // Note: The Order of namespace declarations in root element tag may change. + // Namespace declaration for root tag is created when fragment is created + // and because of that namespace declaration for root tag will be the first. + // In this particular case namespace declaration for prefix "a" will be + // the first namespace declaration because it is declared when + // CSenFragmentBase is created. + _LIT8(KOutputString2, "\ +Content1\ +Content2\ +Content3\ +"); + + CSenParser* pParser = CSenParser::NewLC(); + + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("nasuria"),_L8("Test"),_L8("a")); + CleanupStack::PushL(pFragment); + +/* + //tma + pParser->ParseBeginL(); + + _LIT8(KXmlParserMimeType, "text/xml"); + pParser->ParseBeginL(KXmlParserMimeType); + + CMatchData* pMatchData = CMatchData::NewLC(); + pMatchData->SetMimeTypeL(KXmlParserMimeType); + pParser->ParseBeginL(*pMatchData); + CleanupStack::PopAndDestroy(pMatchData); + //tma +*/ + + pParser->ParseL(KInputString, *pFragment); + + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + + if(!( *pAsXml == KOutputString1 )) return KErrArgument; + + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); + + pParser->EnableFeature(EReportNamespaceMapping); + + CSenFragmentBase* pFragment2 = CSenFragmentBase::NewL(_L8("nasuria"),_L8("Test"),_L8("a")); + CleanupStack::PushL(pFragment2); + + pParser->ParseL(KInputString, *pFragment2); + + HBufC8* pAsXml2 = pFragment2->AsXmlL(); + CleanupStack::PushL(pAsXml2); + + if(!( *pAsXml2 == KOutputString2 )) return KErrArgument; + + CleanupStack::PopAndDestroy(pAsXml2); + CleanupStack::PopAndDestroy(pFragment2); + + CleanupStack::PopAndDestroy(pParser); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_Parsing2L(TTestResult& aResult) + { + SetupL(); + // Parsing of XML document to CSenFragmentBase which uses + // delegation. + _LIT8(KInputString, "\ +DelegateContent\ +Content1\ +Content2"); + + // Default namespace declaration (xmlns="nsuri") from Parent element (Test) + // will be moved to all child elements (Element1, Element2, Element3 and + // Element4) when EReportNamespaceMapping is _NOT_ enabled. That's because + // the way CParser works <=> Namespaces are reported when namespaces are used + // for the first time. + // Note: In CSenFragmentBase case DelegateFragment won't be in + // content of parent fragment which did the delegation. + _LIT8(KOutputString1, "\ +Content1\ +Content2"); + + // When EReportNamespaceMapping is enabled all the namespace declarations + // are reported in exactly the same element as they are defined in parsed + // XML document. + // Note: The Order of namespace declarations in root element tag may change. + // Namespace declaration for root tag is created when fragment is created + // and because of that namespace declaration for root tag will be the first. + // Note: In CSenFragmentBase case DelegateFragment won't be in + // content of parent fragment which did the delegation. + _LIT8(KOutputString2, "\ +Content1\ +Content2"); + + CSenParser* pParser = CSenParser::NewLC(); + + CMainFragment* pFragment = CMainFragment::NewL(_L8("nasuria"),_L8("Test"),_L8("a")); + CleanupStack::PushL(pFragment); + + pParser->ParseL(KInputString, *pFragment); + + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + if(!( *pAsXml == KOutputString1 )) return KErrArgument; + CleanupStack::PopAndDestroy(pAsXml); + + CDelegateFragment& delegate = pFragment->DelegateFragment(); + HBufC8* pDelegateAsXml = delegate.AsXmlL(); + CleanupStack::PushL(pDelegateAsXml); + if(!( *pDelegateAsXml == + _L8("DelegateContent") )) return KErrArgument; + CleanupStack::PopAndDestroy(pDelegateAsXml); + + CleanupStack::PopAndDestroy(pFragment); + + pParser->EnableFeature(EReportNamespaceMapping); + + CMainFragment* pFragment2 = CMainFragment::NewL(_L8("nasuria"),_L8("Test"),_L8("a")); + CleanupStack::PushL(pFragment2); + + pParser->ParseL(KInputString, *pFragment2); + + HBufC8* pAsXml2 = pFragment2->AsXmlL(); + CleanupStack::PushL(pAsXml2); + if(!( *pAsXml2 == KOutputString2 )) return KErrArgument; + CleanupStack::PopAndDestroy(pAsXml2); + + CDelegateFragment& delegate2 = pFragment2->DelegateFragment(); + HBufC8* pDelegateAsXml2 = delegate2.AsXmlL(); + CleanupStack::PushL(pDelegateAsXml2); + if(!( *pDelegateAsXml2 == + _L8("DelegateContent") )) return KErrArgument; + CleanupStack::PopAndDestroy(pDelegateAsXml2); + + CleanupStack::PopAndDestroy(pFragment2); + + CleanupStack::PopAndDestroy(pParser); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_Parsing3L(TTestResult& aResult) + { + SetupL(); + // Parsing of XML document to CSenFragmentBase + _LIT8(KInputString, "\ +Content1\ +Content2\ +Content3\ +"); + + _LIT8(KOutputString, "\ +Content1\ +Content2\ +Content3\ +"); + + CSenParser* pParser = CSenParser::NewLC(); + + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("nasuria"),_L8("Test"),_L8("a")); + CleanupStack::PushL(pFragment); + pParser->EnableFeature(EReportNamespaceMapping); + + pParser->ParseL(KInputString, *pFragment); + + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + + if(!( *pAsXml == KOutputString )) return KErrArgument; + + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); + CleanupStack::PopAndDestroy(pParser); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_Parsing4L(TTestResult& aResult) + { + SetupL(); + // Parsing of XML document to CSenFragmentBase + // In this test nested elements (which have same name) are tested. + _LIT8(KInputString, "\ +\ +Content\ +\ +Content3\ +"); + + _LIT8(KInputString2, "\ +Content\ +"); + + // Only namespace declaration order changes for output. + // Element4 which has no content will be output with + // start and end tags. + _LIT8(KOutputString, "\ +\ +Content\ +\ +Content3\ +"); + + CSenParser* pParser = CSenParser::NewLC(); + + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("nasuria"),_L8("Test"),_L8("a")); + CleanupStack::PushL(pFragment); + pParser->EnableFeature(EReportNamespaceMapping); + + pParser->ParseL(KInputString, *pFragment); + + HBufC8* pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + + if(!( *pAsXml == KOutputString )) return KErrArgument; + + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); + + pFragment = CSenFragmentBase::NewL(_L8("nsuri"),_L8("Nested")); + CleanupStack::PushL(pFragment); + pParser->EnableFeature(EReportNamespaceMapping); + + pParser->ParseL(KInputString2, *pFragment); + + pAsXml = pFragment->AsXmlL(); + CleanupStack::PushL(pAsXml); + + if(!( *pAsXml == KInputString2 )) return KErrArgument; + + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pFragment); + + CleanupStack::PopAndDestroy(pParser); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenFragmentBase_Parsing5L(TTestResult& aResult) + { + SetupL(); + // Parsing of XML document to CSenDomFragmentBase + // when constructor CSenDomFragmentBase::NewL() is used. + _LIT8(KInputString, "\ +\ +URN:UUID:ACF914D6-86A4-E5CF-4BD2-BD9CC2AD30E1\ +http://10.132.11.35/WSStar/STS.aspx\ +http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue\ +\ +\ +PCNSA15\\wsstar\ +jaszmn\\3\ +\ +\ +\ +\ +\ +http://schemas.xmlsoap.org/ws/2005/02/trust/Issue\ +\ +http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1\ +\ +\ +http://10.132.11.35/WSStar/WSService.aspx\ +\ +\ +\ +\ +"); + + // Note: If EReportNamespaceMapping is not enabled output will be following: + // (Namespace declaration for prefix "wsa" jumps from root element to + // elements (MessageID, To, Action and EndpointReference) which actually + // use above mentioned prefix. <=> Root element Envelope does not use + // "wsa" prefix.) + _LIT8(KOutputString1, "\ +\ +http://schemas.xmlsoap.org/ws/2005/02/trust/Issue\ +\ +http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1\ +\ +\ +http://10.132.11.35/WSStar/WSService.aspx\ +\ +\ +\ +"); + + _LIT8(KOutputString2, "\ +\ +http://schemas.xmlsoap.org/ws/2005/02/trust/Issue\ +\ +http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1\ +\ +\ +http://10.132.11.35/WSStar/WSService.aspx\ +\ +\ +\ +"); + + CSenParser* parser = CSenParser::NewLC(); + //create a CSenDomFragment + CSenFragmentBase* pBase = CSenFragmentBase::NewL(_L8("http://www.w3.org/2003/05/soap-envelope"), + _L8("Body"), + _L8("S")); + CleanupStack::PushL(pBase); + //do the parsing + parser->ParseL(KInputString, *pBase); + + HBufC8* pAsXml = pBase->AsXmlL(); + CleanupStack::PushL(pAsXml); + if(!( *pAsXml == KOutputString1 )) return KErrArgument; + CleanupStack::PopAndDestroy(pAsXml); + CleanupStack::PopAndDestroy(pBase); + + pBase = CSenFragmentBase::NewL(_L8("http://www.w3.org/2003/05/soap-envelope"), + _L8("Body"), + _L8("S")); + CleanupStack::PushL(pBase); + //Enable NamespaceMapping to ensure that namespace declarations will + //remain in exactly the same place as in original XML document + parser->EnableFeature(EReportNamespaceMapping); + //do the parsing + parser->ParseL(KInputString, *pBase); + + pAsXml = pBase->AsXmlL(); + CleanupStack::PushL(pAsXml); + if(!( *pAsXml == KOutputString2 )) return KErrArgument; + CleanupStack::PopAndDestroy(pAsXml); + + CleanupStack::PopAndDestroy(pBase); + CleanupStack::PopAndDestroy(parser); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenParser_NewLL(TTestResult& aResult) + { + SetupL(); + CSenParser* pParser = CSenParser::NewL(); + delete pParser; + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenParser_NewLCL(TTestResult& aResult) + { + SetupL(); + CSenParser* pParser = CSenParser::NewLC(); + CleanupStack::PopAndDestroy(pParser); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenParser_NewL_1L(TTestResult& aResult) + { + SetupL(); + _LIT8(KXmlParserMimeType, "text/xml"); + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("Test")); + CleanupStack::PushL(pFragment); + CParser* pParser = CParser::NewL(KXmlParserMimeType, *pFragment); + + // Ownership of the pParser is transfered to pSenParser + CSenParser* pSenParser = CSenParser::NewL(pParser); + delete pSenParser; + + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenParser_NewLC_1L(TTestResult& aResult) + { + SetupL(); + _LIT8(KXmlParserMimeType, "text/xml"); + CSenFragmentBase* pFragment = CSenFragmentBase::NewL(_L8("Test")); + CleanupStack::PushL(pFragment); + CParser* pParser = CParser::NewL(KXmlParserMimeType, *pFragment); + + // Ownership of the pParser is transfered to pSenParser + CSenParser* pSenParser = CSenParser::NewLC(pParser); + CleanupStack::PopAndDestroy(pSenParser); + + CleanupStack::PopAndDestroy(pFragment); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenParser_NewL_2L(TTestResult& aResult) + { + SetupL(); + _LIT8(KXmlParserMimeType, "text/xml"); + CSenParser* pParser = CSenParser::NewL(KXmlParserMimeType); + delete pParser; + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_CSenParser_NewLC_2L(TTestResult& aResult) + { + SetupL(); + _LIT8(KXmlParserMimeType, "text/xml"); + CSenParser* pParser = CSenParser::NewLC(KXmlParserMimeType); + CleanupStack::PopAndDestroy(pParser); + Teardown(); + return KErrNone; + } +/* +#if defined( __SERIES60_31__ ) || (!defined( __SERIES60_30__ ) && defined( SYMBIAN_SWI_POST_INSTALL_REVOCATION) ) + +TInt CSenFragmentBCTest::MT_CSenParser_NewL_3L(TTestResult& aResult) + { + SetupL(); + _LIT8(KXmlParserMimeType, "text/xml"); + CMatchData* pMatchData = CMatchData::NewLC(); + pMatchData->SetMimeTypeL(KXmlParserMimeType); + CSenParser* pParser = CSenParser::NewL(*pMatchData); + delete pParser; + CleanupStack::PopAndDestroy(pMatchData); + Teardown(); + return KErrNone; + } + +TInt CSenFragmentBCTest::MT_CSenParser_NewLC_3L(TTestResult& aResult) + { + SetupL(); + _LIT8(KXmlParserMimeType, "text/xml"); + CMatchData* pMatchData = CMatchData::NewLC(); + pMatchData->SetMimeTypeL(KXmlParserMimeType); + CSenParser* pParser = CSenParser::NewLC(*pMatchData); + CleanupStack::PopAndDestroy(pParser); + CleanupStack::PopAndDestroy(pMatchData); + Teardown(); + return KErrNone; + } + +#endif + +*/ +TInt CSenFragmentBCTest::MT_RSenDocument_NewLL(TTestResult& aResult) + { + SetupL(); + RSenDocument document = RSenDocument::NewL(); + document.Close(); + if(!( document.IsNull() )) return KErrArgument; + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_RSenDocument_NewLCL(TTestResult& aResult) + { + SetupL(); + RSenDocument document = RSenDocument::NewLC(); + CleanupStack::PopAndDestroy(); + + // Can't use IsNull() function because iInternal pointer + // (of document) is not NULLed. Only data for which iInternal + // points to is deleted. + //EUNIT_ASSERT( document.IsNull() ); + Teardown(); + return KErrNone; + } + +TInt CSenFragmentBCTest::MT_RSenDocument_NewL_1L(TTestResult& aResult) + { + SetupL(); + // Can't test RSenDocument::NewL(void* aInternal) + // because there is no way to get proper aInternal + // using public API. + if(!( ETrue )) return KErrArgument; + Teardown(); + return KErrNone; + } + +TInt CSenFragmentBCTest::MT_RSenDocument_NewLC_1L(TTestResult& aResult) + { + SetupL(); + // Can't test RSenDocument::NewLC(void* aInternal) + // because there is no way to get proper aInternal + // using public API. + if(!( ETrue )) return KErrArgument; + Teardown(); + return KErrNone; + } + +TInt CSenFragmentBCTest::MT_RSenDocument_CopyL(TTestResult& aResult) + { + SetupL(); + RSenDocument document1 = RSenDocument::NewL(); + TXmlEngElement element = document1.CreateDocumentElementL(_L8("Test")); + + element.AddTextL(_L8("testcontent")); + + RSenDocument document2 = document1.Copy(); + + // Check that main elements of document1 and document2 + // are pointing to the same "in memory node" after copying. + if(!( element.IsSameNode(document2.DocumentElement()) )) return KErrArgument; + + // Test that document2 contains the same data as document1 + // did contain before closing document1. + document1.Close(); + RBuf8 asXml; + TXmlEngSerializationOptions options; + options.iOptions = options.iOptions | + TXmlEngSerializationOptions::KOptionOmitXMLDeclaration; + document2.SaveL(asXml, element, options); + CleanupClosePushL(asXml); + if(!( asXml == _L8("testcontent") )) return KErrArgument; + CleanupStack::PopAndDestroy(&asXml); + + document2.Close(); + if(!( document1.IsNull() && document2.IsNull() )) return KErrArgument; + Teardown(); + return KErrNone; + } + +TInt CSenFragmentBCTest::MT_RSenDocument_CloseL(TTestResult& aResult) + { + SetupL(); + RSenDocument document = RSenDocument::NewL(); + document.Close(); + if(!( document.IsNull() )) return KErrArgument; + Teardown(); + return KErrNone; + } + +TInt CSenFragmentBCTest::MT_RSenDocument_DestroyL(TTestResult& aResult) + { + SetupL(); + RSenDocument document = RSenDocument::NewL(); + document.Destroy(); + if(!( document.IsNull() )) return KErrArgument; + Teardown(); + return KErrNone; + } + +TInt CSenFragmentBCTest::MT_RSenDocument_ManualXmlEngineTlsAttachLL(TTestResult& aResult) + { + SetupL(); + RSenDocument document = RSenDocument::NewL(); + TInt retVal = document.ManualXmlEngineTlsAttachL(); + TL(retVal == KErrNone || retVal == KErrUnknown || retVal == KErrAlreadyExists); + Teardown(); + return KErrNone; + } + +TInt CSenFragmentBCTest::MT_RSenDocument_ManualXmlEngineTlsCleanupL(TTestResult& aResult) + { + SetupL(); + RSenDocument document = RSenDocument::NewL(); + TInt retVal = document.ManualXmlEngineTlsCleanup(); + TL(retVal == KErrNone || retVal == KErrNotFound ); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_TestFragmentBase_SetContentLL(TTestResult& aResult) + { + SetupL(); + CTestFragmentBase* pFragment = CTestFragmentBase::NewL(_L8("Test")); + pFragment->SetContentL(_L8("Test")); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_TestFragmentBase_AddContentLL(TTestResult& aResult) + { + SetupL(); + CTestFragmentBase* pFragment = CTestFragmentBase::NewL(_L8("Test")); + pFragment->AddContentL(_L8("Test")); + Teardown(); + return KErrNone; + } + + +TInt CSenFragmentBCTest::MT_TestDomFragmentBase_SetContentOfLL(TTestResult& aResult) + { + SetupL(); + _LIT8(KText, "Test1"); + CTestDomFragmentBase* pFragment = CTestDomFragmentBase::NewL(_L8("Test")); + pFragment->SetContentOfL(_L8("Test"), _L8("Test1")); + TPtrC8 ptr = pFragment->ContentOf(_L8("Test")); + TL(ptr == KText); + Teardown(); + return KErrNone; + } +/* +TInt CSenFragmentBCTest::MT_TestDomFragmentBase_ContentOfL(TTestResult& aResult) + { + SetupL(); + Teardown(); + return KErrNone; + } + +*/ + +// End of File