Commit f2228fd
Feature - Initialization Sync, Async (#167)
* Features:
Created two new APIs to simplify the initialization process for mobile:
- initializeAsync
- initializeSync
Also Added three unit tests in OptimizelyManager:
-InitializeAsync
-InitializeSync
-InitializeSyncWithEmptyDataFile
* Changes made to catch null pointer exception if given R.raw path of data file is null
added assertnull for optimizelyStartListener in initializeAsync test that on completion it should be null
* Added Empty datafile to pass unit test of check sync with empty datafile
* Changes made to download file on initializing optimizely manager
* - Renamed functions of inititalize sync and async
- Refactored code to look more like ios Initialize methods (Except reading files in SDK instead of asking user to do that)
* Removed unused functions and test cases
Added comments
did code refactoring
* Removed initialize just from cache method.
* - Changes made for asynchronus initialize to take downloaded file first than cache file
- Added new test cases for empty datafile
- refactored code to get datafile from cache if not available than from Raw data file
* Commented unused loaddatafile variable
* Removed unused function of loaddatafilefromcachetask
* 1) Added boolean variable in initialized method to check if update using download should take place after initialization
2)updated comment in datafileloader.java
3) updated testcases
4) handled if datafile is null
* 1) Added boolean variable in initialized method to check if update using download should take place after initialization (#11)
2)updated comment in datafileloader.java
3) updated testcases
4) handled if datafile is null
* Updated Init test cases and resolved datafile issue of not found resource id
* Bug fix of esspresso test of test app not running
* Updated test cases and resolved bug of Raw id not found on release (#14)
* Updated Init test cases and resolved datafile issue of not found resource id
* Bug fix of esspresso test of test app not running
* Updated comments and Allowed null resource ID in Initialize(Context,Integer,OptimizelyStartListener)1 parent cd7a387 commit f2228fd
File tree
10 files changed
+193
-163
lines changed- android-sdk/src
- androidTest/java/com/optimizely/ab/android/sdk
- debug/res/raw
- main/java/com/optimizely/ab/android/sdk
- test/java/com/optimizely/ab/android/sdk
- datafile-handler/src/main/java/com/optimizely/ab/android/datafile_handler
- test-app/src
- androidTest/java/com/optimizely/ab/android/test_app
- main/java/com/optimizely/ab/android/test_app
10 files changed
+193
-163
lines changedLines changed: 76 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | 97 | | |
114 | 98 | | |
115 | 99 | | |
| |||
132 | 116 | | |
133 | 117 | | |
134 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
135 | 192 | | |
136 | 193 | | |
137 | 194 | | |
| |||
169 | 226 | | |
170 | 227 | | |
171 | 228 | | |
172 | | - | |
| 229 | + | |
173 | 230 | | |
174 | 231 | | |
175 | 232 | | |
| |||
182 | 239 | | |
183 | 240 | | |
184 | 241 | | |
185 | | - | |
| 242 | + | |
186 | 243 | | |
187 | 244 | | |
188 | 245 | | |
| |||
Whitespace-only changes.
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
40 | | - | |
| 39 | + | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
| |||
Lines changed: 70 additions & 61 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
135 | 153 | | |
136 | 154 | | |
137 | 155 | | |
138 | | - | |
139 | 156 | | |
140 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
141 | 161 | | |
142 | 162 | | |
143 | 163 | | |
144 | 164 | | |
145 | 165 | | |
146 | 166 | | |
147 | 167 | | |
148 | | - | |
149 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
150 | 171 | | |
151 | 172 | | |
152 | 173 | | |
153 | 174 | | |
154 | 175 | | |
155 | 176 | | |
156 | 177 | | |
157 | | - | |
158 | | - | |
159 | 178 | | |
160 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
161 | 182 | | |
162 | 183 | | |
163 | 184 | | |
164 | 185 | | |
165 | 186 | | |
166 | 187 | | |
167 | 188 | | |
168 | | - | |
| 189 | + | |
169 | 190 | | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
174 | 197 | | |
175 | 198 | | |
176 | 199 | | |
177 | 200 | | |
178 | 201 | | |
179 | 202 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
189 | 208 | | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
200 | 225 | | |
201 | | - | |
202 | 226 | | |
203 | 227 | | |
204 | 228 | | |
| |||
207 | 231 | | |
208 | 232 | | |
209 | 233 | | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | 234 | | |
225 | 235 | | |
| 236 | + | |
226 | 237 | | |
227 | | - | |
| 238 | + | |
228 | 239 | | |
229 | | - | |
| 240 | + | |
| 241 | + | |
230 | 242 | | |
231 | 243 | | |
232 | 244 | | |
233 | | - | |
234 | | - | |
| 245 | + | |
| 246 | + | |
235 | 247 | | |
236 | 248 | | |
237 | | - | |
| 249 | + | |
238 | 250 | | |
239 | 251 | | |
240 | 252 | | |
241 | 253 | | |
242 | 254 | | |
243 | | - | |
| 255 | + | |
244 | 256 | | |
245 | 257 | | |
246 | | - | |
247 | | - | |
248 | | - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
249 | 261 | | |
250 | 262 | | |
251 | 263 | | |
252 | 264 | | |
253 | 265 | | |
254 | | - | |
255 | | - | |
256 | | - | |
| 266 | + | |
257 | 267 | | |
258 | 268 | | |
259 | 269 | | |
| |||
281 | 291 | | |
282 | 292 | | |
283 | 293 | | |
284 | | - | |
| 294 | + | |
285 | 295 | | |
286 | 296 | | |
287 | 297 | | |
288 | | - | |
| 298 | + | |
289 | 299 | | |
290 | 300 | | |
291 | 301 | | |
| |||
527 | 537 | | |
528 | 538 | | |
529 | 539 | | |
530 | | - | |
531 | 540 | | |
532 | 541 | | |
533 | 542 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
0 commit comments