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 |
|
18 #include "ut_spsbackuphelpermonitor.h" |
|
19 #include <EUnitMacros.h> |
|
20 #include <EUnitDecorators.h> |
|
21 |
|
22 #include <spentry.h> |
|
23 #include <spproperty.h> |
|
24 #include "spsbackuphelpermonitor.h" |
|
25 |
|
26 // - Construction ----------------------------------------------------------- |
|
27 |
|
28 Ut_CSpsBackupHelperMonitor* Ut_CSpsBackupHelperMonitor::NewL() |
|
29 { |
|
30 Ut_CSpsBackupHelperMonitor* self = new (ELeave) Ut_CSpsBackupHelperMonitor; |
|
31 CleanupStack::PushL(self); |
|
32 self->ConstructL(); |
|
33 CleanupStack::Pop(self); |
|
34 return self; |
|
35 } |
|
36 |
|
37 Ut_CSpsBackupHelperMonitor::~Ut_CSpsBackupHelperMonitor() |
|
38 { |
|
39 } |
|
40 |
|
41 Ut_CSpsBackupHelperMonitor::Ut_CSpsBackupHelperMonitor() |
|
42 { |
|
43 } |
|
44 |
|
45 void Ut_CSpsBackupHelperMonitor::ConstructL() |
|
46 { |
|
47 CEUnitTestSuiteClass::ConstructL(); |
|
48 } |
|
49 |
|
50 // - Test methods ----------------------------------------------------------- |
|
51 |
|
52 |
|
53 |
|
54 void Ut_CSpsBackupHelperMonitor::SetupL( ) |
|
55 { |
|
56 iMonitor = CSpsBackupHelperMonitor::NewL(); |
|
57 } |
|
58 |
|
59 |
|
60 void Ut_CSpsBackupHelperMonitor::Teardown( ) |
|
61 { |
|
62 delete iMonitor; |
|
63 iMonitor = NULL; |
|
64 } |
|
65 |
|
66 |
|
67 void Ut_CSpsBackupHelperMonitor::Ut_ConstructL() |
|
68 { |
|
69 // Do nothing |
|
70 } |
|
71 |
|
72 void Ut_CSpsBackupHelperMonitor::Ut_FullBackupOngoingSetupL() |
|
73 { |
|
74 RProperty prop; |
|
75 prop.Attach( KUidSystemCategory, conn::KUidBackupRestoreKey ); |
|
76 prop.Set( EBURBackupFull ); |
|
77 iMonitor = CSpsBackupHelperMonitor::NewL(); |
|
78 prop.Close(); |
|
79 } |
|
80 |
|
81 void Ut_CSpsBackupHelperMonitor::Ut_PartialBackupOngoingSetupL() |
|
82 { |
|
83 RProperty prop; |
|
84 prop.Attach( KUidSystemCategory, conn::KUidBackupRestoreKey ); |
|
85 prop.Set( EBURBackupPartial ); |
|
86 iMonitor = CSpsBackupHelperMonitor::NewL(); |
|
87 prop.Close(); |
|
88 } |
|
89 |
|
90 void Ut_CSpsBackupHelperMonitor::Ut_FullRestoreOngoingSetupL() |
|
91 { |
|
92 RProperty prop; |
|
93 prop.Attach( KUidSystemCategory, conn::KUidBackupRestoreKey ); |
|
94 prop.Set( EBURRestoreFull ); |
|
95 iMonitor = CSpsBackupHelperMonitor::NewL(); |
|
96 prop.Close(); |
|
97 } |
|
98 |
|
99 void Ut_CSpsBackupHelperMonitor::Ut_PartialRestoreOngoingSetupL() |
|
100 { |
|
101 RProperty prop; |
|
102 prop.Attach( KUidSystemCategory, conn::KUidBackupRestoreKey ); |
|
103 prop.Set( EBURRestorePartial ); |
|
104 iMonitor = CSpsBackupHelperMonitor::NewL(); |
|
105 prop.Close(); |
|
106 } |
|
107 |
|
108 // - EUnit test table ------------------------------------------------------- |
|
109 |
|
110 EUNIT_BEGIN_TEST_TABLE( |
|
111 Ut_CSpsBackupHelperMonitor, |
|
112 "Add test suite description here.", |
|
113 "UNIT" ) |
|
114 |
|
115 EUNIT_TEST( |
|
116 "Construct - destruct", |
|
117 "CSPSettingsEngine", |
|
118 "Construct - destruct", |
|
119 "FUNCTIONALITY", |
|
120 SetupL, Ut_ConstructL, Teardown) |
|
121 |
|
122 EUNIT_TEST( |
|
123 "FullBackup Construct - destruct", |
|
124 "CSPSettingsEngine", |
|
125 "Construct - destruct", |
|
126 "FUNCTIONALITY", |
|
127 Ut_FullBackupOngoingSetupL, Ut_ConstructL, Teardown) |
|
128 |
|
129 EUNIT_TEST( |
|
130 "PartialBackup Construct - destruct", |
|
131 "CSPSettingsEngine", |
|
132 "Construct - destruct", |
|
133 "FUNCTIONALITY", |
|
134 Ut_PartialBackupOngoingSetupL, Ut_ConstructL, Teardown) |
|
135 |
|
136 EUNIT_TEST( |
|
137 "FullRestore Construct - destruct", |
|
138 "CSPSettingsEngine", |
|
139 "Construct - destruct", |
|
140 "FUNCTIONALITY", |
|
141 Ut_FullRestoreOngoingSetupL, Ut_ConstructL, Teardown) |
|
142 |
|
143 EUNIT_TEST( |
|
144 "PartialRestore Construct - destruct", |
|
145 "CSPSettingsEngine", |
|
146 "Construct - destruct", |
|
147 "FUNCTIONALITY", |
|
148 Ut_PartialRestoreOngoingSetupL, Ut_ConstructL, Teardown) |
|
149 |
|
150 EUNIT_END_TEST_TABLE |
|