# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1279212838 -10800 # Node ID f68f0715725029bfcde59676c8833b98b4c0b9bc # Parent b72ea8487adbb89287f78c6918cb95609304589d Revision: 201025 Kit: 2010127 diff -r b72ea8487adb -r f68f07157250 webservices/wsmessages/src/sensoapenvelope2.cpp --- a/webservices/wsmessages/src/sensoapenvelope2.cpp Mon Jun 21 16:54:52 2010 +0300 +++ b/webservices/wsmessages/src/sensoapenvelope2.cpp Thu Jul 15 19:53:58 2010 +0300 @@ -188,7 +188,8 @@ : ipBodyFragment(NULL), ipHeaderFragment(NULL), ipSoapAction(NULL), - iFault(EFalse) + iFault(EFalse), + iTransactionId(KErrNotFound) { } diff -r b72ea8487adb -r f68f07157250 webservices/wsoviplugin/src/wsoviplugin.cpp --- a/webservices/wsoviplugin/src/wsoviplugin.cpp Mon Jun 21 16:54:52 2010 +0300 +++ b/webservices/wsoviplugin/src/wsoviplugin.cpp Thu Jul 15 19:53:58 2010 +0300 @@ -336,6 +336,7 @@ case KSenEventWsfReady: { TPtrC8 imsi = iManager.IMSI(); + //On SIM Change below code resets the KSenAccAutoSignIn flag if (iIMSI.Compare(imsi)) { const RPointerArray list = iManager.IdentityProvidersL(); @@ -346,6 +347,8 @@ if (el) { delete (el->RemoveElement(KSenAccAutoSignIn)); + _LIT8(KWSAccAttrAccountValidator, "Validator"); + delete (el->RemoveElement(KWSAccAttrAccountValidator)); ((MSenCredentialManager&)iManager).RemoveCredentialsL(list[i]->ProviderID()); } //((MSenCredentialManager&)iManager).RemoveCredentialsL(list[i]->ProviderID()); diff -r b72ea8487adb -r f68f07157250 webservices/wsxml/src/senbaseelement.cpp --- a/webservices/wsxml/src/senbaseelement.cpp Mon Jun 21 16:54:52 2010 +0300 +++ b/webservices/wsxml/src/senbaseelement.cpp Thu Jul 15 19:53:58 2010 +0300 @@ -269,7 +269,9 @@ CSenBaseAttribute* pAttribute = CSenBaseAttribute::NewL(aQName, aLocalName, aValue); + CleanupStack::PushL(pAttribute); AddAttributeL(pAttribute); + CleanupStack::Pop(pAttribute); } return aValue; } @@ -487,8 +489,16 @@ CSenBaseAttribute* pAttr = FindAttr(aName); if (pAttr == NULL) { - User::LeaveIfError(iAttrs.Append(CSenBaseAttribute::NewL(aName, - aValue))); + //Create new baseAttribute object + CSenBaseAttribute* newBaseAttribute = CSenBaseAttribute::NewL(aName, aValue); + //Push to cleanupstack + CleanupStack::PushL(newBaseAttribute); + + //Add the new baseAttribute to existing Attribute list + User::LeaveIfError(iAttrs.Append(newBaseAttribute)); + + //Pop from CleanupStack + CleanupStack::Pop(newBaseAttribute); } else { @@ -632,7 +642,19 @@ EXPORT_C CSenElement& CSenBaseElement::AddElementL(const TDesC8& aNsUri, const TDesC8& aLocalName) { - return AddElementL(*CSenBaseElement::NewL(aNsUri, aLocalName)); + //Create new baseElement + CSenBaseElement *newBaseElement = CSenBaseElement::NewL(aNsUri, aLocalName); + //Push it to CleanupStack + CleanupStack::PushL(newBaseElement); + + //Add the baseElement + CSenElement& newAddedElement = AddElementL(*newBaseElement); + + //Pop baseElement from CleanupStack + CleanupStack::Pop(newBaseElement); + + //Return the newly added element (got from the AddElement() API) + return newAddedElement; } EXPORT_C CSenElement& CSenBaseElement::AddElementL( @@ -641,12 +663,36 @@ const TDesC8& aQName ) { - return AddElementL(*CSenBaseElement::NewL(aNsUri, aLocalName, aQName)); + //Create new baseElement + CSenBaseElement *newBaseElement = CSenBaseElement::NewL(aNsUri, aLocalName, aQName); + //Push it to CleanupStack + CleanupStack::PushL(newBaseElement); + + //Add the baseElement + CSenElement& newAddedElement = AddElementL(*newBaseElement); + + //Pop baseElement from CleanupStack + CleanupStack::Pop(newBaseElement); + + //Return the newly added element (got from the AddElement() API) + return newAddedElement; } EXPORT_C CSenElement& CSenBaseElement::AddElementL(const TDesC8& aLocalName) { - return AddElementL(*CSenBaseElement::NewL(aLocalName)); + //Create new baseElement + CSenBaseElement *newBaseElement = CSenBaseElement::NewL(aLocalName); + //Push it to CleanupStack + CleanupStack::PushL(newBaseElement); + + //Add the baseElement + CSenElement& newAddedElement = AddElementL(*newBaseElement); + + //Pop baseElement from CleanupStack + CleanupStack::Pop(newBaseElement); + + //Return the newly added element (got from the AddElement() API) + return newAddedElement; } EXPORT_C CSenElement* CSenBaseElement::RemoveElement(CSenElement& aElement) diff -r b72ea8487adb -r f68f07157250 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 Mon Jun 21 16:54:52 2010 +0300 +++ b/websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/group/testhc_c.bat Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Mon Jun 21 16:54:52 2010 +0300 +++ b/websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/group/testhc_z.bat Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Mon Jun 21 16:54:52 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 b72ea8487adb -r f68f07157250 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 b72ea8487adb -r f68f07157250 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 Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 b72ea8487adb -r f68f07157250 websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/src/hostletconnectioncases.cpp --- a/websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/src/hostletconnectioncases.cpp Mon Jun 21 16:54:52 2010 +0300 +++ b/websrv_pub/hostlet_connection_api/tsrc/bc/hostconn/src/hostletconnectioncases.cpp Thu Jul 15 19:53:58 2010 +0300 @@ -2821,7 +2821,6 @@ // is KSenConnectionStatusReady LOCAL_ASSERT( ipConsumer->iConnectionStatus == KSenConnectionStatusCreateFailed); -/* // Check that NO HandleErrorL callback was received: LOCAL_ASSERT( ipConsumer->iErrorCode == KErrNone ); diff -r b72ea8487adb -r f68f07157250 websrv_pub/web_service_connection_api/tsrc/bc/connection/group/senserviceconnection.mmp --- a/websrv_pub/web_service_connection_api/tsrc/bc/connection/group/senserviceconnection.mmp Mon Jun 21 16:54:52 2010 +0300 +++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/group/senserviceconnection.mmp Thu Jul 15 19:53:58 2010 +0300 @@ -70,7 +70,6 @@ LIBRARY eikctl.lib LIBRARY egul.lib LIBRARY fbscli.lib -LIBRARY PBKENG.LIB LIBRARY cntmodel.lib LIBRARY aknskins.lib //for skin sbackground LIBRARY gdi.lib diff -r b72ea8487adb -r f68f07157250 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 Mon Jun 21 16:54:52 2010 +0300 +++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/group/testsc_c.bat Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Mon Jun 21 16:54:52 2010 +0300 +++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/group/testsc_z.bat Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 websrv_pub/web_service_connection_api/tsrc/bc/connection/inc/TestConnection.h --- a/websrv_pub/web_service_connection_api/tsrc/bc/connection/inc/TestConnection.h Mon Jun 21 16:54:52 2010 +0300 +++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/inc/TestConnection.h Thu Jul 15 19:53:58 2010 +0300 @@ -68,7 +68,7 @@ //MSENFRAGMENT - CSenElement& AsElement() ; +// CSenElement& AsElement() ; CSenElement* ExtractElement() ; void SetReader(CSenXmlReader& aReader) ; CSenXmlReader* Reader() ; diff -r b72ea8487adb -r f68f07157250 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 Mon Jun 21 16:54:52 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 b72ea8487adb -r f68f07157250 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 b72ea8487adb -r f68f07157250 websrv_pub/web_service_connection_api/tsrc/bc/connection/src/TestConnection.cpp --- a/websrv_pub/web_service_connection_api/tsrc/bc/connection/src/TestConnection.cpp Mon Jun 21 16:54:52 2010 +0300 +++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/src/TestConnection.cpp Thu Jul 15 19:53:58 2010 +0300 @@ -176,7 +176,7 @@ } MSenMessage* CTestConnection::Response() { - TInt retval(0); + //TInt retval(0); // TRAP(retval, iConn->Response()); return NULL; } @@ -205,13 +205,12 @@ //MSenFragment -CSenElement& CTestConnection::AsElement() +/*CSenElement& CTestConnection::AsElement() { - -} +}*/ CSenElement* CTestConnection::ExtractElement() { - + return NULL; } void CTestConnection::SetReader(CSenXmlReader& aReader) { @@ -219,7 +218,7 @@ } CSenXmlReader* CTestConnection::Reader() { - + return NULL; } void CTestConnection::ParseL(const TDesC8& aBuf) { @@ -227,7 +226,7 @@ } TInt CTestConnection::BuildFrom(const TDesC8& aBuf) { - + return NULL; } void CTestConnection::DelegateParsingL(MSenFragment& aDelegate) { @@ -277,17 +276,17 @@ const TDesC8& CTestConnection::LocalName() const { - + return KNullDesC8(); } const TDesC8& CTestConnection::NsUri() const { - + return KNullDesC8(); } const TDesC8& CTestConnection::NsPrefix() const { - + return KNullDesC8(); } void CTestConnection::WriteAsXMLToL(RWriteStream& aWriteStream) @@ -297,16 +296,16 @@ HBufC* CTestConnection::AsXmlUnicodeL() { - + return NULL; } HBufC8* CTestConnection::AsXmlL() { - + return NULL; } TBool CTestConnection::ConsistsOfL(MSenFragment& aCandidate) { - + return NULL; } //CACTIVE diff -r b72ea8487adb -r f68f07157250 websrv_pub/web_service_connection_api/tsrc/bc/connection/src/senserviceconnectioncases.cpp --- a/websrv_pub/web_service_connection_api/tsrc/bc/connection/src/senserviceconnectioncases.cpp Mon Jun 21 16:54:52 2010 +0300 +++ b/websrv_pub/web_service_connection_api/tsrc/bc/connection/src/senserviceconnectioncases.cpp Thu Jul 15 19:53:58 2010 +0300 @@ -46,8 +46,8 @@ //#include #include "testproperty.h" -#include -#include +#include +#include //#include #include // for CActive @@ -83,11 +83,11 @@ _LIT8(KTestPassword, "012345678901234"); #elif VALIMO_ADDRESSBOOK_SERVICE // Addressbook service hosted inside Nokia intra by ASP / testing team - _LIT8(KWSPContract, "urn:nokia:test:addrbook:2004-09"); +// _LIT8(KWSPContract, "urn:nokia:test:addrbook:2004-09"); _LIT8(KAuthServEndpoint, "http://10.21.32.110/tfs/IDPSSO_IDWSF10"); - _LIT8(KASProviderID, "provider01"); - _LIT8(KTestAuthzID, "john"); - _LIT8(KTestPassword, "password"); +// _LIT8(KASProviderID, "provider01"); +// _LIT8(KTestAuthzID, "john"); +// _LIT8(KTestPassword, "password"); #elif SYSOPENDIGIA_ADDRESSBOOK_SERVICE _LIT8(KWSPContract, "urn:nokia:test:addrbook:2004-09"); _LIT8(KAuthServEndpoint, "http://ys01liw022.partner.yomi.com:9080/tfs/IDPSSO_IDWSF"); @@ -104,8 +104,8 @@ #endif // FN_ADDRESSBOOK_SERVICE - _LIT8(KASContract, "urn:liberty:as:2004-04"); - _LIT8(KHttpsEndPoint, "https://10.21.32.110/sereneHardCoded/WS_WSI_R9980_001" ); +// _LIT8(KASContract, "urn:liberty:as:2004-04"); +// _LIT8(KHttpsEndPoint, "https://10.21.32.110/sereneHardCoded/WS_WSI_R9980_001" ); _LIT8(KWSIFrameworkID, "WS-I"); _LIT8(KIDWSFFrameworkID, "ID-WSF"); @@ -133,21 +133,21 @@ // ARMv5 _LIT(KIAPName, "Internet"); #endif - _LIT8(KLoggerFileNameProperty, "HttpLoggerFileName"); - - _LIT(KFileToRead, "c:\\Logs\\LoggingHttpFilter\\httptrace.xml"); - _LIT8(KFileName, "httptrace.xml"); - - _LIT8(KHTTPMethodGet, "GET"); - _LIT8(KHTTPMethodPost, "POST"); +// _LIT8(KLoggerFileNameProperty, "HttpLoggerFileName"); + +// _LIT(KFileToRead, "c:\\Logs\\LoggingHttpFilter\\httptrace.xml"); +// _LIT8(KFileName, "httptrace.xml"); + +// _LIT8(KHTTPMethodGet, "GET"); +// _LIT8(KHTTPMethodPost, "POST"); // const TBool MultipleSimultanousRHttpSessionsSupported = EFalse; // If IAP changes all previously sent messages will be canceled. //_LIT8(KProxyHost, "esprx00.nokia.com"); - _LIT8(KProxyHost, "172.19.160.50"); // IP address to: bsprx01.americas.nokia.com - const TInt KProxyPort = 8080; +// _LIT8(KProxyHost, "172.19.160.50"); // IP address to: bsprx01.americas.nokia.com +// const TInt KProxyPort = 8080; //MSN Constants : //--------------- @@ -155,7 +155,7 @@ _LIT8(KPassportPass, "M1nkk1s"); _LIT8(KStsEndpoint, "https://login.live.com/rst2.srf"); - _LIT8(KMSNProxy, "tcp.mws.mobile.live.com"); +// _LIT8(KMSNProxy, "tcp.mws.mobile.live.com"); //_LIT8(KMetadataEndpoint, "http://10.132.11.31/WSStar/secpolicy/secpol.xml"); _LIT8(KMetadataEndpoint, "https://http.mws.mobile.live.com/2006/10/MWP2007_02/SecurityPolicy/Default.aspx"); @@ -597,6 +597,7 @@ CleanupStack::PopAndDestroy(pattern); CleanupStack::PopAndDestroy(manager); + return error; } TInt CSenServiceConnectionBCTest::RegisterSTSInvalidPasswordL() @@ -630,6 +631,7 @@ CleanupStack::PopAndDestroy(pattern); CleanupStack::PopAndDestroy(manager); + return error; } TInt CSenServiceConnectionBCTest::UnregisterSTSL() @@ -663,6 +665,7 @@ CleanupStack::PopAndDestroy(pattern); CleanupStack::PopAndDestroy(manager); + return error; } TInt CSenServiceConnectionBCTest::SetPolicyL( CSenXmlServiceDescription* pServDesc, @@ -677,11 +680,13 @@ if(pValue==KNullDesC8()) { - clientPolicy->AddElementL(pName); + TRAPD(err, clientPolicy->AddElementL(pName)); + return err; } else { - clientPolicy->AddElementL(pName).SetContentL(pValue); + TRAPD(err1, clientPolicy->AddElementL(pName).SetContentL(pValue)); + return err1; } } @@ -701,6 +706,7 @@ // create connection iServiceConnection = CSenServiceConnection::NewL(*this, *pServiceDesc, *this); CleanupStack::PopAndDestroy(pServiceDesc); + return KErrNone; } TInt CSenServiceConnectionBCTest::CreateConnectionToMessengerServiceWithoutCallbackL() @@ -720,6 +726,7 @@ // create connection iServiceConnection = CSenServiceConnection::NewL(*this, *pServiceDesc); CleanupStack::PopAndDestroy(pServiceDesc); + return KErrNone; } TInt CSenServiceConnectionBCTest::AddDeviceOptionsHeader2L(CSenSoapMessage2& aMessage) @@ -748,6 +755,8 @@ TXmlEngElement child1_3_2 = child1_3.AddNewElementSameNsL(_L8("Version")); child1_3_2.AddTextL(_L8("NO_Version")); + + return KErrNone; } TInt CSenServiceConnectionBCTest::AddApplicationHeader2L(CSenSoapMessage2& aMessage) @@ -764,12 +773,15 @@ TXmlEngElement child2 = application.AddNewElementSameNsL(_L8("Version")); child2.AddTextL(_L8("NO_VERSION")); + + return KErrNone; } TInt CSenServiceConnectionBCTest::StartActiveScheduler(TInt aNumberOfPendingOps) { iNumberOfPendingOps = aNumberOfPendingOps; CActiveScheduler::Start(); + return KErrNone; } TInt CSenServiceConnectionBCTest::StopActiveScheduler() @@ -779,6 +791,7 @@ { CActiveScheduler::Stop(); } + return KErrNone; } const CSenIdentityProvider* CSenServiceConnectionBCTest::IdentityProviderL() const @@ -824,8 +837,8 @@ TSenDataTrafficDetails details; TSenDataTrafficOperations operations; iServiceConnection->DataTrafficDetails(details,operations); - TInt BytesSent = details.iTotalBytesSent; - TInt BytesRecieved = details.iTotalBytesRecieved; + //TInt BytesSent = details.iTotalBytesSent; + //TInt BytesRecieved = details.iTotalBytesRecieved; } StopActiveScheduler(); @@ -1672,7 +1685,10 @@ User::LeaveIfError(this->iFsSessionHandle.ShareProtected()); retVal=iRFileHandle.Open(iFsSessionHandle, _L("c:\\private\\101FB3E7\\WS_IPCImpBigRequest"), EFileStream|EFileRead); - + if(retVal != KErrNone) + { + return retVal; + } CleanupClosePushL(iRFileHandle); TInt transactionIdOrError = iServiceConnection->SendL(iRFileHandle); //LOCAL_ASSERT(transactionIdOrError2 > KErrNone); @@ -1710,7 +1726,11 @@ User::LeaveIfError(this->iFsSessionHandle.ShareProtected()); retVal=iRFileHandle.Open(iFsSessionHandle, _L("c:\\private\\101FB3E7\\WS_IPCImpBigRequest"), EFileStream|EFileRead); - + if(retVal != KErrNone) + { + return retVal; + } + CleanupClosePushL(iRFileHandle); HBufC8 *pMsgBuf = NULL;// Buffer to get response TInt transactionIdOrError = iServiceConnection->SubmitL(iRFileHandle, pMsgBuf); @@ -1752,7 +1772,11 @@ User::LeaveIfError(this->iFsSessionHandle.ShareProtected()); retVal=iRFileHandle.Open(iFsSessionHandle, _L("c:\\private\\101FB3E7\\testPic9.jpg"), EFileStream|EFileRead); - + if(retVal != KErrNone) + { + return retVal; + } + CleanupClosePushL(iRFileHandle); HBufC8 *pMsgBuf = NULL;// Buffer to get response TInt transactionIdOrError = iServiceConnection->SubmitL(iRFileHandle, pMsgBuf); @@ -1797,7 +1821,7 @@ TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_RFileL( TTestResult& aResult ) { SetupL() ; - TInt retVal(KErrNone); + //TInt retVal(KErrNone); iSenXmlServiceDescription = CSenXmlServiceDescription::NewL(); iSenXmlServiceDescription->SetFrameworkIdL(KIDWSFFrameworkID); iSenXmlServiceDescription->SetEndPointL(KAddressBookServiceId); @@ -1806,12 +1830,17 @@ TInt err(KErrNone); //iServiceConnection = CSenServiceConnection::NewL(*this, KAddressBookServiceId()); - iServiceConnection = CSenServiceConnection::NewLC(*this, *iSenXmlServiceDescription); + iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription); StartActiveScheduler(1); User::LeaveIfError(this->iFsSessionHandle.Connect());//anil User::LeaveIfError(this->iFsSessionHandle.ShareProtected()); err = iRFileHandle.Open(iFsSessionHandle, _L("c:\\private\\101FB3E7\\Test.txt"), EFileStream|EFileRead); + if(err != KErrNone) + { + return err; + } + CleanupClosePushL(iRFileHandle); HBufC8 *pMsgBuf = NULL; TInt transactionIdOrError = iServiceConnection->SubmitL(iRFileHandle, pMsgBuf); @@ -1828,7 +1857,7 @@ if(iFsSessionHandle.Handle()) iFsSessionHandle.Close(); - CleanupStack::Pop(iServiceConnection); + //CleanupStack::Pop(iServiceConnection); __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection); iServiceConnection = NULL; @@ -1844,7 +1873,7 @@ TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_RFileL( TTestResult& aResult ) { SetupL() ; - TInt retVal(KErrNone); + //TInt retVal(KErrNone); iSenXmlServiceDescription = CSenXmlServiceDescription::NewL(); iSenXmlServiceDescription->SetFrameworkIdL(KIDWSFFrameworkID); iSenXmlServiceDescription->SetEndPointL(KAddressBookServiceId); @@ -1853,7 +1882,7 @@ TInt err(KErrNone); //iServiceConnection = CSenServiceConnection::NewL(*this, KAddressBookServiceId()); - iServiceConnection = CSenServiceConnection::NewLC(*this, *iSenXmlServiceDescription); + iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription); StartActiveScheduler(1); /* @@ -1870,17 +1899,22 @@ User::LeaveIfError(this->iFsSessionHandle.Connect());//anil User::LeaveIfError(this->iFsSessionHandle.ShareProtected()); err = iRFileHandle.Open(iFsSessionHandle, _L("c:\\private\\101FB3E7\\Test.txt"), EFileStream|EFileRead); + if(err != KErrNone) + { + return err; + } + CleanupClosePushL(iRFileHandle); TInt transactionIdOrError = iServiceConnection->SendL(iRFileHandle); if (transactionIdOrError == KErrNone) StartActiveScheduler(1); // LOCAL_ASSERT(transactionIdOrError > KErrNone); - + //CleanupStack::Pop(&iRFileHandle); CleanupStack::PopAndDestroy(&iRFileHandle); if(iFsSessionHandle.Handle()) iFsSessionHandle.Close(); - CleanupStack::Pop(iServiceConnection); + //CleanupStack::Pop(iServiceConnection); __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection); iServiceConnection = NULL; __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription); @@ -6546,7 +6580,7 @@ TInt CSenServiceConnectionBCTest::Response( TTestResult& aResult ) { TInt res; CTestConnection* pTest = CTestConnection::NewL(); - MSenMessage* pMsg; + //MSenMessage* pMsg = NULL; TRAP(res, pTest->Response()); // CleanupStack::Pop(pTest); delete pTest; @@ -6888,7 +6922,7 @@ iLog->Log(_L("CoBrand->start")); SetupL(); - TInt retVal(0); +// TInt retVal(0); iCoBrandingCallbackOption = ETrue; _LIT8(KFramework, "WS-STAR"); @@ -6933,6 +6967,11 @@ SetPolicyL(pSmSd, KPassportExtensions, KNullDesC8); iLog->Log(_L("CSenXmlServiceDescription* pSmSd = CSenXmlServiceDescription::NewLC()")); TInt error = manager->RegisterServiceDescriptionL( *pSmSd); + if(error != KErrNone) + { + return error; + } + iLog->Log(_L("manager->RegisterServiceDescriptionL( *pSmSd);")); CSenXmlServiceDescription* pScSd = CSenServicePattern::NewLC(); @@ -7000,7 +7039,7 @@ iHostletConsumerOption = ETrue; - TInt retVal(KErrNone); + //TInt retVal(KErrNone); _LIT8(KReq,"Some Query"); _LIT8(KEndPoint, "http://10.21.32.110/sereneHardCoded/WS_CM_001_001"); @@ -7033,12 +7072,14 @@ Teardown(); iLog->Log(_L("HostletConsumer->End")); + return ret; } void CSenServiceConnectionBCTest::SetConnectionId( TInt aConnectionId ) { TInt connectonId = 0; connectonId = aConnectionId; + iLog->Log(_L("Connection Id is %d"),connectonId); } TInt CSenServiceConnectionBCTest::DataTrafficDetailsL(TTestResult& aResult) @@ -7048,7 +7089,7 @@ iGetDataTrafficDetails = ETrue; - TInt retVal(KErrNone); + //TInt retVal(KErrNone); _LIT8(KReq,"Some Query"); _LIT8(KEndPoint, "http://10.21.32.110/sereneHardCoded/WS_CM_001_001"); @@ -7081,4 +7122,5 @@ Teardown(); iLog->Log(_L("HostletConsumer->End")); + return ret; } diff -r b72ea8487adb -r f68f07157250 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 Mon Jun 21 16:54:52 2010 +0300 +++ b/websrv_pub/web_service_connection_api/tsrc/bc/senutils/group/testsu_c.bat Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Mon Jun 21 16:54:52 2010 +0300 +++ b/websrv_pub/web_service_connection_api/tsrc/bc/senutils/group/testsu_z.bat Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Mon Jun 21 16:54:52 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 b72ea8487adb -r f68f07157250 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 b72ea8487adb -r f68f07157250 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 Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 b72ea8487adb -r f68f07157250 websrv_pub/web_service_connection_api/tsrc/bc/senutils/src/senutilscases.cpp --- a/websrv_pub/web_service_connection_api/tsrc/bc/senutils/src/senutilscases.cpp Mon Jun 21 16:54:52 2010 +0300 +++ b/websrv_pub/web_service_connection_api/tsrc/bc/senutils/src/senutilscases.cpp Thu Jul 15 19:53:58 2010 +0300 @@ -335,7 +335,7 @@ _LIT8(KBody,"ComarchBody"); TPtrC8 result = env->SetBodyL(KBody); - _LIT16(KRef2, "ComarchBody"); +// _LIT16(KRef2, "ComarchBody"); TPtrC16 result16(reinterpret_cast(result.Ptr()),(result.Size()/2)); RDebug::Print( _L( "WSModTester: body [%S]"),&result16); /*EUNIT_ASSERT_EQUALS(result, KBody);*/ @@ -586,8 +586,8 @@ { SetupL(); - _LIT8(KHeaderElementName, "HeaderElement"); - _LIT8(KHeaderContent, "HeaderContent"); +// _LIT8(KHeaderElementName, "HeaderElement"); +// _LIT8(KHeaderContent, "HeaderContent"); CSenSoapEnvelope* pEnvelope = CSenSoapEnvelope::NewL(); @@ -675,14 +675,14 @@ \ \ "); - _LIT8(KBodyAsString, "\ +/* _LIT8(KBodyAsString, "\ \ \ -"); +");*/ - _LIT8(KEmptyBodyAsString, ""); + //_LIT8(KEmptyBodyAsString, ""); - _LIT8(KEmptyBodyWithNsAsString, ""); + // _LIT8(KEmptyBodyWithNsAsString, ""); CSenParser* pParser = CSenParser::NewLC(); CSenSoapEnvelope* pEnvelope = CSenSoapEnvelope::NewL(); pEnvelope->SetReader( *iXmlReader ); @@ -997,14 +997,14 @@ \ \ "); - _LIT8(KBodyAsString, "\ +/* _LIT8(KBodyAsString, "\ \ \ "); +*/ + // _LIT8(KEmptyBodyAsString, ""); - _LIT8(KEmptyBodyAsString, ""); - - _LIT8(KEmptyBodyWithNsAsString, ""); + //_LIT8(KEmptyBodyWithNsAsString, ""); CSenParser* pParser = CSenParser::NewLC(); CSenSoapMessage* pMessage = CSenSoapMessage::NewL(); pMessage->SetReader( *iXmlReader ); @@ -1615,7 +1615,7 @@ if(err != KErrUnderflow) return err; //garbage year - _LIT8(KIn15, "xxxx-02-28T13:20:65Z"); +// _LIT8(KIn15, "xxxx-02-28T13:20:65Z"); //EUNIT_ASSERT_LEAVE //ASSERT(SenDateUtils::FromXmlDateTimeL(KIn15)); @@ -1980,12 +1980,17 @@ Flag=1; else Flag=0; - if(!( Flag )) KErrArgument; - CleanupStack::PopAndDestroy(pXmlElement); + if(!( Flag )) + { + CleanupStack::PopAndDestroy(pXmlElement); + CleanupStack::PopAndDestroy(pElement); + return KErrArgument; + } + CleanupStack::PopAndDestroy(pXmlElement); CleanupStack::PopAndDestroy(pElement); - Teardown(); - return KErrNone; - } + Teardown(); + return KErrNone; +} TInt CSenUtilsBCTest::SenTransportProperties_AsUtf8LL(TTestResult& aResult ) @@ -2021,7 +2026,7 @@ TInt CSenUtilsBCTest::SenTransportProperties_PropertyLL(TTestResult& aResult ) { SetupL(); - _LIT8(KValue,"Value"); + //_LIT8(KValue,"Value"); TPtrC8 ValuePtr; TPtrC8 ValuePtr1; CSenTransportProperties* pElement= CSenTransportProperties::NewL(); @@ -2617,7 +2622,7 @@ TInt CSenUtilsBCTest::SenTransportProperties_MaxTimeToLiveLL(TTestResult& aResult ) { TTestResult Result; - SenTransportProperties_SetMaxTimeToLiveLL( Result); + return SenTransportProperties_SetMaxTimeToLiveLL( Result); } TInt CSenUtilsBCTest::SenTransportProperties_SetMinTimeToLiveLL(TTestResult& aResult ) @@ -2706,7 +2711,7 @@ TInt CSenUtilsBCTest::SenTransportProperties_CloneL(TTestResult& aResult ) { SetupL(); - TBool Flag; + TBool Flag = 0; TInt var; CSenTransportProperties* pElement= CSenTransportProperties::NewL(); CleanupStack::PushL(pElement); @@ -2714,9 +2719,13 @@ pClone = (CSenTransportProperties*)pElement->Clone(var); if(pClone != NULL) Flag = 1; - if(!(Flag)) return KErrArgument; - - delete pClone; + if(!(Flag)) + { + delete pClone; + CleanupStack::PopAndDestroy(pElement); + return KErrArgument; + } + delete pClone; CleanupStack::PopAndDestroy(pElement); Teardown(); @@ -2744,8 +2753,12 @@ if(retVal != EFalse) Flag = 1; else + { + CleanupStack::PopAndDestroy(pElement); return KErrArgument; - + } + //TO resolve RVCT4.0 warning + if (Flag); CleanupStack::PopAndDestroy(pElement); Teardown(); @@ -2757,20 +2770,24 @@ TInt CSenUtilsBCTest::SenTransportProperties_CloneLL(TTestResult& aResult ) { SetupL(); - TBool Flag; + TBool Flag = 0; CSenTransportProperties* pElement= CSenTransportProperties::NewL(); CleanupStack::PushL(pElement); CSenTransportProperties* pClone = NULL; - pClone = (CSenTransportProperties*)pElement->CloneL(); - if(pClone != NULL) - Flag = 1; - if(!(Flag)) return KErrArgument; - + pClone = (CSenTransportProperties*)pElement->CloneL(); + if(pClone != NULL) + Flag = 1; + if(!(Flag)) + { + delete pClone; + CleanupStack::PopAndDestroy(pElement); + return KErrArgument; + } delete pClone; - CleanupStack::PopAndDestroy(pElement); + CleanupStack::PopAndDestroy(pElement); - Teardown(); - return KErrNone; + Teardown(); + return KErrNone; } @@ -2792,7 +2809,7 @@ TInt CSenUtilsBCTest::SenTransportProperties_MinTimeToLiveLL(TTestResult& aResult ) { TTestResult Result; - SenTransportProperties_SetMinTimeToLiveLL(Result); + return SenTransportProperties_SetMinTimeToLiveLL(Result); } TInt CSenUtilsBCTest::SenHttpTransportProperties_NewLL(TTestResult& aResult) diff -r b72ea8487adb -r f68f07157250 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 b72ea8487adb -r f68f07157250 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 Mon Jun 21 16:54:52 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 b72ea8487adb -r f68f07157250 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 Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 b72ea8487adb -r f68f07157250 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 Mon Jun 21 16:54:52 2010 +0300 +++ b/websrv_pub/web_service_description_api/tsrc/bc/senservdesc/sis/TestSD_c.bat Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 websrv_pub/web_service_description_api/tsrc/bc/senservdesc/src/SenServDescCases.cpp --- a/websrv_pub/web_service_description_api/tsrc/bc/senservdesc/src/SenServDescCases.cpp Mon Jun 21 16:54:52 2010 +0300 +++ b/websrv_pub/web_service_description_api/tsrc/bc/senservdesc/src/SenServDescCases.cpp Thu Jul 15 19:53:58 2010 +0300 @@ -1190,7 +1190,7 @@ idProvider->SetUserInfoL(KText, KNullDesC8, KNullDesC8); //checking xml - _LIT16(KRef, "texturn:liberty:as:2004-04text"); +// _LIT16(KRef, "texturn:liberty:as:2004-04text"); TPtr16 ptr = ConvertToPtr16LC(*idProvider); TInt posId(-1); @@ -1221,7 +1221,7 @@ idProvider->SetUserInfoL(KNullDesC8, KText, KNullDesC8); //checking xml - _LIT16(KRef, "texturn:liberty:as:2004-04text"); +// _LIT16(KRef, "texturn:liberty:as:2004-04text"); // TL(ConvertToPtr16LC(*idProvider) == KRef); @@ -1269,7 +1269,7 @@ idProvider->SetUserInfoL(KNullDesC8, KNullDesC8, KText2); idProvider->SetUserInfoL(KNullDesC8, KNullDesC8, KText); //checking xml - _LIT16(KRef, "texturn:liberty:as:2004-04text"); +// _LIT16(KRef, "texturn:liberty:as:2004-04text"); //TL(ConvertToPtr16LC(*idProvider) == KRef); //CleanupStack::PopAndDestroy();//Ptr @@ -1334,7 +1334,7 @@ __ASSERT_ALWAYS_NO_LEAVE(idProvider->SetProviderID(KText2)); __ASSERT_ALWAYS_NO_LEAVE(idProvider->SetProviderID(KText)); //checking xml - _LIT16(KRef, "texturn:liberty:as:2004-04text"); +// _LIT16(KRef, "texturn:liberty:as:2004-04text"); //TL(ConvertToPtr16LC(*idProvider) == KRef); TPtr16 ptr = ConvertToPtr16LC(*idProvider); TInt posId(-1); @@ -1357,7 +1357,7 @@ __ASSERT_ALWAYS_NO_LEAVE(idProvider->SetServiceID(KText2)); __ASSERT_ALWAYS_NO_LEAVE(idProvider->SetServiceID(KText)); //checking xml - _LIT16(KRef, "texturn:liberty:as:2004-04text"); +// _LIT16(KRef, "texturn:liberty:as:2004-04text"); //TL(ConvertToPtr16LC(*idProvider) == KRef); TPtr16 ptr = ConvertToPtr16LC(*idProvider); @@ -1791,7 +1791,7 @@ if(!(pattern->AddConsumerIdentityProviderIdL(KText2) == KErrNone))return KErrArgument; - _LIT16(KRef, ""); +// _LIT16(KRef, ""); //TL(ConvertToPtr16LC(*pattern) == KRef); //CleanupStack::PopAndDestroy();//Ptr @@ -2177,7 +2177,7 @@ if(!(xmlService->AddIdentityProviderIdL(ptr) == KErrNone))return KErrArgument; - _LIT16(KRef, "texttext2"); + //_LIT16(KRef, "texttext2"); //TL(ConvertToPtr16LC(*xmlService) == KRef); //CleanupStack::PopAndDestroy();//Ptr @@ -2356,7 +2356,7 @@ CSenXmlServiceDescription* xmlService = CSenXmlServiceDescription::NewL(); xmlService ->SetContractL(KText); //checking xml - _LIT16(KRef, "text"); +// _LIT16(KRef, "text"); //TL(ConvertToPtr16LC(*xmlService) == KRef); TPtr16 ptr = ConvertToPtr16LC(*xmlService); @@ -2386,7 +2386,7 @@ xmlService ->SetContractL(KText2); //checking xml - _LIT16(KRef2, "text2"); +// _LIT16(KRef2, "text2"); //TL(ConvertToPtr16LC(*xmlService) == KRef2); TL(xmlService->Contract() == KText2); @@ -2511,7 +2511,7 @@ senFacet->SetValueL(KText2); if(!(xmlService->SetFacetL(*senFacet) == KErrNone))return KErrArgument; - _LIT16(KRef, "text2"); +// _LIT16(KRef, "text2"); //TPtrC16 ptrRef = KRef(); //TL(ConvertToPtr16LC(*xmlService) == ptrRef); @@ -2621,7 +2621,7 @@ RDebug::Print( _L( "WSModTester: xmlBuffer [%S]"),&ptr); else RDebug::Print( _L( "WSModTester: xmlBuffer empty")); - _LIT8(KRef, "texttext"); +// _LIT8(KRef, "texttext"); /*EUNIT_ASSERT_EQUALS(ptr, KRef);*/ //TL(ptr == KRef); TInt posId(-1); @@ -2950,7 +2950,7 @@ xmlService ->SetEndPointL(KText); //checking xml - _LIT16(KRef, "text"); +// _LIT16(KRef, "text"); //TL(ConvertToPtr16LC(*xmlService) == KRef); TL(xmlService->Endpoint() == KText); @@ -2978,7 +2978,7 @@ xmlService ->SetEndPointL(KText2); //checking xml - _LIT16(KRef2, "text2"); +// _LIT16(KRef2, "text2"); //TL(ConvertToPtr16LC(*xmlService) == KRef2); TL(xmlService->Endpoint() == KText2); diff -r b72ea8487adb -r f68f07157250 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 Mon Jun 21 16:54:52 2010 +0300 +++ b/websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/sis/TestSM_c.bat Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Mon Jun 21 16:54:52 2010 +0300 +++ b/websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/sis/TestSM_z.bat Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/src/SenServiceManagerCases.cpp --- a/websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/src/SenServiceManagerCases.cpp Mon Jun 21 16:54:52 2010 +0300 +++ b/websrv_pub/web_service_manager_api/tsrc/bc/senservicemanager/src/SenServiceManagerCases.cpp Thu Jul 15 19:53:58 2010 +0300 @@ -914,7 +914,7 @@ LOCAL_ASSERT((iServiceManager->AssociateServiceL(KText, KNullDesC8)) == KErrArgument); LOCAL_ASSERT((iServiceManager->AssociateServiceL(KNullDesC8, KText)) == KErrArgument); LOCAL_ASSERT((iServiceManager->AssociateServiceL(KNullDesC8, KNullDesC8)) == KErrArgument); - _LIT8(KPattern, "&<>"); + //_LIT8(KPattern, "&<>"); iProvider->SetProviderID(KText); LOCAL_ASSERT((iServiceManager->RegisterIdentityProviderL(*iProvider)) == KErrNone); @@ -989,9 +989,8 @@ if(err != KErrNone)return err; LOCAL_ASSERT((iServiceManager->DissociateServiceL(KText, KText)) == KErrNotFound); - _LIT8(KPattern, "&<>"); - - Teardown(); +// _LIT8(KPattern, "&<>"); + Teardown(); return KErrNone; } diff -r b72ea8487adb -r f68f07157250 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 Mon Jun 21 16:54:52 2010 +0300 +++ b/websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/group/testnsc_c.bat Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Mon Jun 21 16:54:52 2010 +0300 +++ b/websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/group/testnsc_z.bat Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Mon Jun 21 16:54:52 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 b72ea8487adb -r f68f07157250 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 b72ea8487adb -r f68f07157250 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 Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 b72ea8487adb -r f68f07157250 websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/src/newsoapclassescases.cpp --- a/websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/src/newsoapclassescases.cpp Mon Jun 21 16:54:52 2010 +0300 +++ b/websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/src/newsoapclassescases.cpp Thu Jul 15 19:53:58 2010 +0300 @@ -376,15 +376,15 @@ HBufC8* pAsXml = pEnvelope->AsXmlL(); CleanupStack::PushL(pAsXml); - if(!( *pAsXml == KEnvelopeString )) return KErrArgument; - - CleanupStack::PopAndDestroy(pAsXml); - + if(!( *pAsXml == KEnvelopeString )) + { + CleanupStack::PopAndDestroy(pAsXml); + return KErrArgument; + } + CleanupStack::PopAndDestroy(pAsXml); TInt var = pEnvelope->TxnId(); - TBool Flag; - if(var >= 0) - if(!(Flag)) return KErrArgument; + return KErrArgument; __ASSERT_ALWAYS_NO_LEAVE(delete pEnvelope); pEnvelope = NULL; @@ -397,18 +397,21 @@ TInt CNewSoapClassesBCTest::MT_CSenSoapEnvelope2_CloneL( TTestResult& aResult ) { SetupL(); - TBool Flag; + TBool Flag = 0; CSenSoapEnvelope2* pEnvelope = CSenSoapEnvelope2::NewL(); CleanupStack::PushL(pEnvelope); CSenSoapEnvelope2* pClone = NULL; pClone = (CSenSoapEnvelope2*)pEnvelope->CloneL(); if(pClone != NULL) Flag = 1; - if(!(Flag)) return KErrArgument; - - delete pClone; + if(!(Flag)) + { + delete pClone; CleanupStack::PopAndDestroy(pEnvelope); - + return KErrArgument; + } + delete pClone; + CleanupStack::PopAndDestroy(pEnvelope); Teardown(); return KErrNone; } @@ -574,9 +577,12 @@ HBufC8* pAsXml = pEnvelope->AsXmlL(); CleanupStack::PushL(pAsXml); - if(!( *pAsXml == KEnvelopeString )) KErrArgument; - CleanupStack::PopAndDestroy(pAsXml); - + if(!( *pAsXml == KEnvelopeString )) + { + CleanupStack::PopAndDestroy(pAsXml); + return KErrArgument; + } + CleanupStack::PopAndDestroy(pAsXml); TXmlEngElement bodyElement2 = document.CreateDocumentElementL(KBodyElementName2()); bodyElement2.AddTextL(KBodyContent2()); pEnvelope->SetBodyL(bodyElement2); @@ -2304,7 +2310,7 @@ TInt CNewSoapClassesBCTest::MT_CSenSoapMessage2_CloneL( TTestResult& aResult ) { SetupL(); - TBool Flag; + TBool Flag = 0; CSenSoapMessage2* pSoapMessage = CSenSoapMessage2::NewL(); CleanupStack::PushL(pSoapMessage); @@ -2312,9 +2318,14 @@ pClone = (CSenSoapMessage2*)pSoapMessage->CloneL(); if(pClone != NULL) Flag = 1; - if(!(Flag)) return KErrArgument; + if(!(Flag)) + { + delete pClone; + CleanupStack::PopAndDestroy(pSoapMessage); + return KErrArgument; + } delete pClone; - CleanupStack::PopAndDestroy(pSoapMessage); + CleanupStack::PopAndDestroy(pSoapMessage); Teardown(); return KErrNone; } @@ -3420,7 +3431,7 @@ filetext.Write(_L("CleanupStack::PopAndDestroy(1); ")); - /* // 2) Fault code in Soap 1.2 + // 2) Fault code in Soap 1.2 // Note: SOAP 1.2 faults are structured differently to SOAP 1.1. // In particular all fault elements are now namespace _qualified_, // many have been renamed and fault codes are now hierarchical @@ -3441,13 +3452,9 @@ CleanupStack::PopAndDestroy(pSoapFault2); CleanupStack::PopAndDestroy(1); // document2 - *//* + Teardown(); filetext.Write(_L("Teardown")); return KErrNone; */ - - - - // End of File \ No newline at end of file diff -r b72ea8487adb -r f68f07157250 websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/src/testmsenmessage.cpp --- a/websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/src/testmsenmessage.cpp Mon Jun 21 16:54:52 2010 +0300 +++ b/websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/src/testmsenmessage.cpp Thu Jul 15 19:53:58 2010 +0300 @@ -47,11 +47,11 @@ } MSenMessage::TClass CTestMSenMessage::Type() { - EMessageBase; + return EMessageBase; } MSenMessage::TDirection CTestMSenMessage::Direction() { - EOutbound; + return EOutbound; } TInt CTestMSenMessage::SetContext(MSenMessageContext* apNotOwnedContext) { diff -r b72ea8487adb -r f68f07157250 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 Mon Jun 21 16:54:52 2010 +0300 +++ b/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/group/WSTester.mmp Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Mon Jun 21 16:54:52 2010 +0300 +++ b/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/inc/WSTester.h Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Mon Jun 21 16:54:52 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 b72ea8487adb -r f68f07157250 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 b72ea8487adb -r f68f07157250 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 Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 b72ea8487adb -r f68f07157250 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 Mon Jun 21 16:54:52 2010 +0300 +++ b/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/src/WSTester.cpp Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Mon Jun 21 16:54:52 2010 +0300 +++ b/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/src/WSTesterBlocks.cpp Thu Jul 15 19:53:58 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; } @@ -811,6 +821,13 @@ iStringPool.OpenStringL(KAttribute()), iStringPool.OpenStringL(KAttributeValue()))); + if (err != KErrNone) + { + iLog->Log(_L("Retrieving the attribute failed. Error: %d"), err ); + CleanupStack::PopAndDestroy(); + return err; + } + // make a new array for all attributes including namespace (to be added) RAttributeArray justAttributes; @@ -837,6 +854,13 @@ iStringPool.OpenStringL(KAttribute()), iStringPool.OpenStringL(KAttributeValue()))); + if (err != KErrNone) + { + iLog->Log(_L("Retrieving the attribute failed. Error: %d"), err ); + CleanupStack::PopAndDestroy(); + return err; + } + RAttributeArray justAttributes; justAttributes.Append(justAttribute); @@ -2105,7 +2129,7 @@ HBufC8* pTestXml = HBufC8::NewLC( xmlDoc.Length() ); pTestXml->Des().Append(xmlDoc); - CSenElement* newElement; + CSenElement* newElement = NULL; //adding parsed document to SenElement and copy it to iElement @@ -2255,20 +2279,20 @@ TBuf8<128> name; name.Append(arg); - RAttributeArray apAttrs; + /*RAttributeArray apAttrs; HBufC8* newAttr; - /*TRAPD(r, newAttr = ((CSenBaseElement*)iElement)->AllocAttrValueL(apAttrs, name) ); + TRAPD(r, newAttr = ((CSenBaseElement*)iElement)->AllocAttrValueL(apAttrs, name) ); if (r != KErrNone) { iLog->Log(_L("AllocAttrValueL failed. Error: %d"), r ); return r; - }*/ + } if ( newAttr!= NULL ){ delete newAttr; newAttr = NULL; - } + }*/ iLog->Log(_L("******* _C_AllocAttrValue -> Ended! ********")); return error; @@ -2719,6 +2743,7 @@ { iLog->Log(_L("******* SetStatus -> Started! ********")); + iLog->Log(_L("Status: %d"), aStatus); switch( aStatus ) { @@ -3005,7 +3030,7 @@ return error; } //AsXML "UTF8" - HBufC8* pBuf; + HBufC8* pBuf = NULL; TRAPD(rAsXml, pBuf = pDom->AsXmlL()); if (rAsXml != KErrNone) @@ -3017,7 +3042,7 @@ iLog->Log(*pBuf); LogResultL( *pBuf ); //AsXMLUnicode - HBufC16* pBuf2; + HBufC16* pBuf2 = NULL; TRAPD(rAsXmlUnicode, pBuf2 = pDom->AsXmlUnicodeL()); if (rAsXmlUnicode != KErrNone) @@ -3083,7 +3108,7 @@ // close fsSession CleanupStack::PopAndDestroy(); // Store parsed documed in file - HBufC8* pBuf; + HBufC8* pBuf = NULL; // Convert document TRAPD(rAsXml, pBuf = pDom->AsXmlL()); if (rAsXml != KErrNone) @@ -3253,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 b72ea8487adb -r f68f07157250 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 Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 b72ea8487adb -r f68f07157250 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 Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Thu Jul 15 19:53:58 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 b72ea8487adb -r f68f07157250 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 Thu Jul 15 19:53:58 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