|
1 // |
|
2 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 // All rights reserved. |
|
4 // This component and the accompanying materials are made available |
|
5 // under the terms of "Eclipse Public License v1.0" |
|
6 // which accompanies this distribution, and is available |
|
7 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 // |
|
9 // Initial Contributors: |
|
10 // Nokia Corporation - initial contribution. |
|
11 // |
|
12 // Contributors: |
|
13 // |
|
14 // Description: |
|
15 // |
|
16 // |
|
17 PRINT Run TestCalIndexFile Backup&Restore Tests |
|
18 // |
|
19 // set up the directories needed |
|
20 RUN_UTILS MkDir C:\private\10003a5b\ |
|
21 RUN_UTILS MkDir E:\CalBackup\ |
|
22 |
|
23 // NOTE: This test case requires the presence of a removable drive, specifically E. This must be set up (a) for the H4 board by having an MMC |
|
24 // card in the proper slot or (b) for WINSCW by having the following line in the epoc.ini "_EPOC_DRIVE_E \\epoc32\\winscw\\e" and having |
|
25 // the mapped drive created. |
|
26 // If this is NOT done, then the test will fail with -18 (KErrNotReady) |
|
27 // |
|
28 // NOTE; IN addition to the calendar test executables, this test requires the a test build be done in |
|
29 // ....src\common\testtools\burtestserver\Group |
|
30 |
|
31 START_TESTCASE PIM-CT-PERFIDX-DEV-0007 |
|
32 // NOTE: This test case requires the presence of a removable drive, specifically E. This must be set up (a) for the H4 board by having an MMC |
|
33 // card in the proper slot or (b) for WINSCW by having the following line in the epoc.ini "_EPOC_DRIVE_E \\epoc32\\winscw\\e" and having |
|
34 // the mapped drive created. |
|
35 // If this is NOT done, then the test will fail with -18 (KErrNotReady) |
|
36 // |
|
37 |
|
38 //! @SYMTestCaseID PIM-CT-PERFIDX-DEV-0007 |
|
39 //! @SYMTestCaseDesc Ensure that the presence of the index file does not interfere with the back-up of the calendar database. |
|
40 //! Ensure that the index file is backed up and restored |
|
41 //! |
|
42 //! @SYMFssID <App-Engines><AgnModel>SM9 |
|
43 //! @SYMREQ REQ6105 |
|
44 //! @SYMTestStatus Implemented |
|
45 //! @SYMTestPriority Medium |
|
46 //! @SYMTestActions 1.Ensure that the private data folder used by the calendar contains a known calendar and a corresponding valid index file. |
|
47 //! 2.Start a backup of the calendar file |
|
48 //! 3.Check that file has been backed up. |
|
49 //! 4.Restore the calendar file |
|
50 //! 5.Check that calendar file is restored and that no index file is present |
|
51 //! |
|
52 //! @SYMTestExpectedResults In step 2, the calendar file should be in the destination for the backup. |
|
53 //! In step 4, the calendar file should be in the private directory in which contains the calendar file but no index file. |
|
54 //! @SYMTestType CT |
|
55 |
|
56 |
|
57 // copy calendar DB and index files to place from which they will be backed up |
|
58 // and to which they will be restored |
|
59 // We want to check on Calendar0 with an index and Calendar1 without an index - |
|
60 // therefore we try to delete the Calendar1 index just in case it is already there |
|
61 // from a previous test. |
|
62 RUN_UTILS CopyFile \CalIndexFileTestData\Calendar0 c:\private\10003a5b\Calendar0 |
|
63 RUN_UTILS CopyFile \CalIndexFileTestData\Calendar0Idx c:\private\10003a5b\Calendar0Idx |
|
64 RUN_UTILS CopyFile \CalIndexFileTestData\Calendar1 c:\private\10003a5b\Calendar1 |
|
65 RUN_UTILS DeleteFile c:\private\10003a5b\Calendar1Idx |
|
66 |
|
67 |
|
68 LOAD_SUITE BURTestServer |
|
69 // |
|
70 |
|
71 // CT-PIM-PERFIDX-DEV-0007 |
|
72 PRINT Backup Starts |
|
73 RUN_TEST_STEP -1 BURTestServer TestBackup \CalIndexFileTestData\burtest.ini default |
|
74 PRINT Backup Ended |
|
75 |
|
76 // delete files in source so that we know that they have been restored and not just left |
|
77 // in place |
|
78 PRINT Cleaning files so that restore operation is confirmed |
|
79 RUN_UTILS DeleteFile c:\private\10003a5b\Calendar0 |
|
80 RUN_UTILS DeleteFile c:\private\10003a5b\Calendar0Idx |
|
81 RUN_UTILS DeleteFile c:\private\10003a5b\Calendar1 |
|
82 |
|
83 |
|
84 PRINT Restore Starts |
|
85 RUN_TEST_STEP -1 BURTestServer TestRestore \CalIndexFileTestData\burtest.ini default |
|
86 PRINT Restore Ended |
|
87 |
|
88 // now check that the files are still useful |
|
89 LOAD_SUITE TestCalIndexFileSuite |
|
90 PRINT Verifying calendar and index file contents after restore |
|
91 // uses Calendar1 and assumes no index file present |
|
92 RUN_TEST_STEP 100 TestCalIndexFileSuite TestCalIndexFileOpenStep \CalIndexFileTestData\opentest.ini test2 |
|
93 |
|
94 // uses Calendar0 and assumes an index file is present |
|
95 RUN_TEST_STEP 100 TestCalIndexFileSuite TestCalIndexFileOpenwithIndexStep \CalIndexFileTestData\opentest.ini test1 |
|
96 END_TESTCASE PIM-CT-PERFIDX-DEV-0007 |
|
97 |
|
98 |
|
99 |
|
100 PRINT Completed TestCalIndexFile Backup&Restore Tests |