44 #include <SenDateUtils.h> |
44 #include <SenDateUtils.h> |
45 #include <SenTransportProperties.h> |
45 #include <SenTransportProperties.h> |
46 |
46 |
47 //#include <SenVtcpTransportProperties.h> |
47 //#include <SenVtcpTransportProperties.h> |
48 #include "testproperty.h" |
48 #include "testproperty.h" |
49 #include <xmlengchunkcontainer.h> |
49 #include <XmlEngChunkContainer.h> |
50 #include <xmlengfilecontainer.h> |
50 #include <XmlEngFileContainer.h> |
51 //#include <XmlEngSerializer.h> |
51 //#include <XmlEngSerializer.h> |
52 |
52 |
53 #include <e32base.h> // for CActive |
53 #include <e32base.h> // for CActive |
54 #include <aknnotewrappers.h> |
54 #include <aknnotewrappers.h> |
55 |
55 |
81 _LIT8(KASProviderID, "http://radio.etenee.net:9080/tfs/"); |
81 _LIT8(KASProviderID, "http://radio.etenee.net:9080/tfs/"); |
82 _LIT8(KTestAuthzID, "012345678901234"); |
82 _LIT8(KTestAuthzID, "012345678901234"); |
83 _LIT8(KTestPassword, "012345678901234"); |
83 _LIT8(KTestPassword, "012345678901234"); |
84 #elif VALIMO_ADDRESSBOOK_SERVICE |
84 #elif VALIMO_ADDRESSBOOK_SERVICE |
85 // Addressbook service hosted inside Nokia intra by ASP / testing team |
85 // Addressbook service hosted inside Nokia intra by ASP / testing team |
86 _LIT8(KWSPContract, "urn:nokia:test:addrbook:2004-09"); |
86 // _LIT8(KWSPContract, "urn:nokia:test:addrbook:2004-09"); |
87 _LIT8(KAuthServEndpoint, "http://10.21.32.110/tfs/IDPSSO_IDWSF10"); |
87 _LIT8(KAuthServEndpoint, "http://10.21.32.110/tfs/IDPSSO_IDWSF10"); |
88 _LIT8(KASProviderID, "provider01"); |
88 // _LIT8(KASProviderID, "provider01"); |
89 _LIT8(KTestAuthzID, "john"); |
89 // _LIT8(KTestAuthzID, "john"); |
90 _LIT8(KTestPassword, "password"); |
90 // _LIT8(KTestPassword, "password"); |
91 #elif SYSOPENDIGIA_ADDRESSBOOK_SERVICE |
91 #elif SYSOPENDIGIA_ADDRESSBOOK_SERVICE |
92 _LIT8(KWSPContract, "urn:nokia:test:addrbook:2004-09"); |
92 _LIT8(KWSPContract, "urn:nokia:test:addrbook:2004-09"); |
93 _LIT8(KAuthServEndpoint, "http://ys01liw022.partner.yomi.com:9080/tfs/IDPSSO_IDWSF"); |
93 _LIT8(KAuthServEndpoint, "http://ys01liw022.partner.yomi.com:9080/tfs/IDPSSO_IDWSF"); |
94 _LIT8(KASProviderID, "http://ys01liw022.partner.yomi.com:9080/tfs/"); |
94 _LIT8(KASProviderID, "http://ys01liw022.partner.yomi.com:9080/tfs/"); |
95 _LIT8(KTestAuthzID, "012345678901234"); |
95 _LIT8(KTestAuthzID, "012345678901234"); |
102 _LIT8(KTestAuthzID, "testuser1"); |
102 _LIT8(KTestAuthzID, "testuser1"); |
103 _LIT8(KTestPassword, "testuser1"); |
103 _LIT8(KTestPassword, "testuser1"); |
104 #endif // FN_ADDRESSBOOK_SERVICE |
104 #endif // FN_ADDRESSBOOK_SERVICE |
105 |
105 |
106 |
106 |
107 _LIT8(KASContract, "urn:liberty:as:2004-04"); |
107 // _LIT8(KASContract, "urn:liberty:as:2004-04"); |
108 _LIT8(KHttpsEndPoint, "https://10.21.32.110/sereneHardCoded/WS_WSI_R9980_001" ); |
108 // _LIT8(KHttpsEndPoint, "https://10.21.32.110/sereneHardCoded/WS_WSI_R9980_001" ); |
109 |
109 |
110 _LIT8(KWSIFrameworkID, "WS-I"); |
110 _LIT8(KWSIFrameworkID, "WS-I"); |
111 _LIT8(KIDWSFFrameworkID, "ID-WSF"); |
111 _LIT8(KIDWSFFrameworkID, "ID-WSF"); |
112 _LIT8(KRESTFrameworkID, "REST"); |
112 _LIT8(KRESTFrameworkID, "REST"); |
113 // _LIT8(KWsStarFrameworkID, "WS-STAR"); |
113 // _LIT8(KWsStarFrameworkID, "WS-STAR"); |
131 #endif |
131 #endif |
132 #else |
132 #else |
133 // ARMv5 |
133 // ARMv5 |
134 _LIT(KIAPName, "Internet"); |
134 _LIT(KIAPName, "Internet"); |
135 #endif |
135 #endif |
136 _LIT8(KLoggerFileNameProperty, "HttpLoggerFileName"); |
136 // _LIT8(KLoggerFileNameProperty, "HttpLoggerFileName"); |
137 |
137 |
138 _LIT(KFileToRead, "c:\\Logs\\LoggingHttpFilter\\httptrace.xml"); |
138 // _LIT(KFileToRead, "c:\\Logs\\LoggingHttpFilter\\httptrace.xml"); |
139 _LIT8(KFileName, "httptrace.xml"); |
139 // _LIT8(KFileName, "httptrace.xml"); |
140 |
140 |
141 _LIT8(KHTTPMethodGet, "GET"); |
141 // _LIT8(KHTTPMethodGet, "GET"); |
142 _LIT8(KHTTPMethodPost, "POST"); |
142 // _LIT8(KHTTPMethodPost, "POST"); |
143 |
143 |
144 // const TBool MultipleSimultanousRHttpSessionsSupported = EFalse; |
144 // const TBool MultipleSimultanousRHttpSessionsSupported = EFalse; |
145 // If IAP changes all previously sent messages will be canceled. |
145 // If IAP changes all previously sent messages will be canceled. |
146 |
146 |
147 |
147 |
148 //_LIT8(KProxyHost, "esprx00.nokia.com"); |
148 //_LIT8(KProxyHost, "esprx00.nokia.com"); |
149 _LIT8(KProxyHost, "172.19.160.50"); // IP address to: bsprx01.americas.nokia.com |
149 // _LIT8(KProxyHost, "172.19.160.50"); // IP address to: bsprx01.americas.nokia.com |
150 const TInt KProxyPort = 8080; |
150 // const TInt KProxyPort = 8080; |
151 |
151 |
152 //MSN Constants : |
152 //MSN Constants : |
153 //--------------- |
153 //--------------- |
154 _LIT8(KPassportUser, "m_minkkis@hotmail.com"); |
154 _LIT8(KPassportUser, "m_minkkis@hotmail.com"); |
155 _LIT8(KPassportPass, "M1nkk1s"); |
155 _LIT8(KPassportPass, "M1nkk1s"); |
156 |
156 |
157 _LIT8(KStsEndpoint, "https://login.live.com/rst2.srf"); |
157 _LIT8(KStsEndpoint, "https://login.live.com/rst2.srf"); |
158 _LIT8(KMSNProxy, "tcp.mws.mobile.live.com"); |
158 // _LIT8(KMSNProxy, "tcp.mws.mobile.live.com"); |
159 //_LIT8(KMetadataEndpoint, "http://10.132.11.31/WSStar/secpolicy/secpol.xml"); |
159 //_LIT8(KMetadataEndpoint, "http://10.132.11.31/WSStar/secpolicy/secpol.xml"); |
160 _LIT8(KMetadataEndpoint, "https://http.mws.mobile.live.com/2006/10/MWP2007_02/SecurityPolicy/Default.aspx"); |
160 _LIT8(KMetadataEndpoint, "https://http.mws.mobile.live.com/2006/10/MWP2007_02/SecurityPolicy/Default.aspx"); |
161 |
161 |
162 _LIT8(KPolicyAdr, "Addressing"); |
162 _LIT8(KPolicyAdr, "Addressing"); |
163 _LIT8(KPolicyMT, "MetadataEndpoint"); |
163 _LIT8(KPolicyMT, "MetadataEndpoint"); |
595 SetPolicyL(pattern, KPolicyTLS, KNullDesC8); |
595 SetPolicyL(pattern, KPolicyTLS, KNullDesC8); |
596 TInt error = manager->RegisterServiceDescriptionL( *pattern); |
596 TInt error = manager->RegisterServiceDescriptionL( *pattern); |
597 |
597 |
598 CleanupStack::PopAndDestroy(pattern); |
598 CleanupStack::PopAndDestroy(pattern); |
599 CleanupStack::PopAndDestroy(manager); |
599 CleanupStack::PopAndDestroy(manager); |
|
600 return error; |
600 } |
601 } |
601 |
602 |
602 TInt CSenServiceConnectionBCTest::RegisterSTSInvalidPasswordL() |
603 TInt CSenServiceConnectionBCTest::RegisterSTSInvalidPasswordL() |
603 { |
604 { |
604 CSenServiceManager* manager = CSenServiceManager::NewLC(); |
605 CSenServiceManager* manager = CSenServiceManager::NewLC(); |
628 SetPolicyL(pattern, KPolicyTLS, KNullDesC8); |
629 SetPolicyL(pattern, KPolicyTLS, KNullDesC8); |
629 TInt error = manager->RegisterServiceDescriptionL( *pattern); |
630 TInt error = manager->RegisterServiceDescriptionL( *pattern); |
630 |
631 |
631 CleanupStack::PopAndDestroy(pattern); |
632 CleanupStack::PopAndDestroy(pattern); |
632 CleanupStack::PopAndDestroy(manager); |
633 CleanupStack::PopAndDestroy(manager); |
|
634 return error; |
633 } |
635 } |
634 |
636 |
635 TInt CSenServiceConnectionBCTest::UnregisterSTSL() |
637 TInt CSenServiceConnectionBCTest::UnregisterSTSL() |
636 { |
638 { |
637 CSenServiceManager* manager = CSenServiceManager::NewLC(); |
639 CSenServiceManager* manager = CSenServiceManager::NewLC(); |
661 SetPolicyL(pattern, KPolicyTLS, KNullDesC8); |
663 SetPolicyL(pattern, KPolicyTLS, KNullDesC8); |
662 TInt error = manager->UnregisterServiceDescriptionL( *pattern); |
664 TInt error = manager->UnregisterServiceDescriptionL( *pattern); |
663 |
665 |
664 CleanupStack::PopAndDestroy(pattern); |
666 CleanupStack::PopAndDestroy(pattern); |
665 CleanupStack::PopAndDestroy(manager); |
667 CleanupStack::PopAndDestroy(manager); |
|
668 return error; |
666 } |
669 } |
667 |
670 |
668 TInt CSenServiceConnectionBCTest::SetPolicyL( CSenXmlServiceDescription* pServDesc, |
671 TInt CSenServiceConnectionBCTest::SetPolicyL( CSenXmlServiceDescription* pServDesc, |
669 const TDesC8& pName, |
672 const TDesC8& pName, |
670 const TDesC8& pValue) |
673 const TDesC8& pValue) |
675 servicePolicy->AddElementL(_L8("ClientPolicy")); |
678 servicePolicy->AddElementL(_L8("ClientPolicy")); |
676 clientPolicy = servicePolicy->Element(_L8("ClientPolicy")); |
679 clientPolicy = servicePolicy->Element(_L8("ClientPolicy")); |
677 |
680 |
678 if(pValue==KNullDesC8()) |
681 if(pValue==KNullDesC8()) |
679 { |
682 { |
680 clientPolicy->AddElementL(pName); |
683 TRAPD(err, clientPolicy->AddElementL(pName)); |
|
684 return err; |
681 } |
685 } |
682 else |
686 else |
683 { |
687 { |
684 clientPolicy->AddElementL(pName).SetContentL(pValue); |
688 TRAPD(err1, clientPolicy->AddElementL(pName).SetContentL(pValue)); |
|
689 return err1; |
685 } |
690 } |
686 } |
691 } |
687 |
692 |
688 TInt CSenServiceConnectionBCTest::CreateConnectionToMessengerServiceL() |
693 TInt CSenServiceConnectionBCTest::CreateConnectionToMessengerServiceL() |
689 { |
694 { |
699 SetPolicyL(pServiceDesc, KPolicyAdr, KAddressing); |
704 SetPolicyL(pServiceDesc, KPolicyAdr, KAddressing); |
700 |
705 |
701 // create connection |
706 // create connection |
702 iServiceConnection = CSenServiceConnection::NewL(*this, *pServiceDesc, *this); |
707 iServiceConnection = CSenServiceConnection::NewL(*this, *pServiceDesc, *this); |
703 CleanupStack::PopAndDestroy(pServiceDesc); |
708 CleanupStack::PopAndDestroy(pServiceDesc); |
|
709 return KErrNone; |
704 } |
710 } |
705 |
711 |
706 TInt CSenServiceConnectionBCTest::CreateConnectionToMessengerServiceWithoutCallbackL() |
712 TInt CSenServiceConnectionBCTest::CreateConnectionToMessengerServiceWithoutCallbackL() |
707 { |
713 { |
708 _LIT8(KAddressing, "http://schemas.xmlsoap.org/ws/2004/08/addressing"); |
714 _LIT8(KAddressing, "http://schemas.xmlsoap.org/ws/2004/08/addressing"); |
718 SetPolicyL(pServiceDesc, KPolicyAdr, KAddressing); |
724 SetPolicyL(pServiceDesc, KPolicyAdr, KAddressing); |
719 |
725 |
720 // create connection |
726 // create connection |
721 iServiceConnection = CSenServiceConnection::NewL(*this, *pServiceDesc); |
727 iServiceConnection = CSenServiceConnection::NewL(*this, *pServiceDesc); |
722 CleanupStack::PopAndDestroy(pServiceDesc); |
728 CleanupStack::PopAndDestroy(pServiceDesc); |
|
729 return KErrNone; |
723 } |
730 } |
724 |
731 |
725 TInt CSenServiceConnectionBCTest::AddDeviceOptionsHeader2L(CSenSoapMessage2& aMessage) |
732 TInt CSenServiceConnectionBCTest::AddDeviceOptionsHeader2L(CSenSoapMessage2& aMessage) |
726 { |
733 { |
727 TXmlEngElement header = aMessage.HeaderL(); |
734 TXmlEngElement header = aMessage.HeaderL(); |
746 TXmlEngElement child1_3_1 = child1_3.AddNewElementSameNsL(_L8("Name")); |
753 TXmlEngElement child1_3_1 = child1_3.AddNewElementSameNsL(_L8("Name")); |
747 child1_3_1.AddTextL(_L8("NO_OS")); |
754 child1_3_1.AddTextL(_L8("NO_OS")); |
748 |
755 |
749 TXmlEngElement child1_3_2 = child1_3.AddNewElementSameNsL(_L8("Version")); |
756 TXmlEngElement child1_3_2 = child1_3.AddNewElementSameNsL(_L8("Version")); |
750 child1_3_2.AddTextL(_L8("NO_Version")); |
757 child1_3_2.AddTextL(_L8("NO_Version")); |
|
758 |
|
759 return KErrNone; |
751 } |
760 } |
752 |
761 |
753 TInt CSenServiceConnectionBCTest::AddApplicationHeader2L(CSenSoapMessage2& aMessage) |
762 TInt CSenServiceConnectionBCTest::AddApplicationHeader2L(CSenSoapMessage2& aMessage) |
754 { |
763 { |
755 TXmlEngElement header = aMessage.HeaderL(); |
764 TXmlEngElement header = aMessage.HeaderL(); |
762 TXmlEngElement child1 = application.AddNewElementSameNsL(_L8("Vendor")); |
771 TXmlEngElement child1 = application.AddNewElementSameNsL(_L8("Vendor")); |
763 child1.AddTextL(_L8("NO_VENDOR")); |
772 child1.AddTextL(_L8("NO_VENDOR")); |
764 |
773 |
765 TXmlEngElement child2 = application.AddNewElementSameNsL(_L8("Version")); |
774 TXmlEngElement child2 = application.AddNewElementSameNsL(_L8("Version")); |
766 child2.AddTextL(_L8("NO_VERSION")); |
775 child2.AddTextL(_L8("NO_VERSION")); |
|
776 |
|
777 return KErrNone; |
767 } |
778 } |
768 |
779 |
769 TInt CSenServiceConnectionBCTest::StartActiveScheduler(TInt aNumberOfPendingOps) |
780 TInt CSenServiceConnectionBCTest::StartActiveScheduler(TInt aNumberOfPendingOps) |
770 { |
781 { |
771 iNumberOfPendingOps = aNumberOfPendingOps; |
782 iNumberOfPendingOps = aNumberOfPendingOps; |
772 CActiveScheduler::Start(); |
783 CActiveScheduler::Start(); |
|
784 return KErrNone; |
773 } |
785 } |
774 |
786 |
775 TInt CSenServiceConnectionBCTest::StopActiveScheduler() |
787 TInt CSenServiceConnectionBCTest::StopActiveScheduler() |
776 { |
788 { |
777 iNumberOfPendingOps--; |
789 iNumberOfPendingOps--; |
778 if ( iNumberOfPendingOps == 0 ) |
790 if ( iNumberOfPendingOps == 0 ) |
779 { |
791 { |
780 CActiveScheduler::Stop(); |
792 CActiveScheduler::Stop(); |
781 } |
793 } |
|
794 return KErrNone; |
782 } |
795 } |
783 |
796 |
784 const CSenIdentityProvider* CSenServiceConnectionBCTest::IdentityProviderL() const |
797 const CSenIdentityProvider* CSenServiceConnectionBCTest::IdentityProviderL() const |
785 { |
798 { |
786 ((CSenServiceConnectionBCTest*)this)->iAuthInfoAskCounter++; |
799 ((CSenServiceConnectionBCTest*)this)->iAuthInfoAskCounter++; |
822 if(iGetDataTrafficDetails) |
835 if(iGetDataTrafficDetails) |
823 { |
836 { |
824 TSenDataTrafficDetails details; |
837 TSenDataTrafficDetails details; |
825 TSenDataTrafficOperations operations; |
838 TSenDataTrafficOperations operations; |
826 iServiceConnection->DataTrafficDetails(details,operations); |
839 iServiceConnection->DataTrafficDetails(details,operations); |
827 TInt BytesSent = details.iTotalBytesSent; |
840 //TInt BytesSent = details.iTotalBytesSent; |
828 TInt BytesRecieved = details.iTotalBytesRecieved; |
841 //TInt BytesRecieved = details.iTotalBytesRecieved; |
829 } |
842 } |
830 |
843 |
831 StopActiveScheduler(); |
844 StopActiveScheduler(); |
832 iLog->Log(_L("BCTest::HandleMessageL->>End")); |
845 iLog->Log(_L("BCTest::HandleMessageL->>End")); |
833 } |
846 } |
1670 StartActiveScheduler(1); |
1683 StartActiveScheduler(1); |
1671 User::LeaveIfError(this->iFsSessionHandle.Connect());//anil |
1684 User::LeaveIfError(this->iFsSessionHandle.Connect());//anil |
1672 User::LeaveIfError(this->iFsSessionHandle.ShareProtected()); |
1685 User::LeaveIfError(this->iFsSessionHandle.ShareProtected()); |
1673 |
1686 |
1674 retVal=iRFileHandle.Open(iFsSessionHandle, _L("c:\\private\\101FB3E7\\WS_IPCImpBigRequest"), EFileStream|EFileRead); |
1687 retVal=iRFileHandle.Open(iFsSessionHandle, _L("c:\\private\\101FB3E7\\WS_IPCImpBigRequest"), EFileStream|EFileRead); |
1675 |
1688 if(retVal != KErrNone) |
|
1689 { |
|
1690 return retVal; |
|
1691 } |
1676 CleanupClosePushL(iRFileHandle); |
1692 CleanupClosePushL(iRFileHandle); |
1677 TInt transactionIdOrError = iServiceConnection->SendL(iRFileHandle); |
1693 TInt transactionIdOrError = iServiceConnection->SendL(iRFileHandle); |
1678 //LOCAL_ASSERT(transactionIdOrError2 > KErrNone); |
1694 //LOCAL_ASSERT(transactionIdOrError2 > KErrNone); |
1679 if (transactionIdOrError!=KErrArgument) |
1695 if (transactionIdOrError!=KErrArgument) |
1680 StartActiveScheduler(1); |
1696 StartActiveScheduler(1); |
1708 StartActiveScheduler(1); |
1724 StartActiveScheduler(1); |
1709 User::LeaveIfError(this->iFsSessionHandle.Connect());//anil |
1725 User::LeaveIfError(this->iFsSessionHandle.Connect());//anil |
1710 User::LeaveIfError(this->iFsSessionHandle.ShareProtected()); |
1726 User::LeaveIfError(this->iFsSessionHandle.ShareProtected()); |
1711 |
1727 |
1712 retVal=iRFileHandle.Open(iFsSessionHandle, _L("c:\\private\\101FB3E7\\WS_IPCImpBigRequest"), EFileStream|EFileRead); |
1728 retVal=iRFileHandle.Open(iFsSessionHandle, _L("c:\\private\\101FB3E7\\WS_IPCImpBigRequest"), EFileStream|EFileRead); |
1713 |
1729 if(retVal != KErrNone) |
|
1730 { |
|
1731 return retVal; |
|
1732 } |
|
1733 |
1714 CleanupClosePushL(iRFileHandle); |
1734 CleanupClosePushL(iRFileHandle); |
1715 HBufC8 *pMsgBuf = NULL;// Buffer to get response |
1735 HBufC8 *pMsgBuf = NULL;// Buffer to get response |
1716 TInt transactionIdOrError = iServiceConnection->SubmitL(iRFileHandle, pMsgBuf); |
1736 TInt transactionIdOrError = iServiceConnection->SubmitL(iRFileHandle, pMsgBuf); |
1717 // LOCAL_ASSERT(transactionIdOrError > KErrNone); |
1737 // LOCAL_ASSERT(transactionIdOrError > KErrNone); |
1718 if(pMsgBuf) |
1738 if(pMsgBuf) |
1750 StartActiveScheduler(1); |
1770 StartActiveScheduler(1); |
1751 User::LeaveIfError(this->iFsSessionHandle.Connect());//anil |
1771 User::LeaveIfError(this->iFsSessionHandle.Connect());//anil |
1752 User::LeaveIfError(this->iFsSessionHandle.ShareProtected()); |
1772 User::LeaveIfError(this->iFsSessionHandle.ShareProtected()); |
1753 |
1773 |
1754 retVal=iRFileHandle.Open(iFsSessionHandle, _L("c:\\private\\101FB3E7\\testPic9.jpg"), EFileStream|EFileRead); |
1774 retVal=iRFileHandle.Open(iFsSessionHandle, _L("c:\\private\\101FB3E7\\testPic9.jpg"), EFileStream|EFileRead); |
1755 |
1775 if(retVal != KErrNone) |
|
1776 { |
|
1777 return retVal; |
|
1778 } |
|
1779 |
1756 CleanupClosePushL(iRFileHandle); |
1780 CleanupClosePushL(iRFileHandle); |
1757 HBufC8 *pMsgBuf = NULL;// Buffer to get response |
1781 HBufC8 *pMsgBuf = NULL;// Buffer to get response |
1758 TInt transactionIdOrError = iServiceConnection->SubmitL(iRFileHandle, pMsgBuf); |
1782 TInt transactionIdOrError = iServiceConnection->SubmitL(iRFileHandle, pMsgBuf); |
1759 // LOCAL_ASSERT(transactionIdOrError > KErrNone); |
1783 // LOCAL_ASSERT(transactionIdOrError > KErrNone); |
1760 if(pMsgBuf) |
1784 if(pMsgBuf) |
1795 } |
1819 } |
1796 |
1820 |
1797 TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_RFileL( TTestResult& aResult ) |
1821 TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SubmitL_RFileL( TTestResult& aResult ) |
1798 { |
1822 { |
1799 SetupL() ; |
1823 SetupL() ; |
1800 TInt retVal(KErrNone); |
1824 //TInt retVal(KErrNone); |
1801 iSenXmlServiceDescription = CSenXmlServiceDescription::NewL(); |
1825 iSenXmlServiceDescription = CSenXmlServiceDescription::NewL(); |
1802 iSenXmlServiceDescription->SetFrameworkIdL(KIDWSFFrameworkID); |
1826 iSenXmlServiceDescription->SetFrameworkIdL(KIDWSFFrameworkID); |
1803 iSenXmlServiceDescription->SetEndPointL(KAddressBookServiceId); |
1827 iSenXmlServiceDescription->SetEndPointL(KAddressBookServiceId); |
1804 TUint32 iapId = SearchIAPIdByNameL(KIAPName); |
1828 TUint32 iapId = SearchIAPIdByNameL(KIAPName); |
1805 iSenXmlServiceDescription->SetIapIdL(iapId); |
1829 iSenXmlServiceDescription->SetIapIdL(iapId); |
1806 TInt err(KErrNone); |
1830 TInt err(KErrNone); |
1807 |
1831 |
1808 //iServiceConnection = CSenServiceConnection::NewL(*this, KAddressBookServiceId()); |
1832 //iServiceConnection = CSenServiceConnection::NewL(*this, KAddressBookServiceId()); |
1809 iServiceConnection = CSenServiceConnection::NewLC(*this, *iSenXmlServiceDescription); |
1833 iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription); |
1810 |
1834 |
1811 StartActiveScheduler(1); |
1835 StartActiveScheduler(1); |
1812 User::LeaveIfError(this->iFsSessionHandle.Connect());//anil |
1836 User::LeaveIfError(this->iFsSessionHandle.Connect());//anil |
1813 User::LeaveIfError(this->iFsSessionHandle.ShareProtected()); |
1837 User::LeaveIfError(this->iFsSessionHandle.ShareProtected()); |
1814 err = iRFileHandle.Open(iFsSessionHandle, _L("c:\\private\\101FB3E7\\Test.txt"), EFileStream|EFileRead); |
1838 err = iRFileHandle.Open(iFsSessionHandle, _L("c:\\private\\101FB3E7\\Test.txt"), EFileStream|EFileRead); |
|
1839 if(err != KErrNone) |
|
1840 { |
|
1841 return err; |
|
1842 } |
|
1843 |
1815 CleanupClosePushL(iRFileHandle); |
1844 CleanupClosePushL(iRFileHandle); |
1816 HBufC8 *pMsgBuf = NULL; |
1845 HBufC8 *pMsgBuf = NULL; |
1817 TInt transactionIdOrError = iServiceConnection->SubmitL(iRFileHandle, pMsgBuf); |
1846 TInt transactionIdOrError = iServiceConnection->SubmitL(iRFileHandle, pMsgBuf); |
1818 if(pMsgBuf) |
1847 if(pMsgBuf) |
1819 { |
1848 { |
1826 //StartActiveScheduler(1); |
1855 //StartActiveScheduler(1); |
1827 CleanupStack::Pop(&iRFileHandle); |
1856 CleanupStack::Pop(&iRFileHandle); |
1828 if(iFsSessionHandle.Handle()) |
1857 if(iFsSessionHandle.Handle()) |
1829 iFsSessionHandle.Close(); |
1858 iFsSessionHandle.Close(); |
1830 |
1859 |
1831 CleanupStack::Pop(iServiceConnection); |
1860 //CleanupStack::Pop(iServiceConnection); |
1832 __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection); |
1861 __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection); |
1833 iServiceConnection = NULL; |
1862 iServiceConnection = NULL; |
1834 |
1863 |
1835 __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription); |
1864 __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription); |
1836 iSenXmlServiceDescription = NULL; |
1865 iSenXmlServiceDescription = NULL; |
1842 |
1871 |
1843 //New Test Case SendL with RFile |
1872 //New Test Case SendL with RFile |
1844 TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_RFileL( TTestResult& aResult ) |
1873 TInt CSenServiceConnectionBCTest::UT_CSenServiceConnection_SendL_RFileL( TTestResult& aResult ) |
1845 { |
1874 { |
1846 SetupL() ; |
1875 SetupL() ; |
1847 TInt retVal(KErrNone); |
1876 //TInt retVal(KErrNone); |
1848 iSenXmlServiceDescription = CSenXmlServiceDescription::NewL(); |
1877 iSenXmlServiceDescription = CSenXmlServiceDescription::NewL(); |
1849 iSenXmlServiceDescription->SetFrameworkIdL(KIDWSFFrameworkID); |
1878 iSenXmlServiceDescription->SetFrameworkIdL(KIDWSFFrameworkID); |
1850 iSenXmlServiceDescription->SetEndPointL(KAddressBookServiceId); |
1879 iSenXmlServiceDescription->SetEndPointL(KAddressBookServiceId); |
1851 TUint32 iapId = SearchIAPIdByNameL(KIAPName); |
1880 TUint32 iapId = SearchIAPIdByNameL(KIAPName); |
1852 iSenXmlServiceDescription->SetIapIdL(iapId); |
1881 iSenXmlServiceDescription->SetIapIdL(iapId); |
1853 TInt err(KErrNone); |
1882 TInt err(KErrNone); |
1854 |
1883 |
1855 //iServiceConnection = CSenServiceConnection::NewL(*this, KAddressBookServiceId()); |
1884 //iServiceConnection = CSenServiceConnection::NewL(*this, KAddressBookServiceId()); |
1856 iServiceConnection = CSenServiceConnection::NewLC(*this, *iSenXmlServiceDescription); |
1885 iServiceConnection = CSenServiceConnection::NewL(*this, *iSenXmlServiceDescription); |
1857 |
1886 |
1858 StartActiveScheduler(1); |
1887 StartActiveScheduler(1); |
1859 /* |
1888 /* |
1860 _LIT16(KRFileSrc,"c\\private\\101FB3E7\\Test.txt"); |
1889 _LIT16(KRFileSrc,"c\\private\\101FB3E7\\Test.txt"); |
1861 TInt err = iRFileHandle.Open(iFsSessionHandle,_L("c:\\private\\101FB3E7\\Test.txt"),EFileWrite); |
1890 TInt err = iRFileHandle.Open(iFsSessionHandle,_L("c:\\private\\101FB3E7\\Test.txt"),EFileWrite); |
1868 iRFileHandle.Close(); |
1897 iRFileHandle.Close(); |
1869 */ |
1898 */ |
1870 User::LeaveIfError(this->iFsSessionHandle.Connect());//anil |
1899 User::LeaveIfError(this->iFsSessionHandle.Connect());//anil |
1871 User::LeaveIfError(this->iFsSessionHandle.ShareProtected()); |
1900 User::LeaveIfError(this->iFsSessionHandle.ShareProtected()); |
1872 err = iRFileHandle.Open(iFsSessionHandle, _L("c:\\private\\101FB3E7\\Test.txt"), EFileStream|EFileRead); |
1901 err = iRFileHandle.Open(iFsSessionHandle, _L("c:\\private\\101FB3E7\\Test.txt"), EFileStream|EFileRead); |
|
1902 if(err != KErrNone) |
|
1903 { |
|
1904 return err; |
|
1905 } |
|
1906 |
1873 CleanupClosePushL(iRFileHandle); |
1907 CleanupClosePushL(iRFileHandle); |
1874 TInt transactionIdOrError = iServiceConnection->SendL(iRFileHandle); |
1908 TInt transactionIdOrError = iServiceConnection->SendL(iRFileHandle); |
1875 if (transactionIdOrError == KErrNone) |
1909 if (transactionIdOrError == KErrNone) |
1876 StartActiveScheduler(1); |
1910 StartActiveScheduler(1); |
1877 // LOCAL_ASSERT(transactionIdOrError > KErrNone); |
1911 // LOCAL_ASSERT(transactionIdOrError > KErrNone); |
1878 |
1912 //CleanupStack::Pop(&iRFileHandle); |
1879 CleanupStack::PopAndDestroy(&iRFileHandle); |
1913 CleanupStack::PopAndDestroy(&iRFileHandle); |
1880 if(iFsSessionHandle.Handle()) |
1914 if(iFsSessionHandle.Handle()) |
1881 iFsSessionHandle.Close(); |
1915 iFsSessionHandle.Close(); |
1882 |
1916 |
1883 CleanupStack::Pop(iServiceConnection); |
1917 //CleanupStack::Pop(iServiceConnection); |
1884 __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection); |
1918 __ASSERT_ALWAYS_NO_LEAVE(delete iServiceConnection); |
1885 iServiceConnection = NULL; |
1919 iServiceConnection = NULL; |
1886 __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription); |
1920 __ASSERT_ALWAYS_NO_LEAVE(delete iSenXmlServiceDescription); |
1887 iSenXmlServiceDescription = NULL; |
1921 iSenXmlServiceDescription = NULL; |
1888 |
1922 |
6886 { |
6920 { |
6887 |
6921 |
6888 iLog->Log(_L("CoBrand->start")); |
6922 iLog->Log(_L("CoBrand->start")); |
6889 SetupL(); |
6923 SetupL(); |
6890 |
6924 |
6891 TInt retVal(0); |
6925 // TInt retVal(0); |
6892 iCoBrandingCallbackOption = ETrue; |
6926 iCoBrandingCallbackOption = ETrue; |
6893 |
6927 |
6894 _LIT8(KFramework, "WS-STAR"); |
6928 _LIT8(KFramework, "WS-STAR"); |
6895 _LIT8(KIdpEndPoint, "http://10.21.32.20/wsstar/cobranding/STS_CB_001.aspx"); |
6929 _LIT8(KIdpEndPoint, "http://10.21.32.20/wsstar/cobranding/STS_CB_001.aspx"); |
6896 _LIT8(KSdEndPoint, "http://10.21.32.20/WSStar/Trust/WSService.aspx"); |
6930 _LIT8(KSdEndPoint, "http://10.21.32.20/WSStar/Trust/WSService.aspx"); |
6931 SetPolicyL(pSmSd, KPolicySOAP12, KNullDesC8); |
6965 SetPolicyL(pSmSd, KPolicySOAP12, KNullDesC8); |
6932 SetPolicyL(pSmSd, KTokenType, KTokenTypeVal); |
6966 SetPolicyL(pSmSd, KTokenType, KTokenTypeVal); |
6933 SetPolicyL(pSmSd, KPassportExtensions, KNullDesC8); |
6967 SetPolicyL(pSmSd, KPassportExtensions, KNullDesC8); |
6934 iLog->Log(_L("CSenXmlServiceDescription* pSmSd = CSenXmlServiceDescription::NewLC()")); |
6968 iLog->Log(_L("CSenXmlServiceDescription* pSmSd = CSenXmlServiceDescription::NewLC()")); |
6935 TInt error = manager->RegisterServiceDescriptionL( *pSmSd); |
6969 TInt error = manager->RegisterServiceDescriptionL( *pSmSd); |
|
6970 if(error != KErrNone) |
|
6971 { |
|
6972 return error; |
|
6973 } |
|
6974 |
6936 iLog->Log(_L("manager->RegisterServiceDescriptionL( *pSmSd);")); |
6975 iLog->Log(_L("manager->RegisterServiceDescriptionL( *pSmSd);")); |
6937 |
6976 |
6938 CSenXmlServiceDescription* pScSd = CSenServicePattern::NewLC(); |
6977 CSenXmlServiceDescription* pScSd = CSenServicePattern::NewLC(); |
6939 pScSd->SetFrameworkIdL(KFramework); |
6978 pScSd->SetFrameworkIdL(KFramework); |
6940 pScSd->SetContractL(KSdContract); |
6979 pScSd->SetContractL(KSdContract); |
6998 iLog->Log(_L("HostletConsumer->start")); |
7037 iLog->Log(_L("HostletConsumer->start")); |
6999 SetupL(); |
7038 SetupL(); |
7000 |
7039 |
7001 iHostletConsumerOption = ETrue; |
7040 iHostletConsumerOption = ETrue; |
7002 |
7041 |
7003 TInt retVal(KErrNone); |
7042 //TInt retVal(KErrNone); |
7004 _LIT8(KReq,"<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\">Some Query</ab:Query>"); |
7043 _LIT8(KReq,"<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\">Some Query</ab:Query>"); |
7005 _LIT8(KEndPoint, "http://10.21.32.110/sereneHardCoded/WS_CM_001_001"); |
7044 _LIT8(KEndPoint, "http://10.21.32.110/sereneHardCoded/WS_CM_001_001"); |
7006 |
7045 |
7007 iSenXmlServiceDescription = CSenServicePattern::NewL(); |
7046 iSenXmlServiceDescription = CSenServicePattern::NewL(); |
7008 iSenXmlServiceDescription->SetFrameworkIdL(KRESTFrameworkID); |
7047 iSenXmlServiceDescription->SetFrameworkIdL(KRESTFrameworkID); |
7031 |
7070 |
7032 iHostletConsumerOption = EFalse; |
7071 iHostletConsumerOption = EFalse; |
7033 |
7072 |
7034 Teardown(); |
7073 Teardown(); |
7035 iLog->Log(_L("HostletConsumer->End")); |
7074 iLog->Log(_L("HostletConsumer->End")); |
|
7075 return ret; |
7036 } |
7076 } |
7037 |
7077 |
7038 void CSenServiceConnectionBCTest::SetConnectionId( TInt aConnectionId ) |
7078 void CSenServiceConnectionBCTest::SetConnectionId( TInt aConnectionId ) |
7039 { |
7079 { |
7040 TInt connectonId = 0; |
7080 TInt connectonId = 0; |
7041 connectonId = aConnectionId; |
7081 connectonId = aConnectionId; |
|
7082 iLog->Log(_L("Connection Id is %d"),connectonId); |
7042 } |
7083 } |
7043 |
7084 |
7044 TInt CSenServiceConnectionBCTest::DataTrafficDetailsL(TTestResult& aResult) |
7085 TInt CSenServiceConnectionBCTest::DataTrafficDetailsL(TTestResult& aResult) |
7045 { |
7086 { |
7046 iLog->Log(_L("DataTrafficDetails->start")); |
7087 iLog->Log(_L("DataTrafficDetails->start")); |
7047 SetupL(); |
7088 SetupL(); |
7048 |
7089 |
7049 iGetDataTrafficDetails = ETrue; |
7090 iGetDataTrafficDetails = ETrue; |
7050 |
7091 |
7051 TInt retVal(KErrNone); |
7092 //TInt retVal(KErrNone); |
7052 _LIT8(KReq,"<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\">Some Query</ab:Query>"); |
7093 _LIT8(KReq,"<ab:Query xmlns:ab=\"urn:nokia:test:addrbook:2004-09\">Some Query</ab:Query>"); |
7053 _LIT8(KEndPoint, "http://10.21.32.110/sereneHardCoded/WS_CM_001_001"); |
7094 _LIT8(KEndPoint, "http://10.21.32.110/sereneHardCoded/WS_CM_001_001"); |
7054 |
7095 |
7055 iSenXmlServiceDescription = CSenServicePattern::NewL(); |
7096 iSenXmlServiceDescription = CSenServicePattern::NewL(); |
7056 iSenXmlServiceDescription->SetFrameworkIdL(KRESTFrameworkID); |
7097 iSenXmlServiceDescription->SetFrameworkIdL(KRESTFrameworkID); |