void CPopsTestHarness::DoLocalCopyTestL() // Test copying a message locally. ie create a message in the Drafts folder // and copy it to a local sub folder { // Create the Message in the Drafts Folder iTestUtils->CreateMessageL(KTestMsgPath, KMsvDraftEntryId, KMsvDraftEntryId); CMsvServerEntry* serverEntry = iTestUtils->iServerEntry; serverEntry->SetEntry(KMsvDraftEntryId); CMsvEntrySelection* newMessageList = new (ELeave)CMsvEntrySelection(); CleanupStack::PushL(newMessageList); serverEntry->GetChildren(*newMessageList); TMsvId newMessageId = (*newMessageList)[0]; // Create a local folder under the Drafts folder TMsvEntry parentEntry = serverEntry->Entry(); TMsvEntry newFolder; newFolder.SetStandardFolder(ETrue); newFolder.iDetails.Set(KSubFolder); newFolder.iType.iUid=KUidMsvFolderEntryValue; newFolder.iMtm=parentEntry.iMtm; newFolder.iServiceId = parentEntry.iServiceId; serverEntry->CreateEntry(newFolder); // Fill the Disk Space and attempt to do the Copy FillDiskL(); // Copy the message into the new LOCAL Sub-Folder CTestActive* active = new(ELeave) CTestActive; CleanupStack::PushL(active); serverEntry->CopyEntryL(newMessageId, newFolder.Id(), active->iStatus); active->StartL(); CActiveScheduler::Start(); CleanupStack::PopAndDestroy(2); // newMessageList, active }
void CPopsTestHarness::TestOfflineCopyL(const TDesC& aPassText, const TDesC& aFailText) // ------------------------------------------------------------------ // Test Offline Copy - Populate some Messages & then try to create // Offline Ops to copy them locally // ------------------------------------------------------------------ { iTestError = 0; iTestNumber++; // Connect & Populate all the messages first SetUpTestL(K_SCRIPT_POPULATE_ALL); TRAPD(test2Error, StartTestL(*iConnectAndPopulateAll)); // Now reset, but DONT delete the Mail directory. iRemoveMailFolder = EFalse; SetUpTestL(K_SCRIPT_OFFLINE_COPY); // Fill the Disk & attempt to do an Offline Copy FillDiskL(); TRAPD(error, StartTestL(*iOfflineCopy)); // Check if the Test Failed CheckIfTestFailedL(error, *iOfflineCopy, aPassText, aFailText); EndTestL(); }
void CLowDiskSpaceTest::RunL() { TVolumeInfo tv; switch(iCount) { case EFillDisk: FillDiskL();//Fill the disk iCount++; Start(); break; case EDatabaseTest: User::LeaveIfError( iFileSession.Volume(tv) ); if(tv.iFree >= KLowDiskThreshold) { test.Printf(_L("Free space increased, refill the disk again.\n")); ClearDiskL(); FillDiskL();//Fill the disk Start(); break; } DatabaseTestL(); iCount++; Start(); break; case EClearDisk: ClearDiskL(); iCount++; Start(); break; default: CActiveScheduler::Stop(); break; } }
void CPopsTestHarness::TestCopyToLocalL(const TDesC& aPassText, const TDesC& aFailText) // ------------------------------------ // Test Copying To Local // ------------------------------------ { iTestError = 0; iTestNumber++; SetUpTestL(K_SCRIPT_COPY_ALL); FillDiskL(); TRAPD(testError, StartTestL(*iConnectAndCopyAll)); // Check if the Test Failed CheckIfTestFailedL(testError, *iConnectAndCopyAll, aPassText, aFailText); EndTestL(); }
void CPopsTestHarness::TestCopyWithinServiceL(const TDesC& aPassText, const TDesC& aFailText) // ------------------------------------ // Test Copy Within Service // ------------------------------------ { iTestError = 0; iTestNumber++; SetUpTestL(K_SCRIPT_POPULATE_ALL); FillDiskL(); TRAPD(testError, StartTestL(*iConnectAndPopulateAll)); // Check if the Test Failed CheckIfTestFailedL(testError, *iConnectAndPopulateAll, aPassText, aFailText); EndTestL(); }