rhoconnect-client 5.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +9 -0
  3. data/CREDITS +0 -0
  4. data/LICENSE +9 -0
  5. data/README.md +47 -0
  6. data/ext/rhoconnect-client/RhoConnectClient.rb +190 -0
  7. data/ext/rhoconnect-client/ext/RhoConnectClient.xml +726 -0
  8. data/ext/rhoconnect-client/ext/build +26 -0
  9. data/ext/rhoconnect-client/ext/build.bat +30 -0
  10. data/ext/rhoconnect-client/ext/platform/android/ext_java.files +1 -0
  11. data/ext/rhoconnect-client/ext/platform/android/ext_native.files +14 -0
  12. data/ext/rhoconnect-client/ext/platform/android/src/com/rhoconnectclient/RhoconnectClient.java +1 -0
  13. data/ext/rhoconnect-client/ext/platform/iphone/.gitignore +1 -0
  14. data/ext/rhoconnect-client/ext/platform/iphone/Rakefile +74 -0
  15. data/ext/rhoconnect-client/ext/platform/iphone/RhoconnectClient.xcodeproj/project.pbxproj +390 -0
  16. data/ext/rhoconnect-client/ext/platform/iphone/RhoconnectClient_Prefix.pch +7 -0
  17. data/ext/rhoconnect-client/ext/platform/iphone/impl/readme.txt +7 -0
  18. data/ext/rhoconnect-client/ext/platform/qt/Rakefile +35 -0
  19. data/ext/rhoconnect-client/ext/platform/qt/rhoconnect-client.pro +88 -0
  20. data/ext/rhoconnect-client/ext/platform/wm/Rhoconnect-client.sln +36 -0
  21. data/ext/rhoconnect-client/ext/platform/wm/Rhoconnect-client.vcproj +774 -0
  22. data/ext/rhoconnect-client/ext/platform/wm/Rhoconnect-client.vsprops +15 -0
  23. data/ext/rhoconnect-client/ext/platform/wm/src/rhoconnectclient_wm.cpp +40 -0
  24. data/ext/rhoconnect-client/ext/platform/wm/src/rhoconnectclient_wm.h +2 -0
  25. data/ext/rhoconnect-client/ext/platform/wp8/Rhoconnect-client.props +22 -0
  26. data/ext/rhoconnect-client/ext/platform/wp8/Rhoconnect-client.sln +32 -0
  27. data/ext/rhoconnect-client/ext/platform/wp8/Rhoconnect-client.vcxproj +220 -0
  28. data/ext/rhoconnect-client/ext/platform/wp8/Rhoconnect-client.vcxproj.filters +103 -0
  29. data/ext/rhoconnect-client/ext/shared/RhoConnectClientImpl.cpp +273 -0
  30. data/ext/rhoconnect-client/ext/shared/RhoConnectClientImpl.h +60 -0
  31. data/ext/rhoconnect-client/ext/shared/RhoConnectClientSingletonImpl.h +53 -0
  32. data/ext/rhoconnect-client/ext/shared/initRhoconnectClient.cpp +207 -0
  33. data/ext/rhoconnect-client/ext/shared/rhoconnectclient.c +18 -0
  34. data/ext/rhoconnect-client/ext/shared/sync/ClientRegister.cpp +398 -0
  35. data/ext/rhoconnect-client/ext/shared/sync/ClientRegister.h +147 -0
  36. data/ext/rhoconnect-client/ext/shared/sync/ISyncProtocol.h +91 -0
  37. data/ext/rhoconnect-client/ext/shared/sync/SyncEngine.cpp +1245 -0
  38. data/ext/rhoconnect-client/ext/shared/sync/SyncEngine.h +213 -0
  39. data/ext/rhoconnect-client/ext/shared/sync/SyncNotify.cpp +737 -0
  40. data/ext/rhoconnect-client/ext/shared/sync/SyncNotify.h +209 -0
  41. data/ext/rhoconnect-client/ext/shared/sync/SyncProtocol_3.h +220 -0
  42. data/ext/rhoconnect-client/ext/shared/sync/SyncProtocol_4.h +259 -0
  43. data/ext/rhoconnect-client/ext/shared/sync/SyncSource.cpp +1694 -0
  44. data/ext/rhoconnect-client/ext/shared/sync/SyncSource.h +212 -0
  45. data/ext/rhoconnect-client/ext/shared/sync/SyncThread.cpp +583 -0
  46. data/ext/rhoconnect-client/ext/shared/sync/SyncThread.h +250 -0
  47. data/ext/rhoconnect-client/ext.yml +12 -0
  48. data/lib/build/run_rhoconnect_spec.rb +135 -0
  49. data/lib/rhoconnect-client.rb +3 -0
  50. data/platform/shared/RhoConnectClient/RhoConnectClient.cpp +1673 -0
  51. data/platform/shared/RhoConnectClient/RhoConnectClient.h +181 -0
  52. data/platform/shared/RhoConnectClient/RhoError.h +77 -0
  53. data/rhoconnect-client/C++/Tests/RhoConnectClientTest.cpp +830 -0
  54. data/rhoconnect-client/C++/Tests/win32/.gitignore +3 -0
  55. data/rhoconnect-client/C++/Tests/win32/RhoConnectClient.sln +65 -0
  56. data/rhoconnect-client/C++/Tests/win32/RhoConnectClient.vcproj +634 -0
  57. data/rhoconnect-client/C++/Tests/win32/RhoConnectClientTest/RhoConnectClientTest.vcproj +222 -0
  58. data/rhoconnect-client/C++/Tests/win32/RhoConnectClientTest/stdafx.h +65 -0
  59. data/rhoconnect-client/C++/Tests/win32/stdafx.h +65 -0
  60. data/rhoconnect-client/CHANGELOG +18 -0
  61. data/rhoconnect-client/Java/Android/build/android.rake +387 -0
  62. data/rhoconnect-client/Java/Android/build/android_sdk.rb +582 -0
  63. data/rhoconnect-client/Java/Android/build/libcurl_build.files +73 -0
  64. data/rhoconnect-client/Java/Android/build/libjson_build.files +9 -0
  65. data/rhoconnect-client/Java/Android/build/librhocommon_build.files +14 -0
  66. data/rhoconnect-client/Java/Android/build/librhodb_build.files +5 -0
  67. data/rhoconnect-client/Java/Android/build/librhoimpl_build.files +13 -0
  68. data/rhoconnect-client/Java/Android/build/librholog_build.files +4 -0
  69. data/rhoconnect-client/Java/Android/build/libsqlite_build.files +1 -0
  70. data/rhoconnect-client/Java/Android/build/libsync_build.files +7 -0
  71. data/rhoconnect-client/Java/Android/build/libunzip_build.files +1 -0
  72. data/rhoconnect-client/Java/Android/build/rhoconnectclient_build.files +3 -0
  73. data/rhoconnect-client/Java/Android/build/rhoimpljava_build.files +21 -0
  74. data/rhoconnect-client/Java/Android/src/com/rhomobile/rhodes/Capabilities.java +63 -0
  75. data/rhoconnect-client/Java/Android/src/com/rhomobile/rhodes/MemoryInfoCollector.java +79 -0
  76. data/rhoconnect-client/Java/Android/src/com/rhomobile/rhodes/util/ContextFactory.java +63 -0
  77. data/rhoconnect-client/Java/Android/test/.classpath +9 -0
  78. data/rhoconnect-client/Java/Android/test/.project +33 -0
  79. data/rhoconnect-client/Java/Android/test/AndroidManifest.xml +14 -0
  80. data/rhoconnect-client/Java/Android/test/assets/apps/androidtest.png +0 -0
  81. data/rhoconnect-client/Java/Android/test/assets/apps/rhoconfig.txt +19 -0
  82. data/rhoconnect-client/Java/Android/test/assets/apps/rhoconfig.txt.timestamp +1 -0
  83. data/rhoconnect-client/Java/Android/test/assets/db/syncdb.schema +44 -0
  84. data/rhoconnect-client/Java/Android/test/assets/db/syncdb.triggers +10 -0
  85. data/rhoconnect-client/Java/Android/test/assets/db/syncdb_java.triggers +21 -0
  86. data/rhoconnect-client/Java/Android/test/assets/rho.dat +9 -0
  87. data/rhoconnect-client/Java/Android/test/proguard.cfg +36 -0
  88. data/rhoconnect-client/Java/Android/test/project.properties +11 -0
  89. data/rhoconnect-client/Java/Android/test/res/drawable-hdpi/icon.png +0 -0
  90. data/rhoconnect-client/Java/Android/test/res/drawable-ldpi/icon.png +0 -0
  91. data/rhoconnect-client/Java/Android/test/res/drawable-mdpi/icon.png +0 -0
  92. data/rhoconnect-client/Java/Android/test/res/layout/main.xml +12 -0
  93. data/rhoconnect-client/Java/Android/test/res/values/strings.xml +5 -0
  94. data/rhoconnect-client/Java/Android/test/rhoimpl.jar +0 -0
  95. data/rhoconnect-client/Java/Android/test/src/com/rhomobile/rhoconnect_client_test/TestRhoConnectClient.java +343 -0
  96. data/rhoconnect-client/Java/Android/test/src/com/rhomobile/rhoconnect_client_test/TestRhoConnectClientBlobs.java +219 -0
  97. data/rhoconnect-client/Java/RhoConnect/.classpath +6 -0
  98. data/rhoconnect-client/Java/RhoConnect/.project +93 -0
  99. data/rhoconnect-client/Java/RhoConnect/assets/apps/rhoconfig.txt +19 -0
  100. data/rhoconnect-client/Java/RhoConnect/assets/apps/rhoconfig.txt.timestamp +1 -0
  101. data/rhoconnect-client/Java/RhoConnect/assets/db/syncdb.schema +44 -0
  102. data/rhoconnect-client/Java/RhoConnect/assets/db/syncdb.triggers +10 -0
  103. data/rhoconnect-client/Java/RhoConnect/assets/db/syncdb_java.triggers +21 -0
  104. data/rhoconnect-client/Java/RhoConnect/assets/rho.dat +8 -0
  105. data/rhoconnect-client/Java/RhoConnect/jni/include/RhoConnectJniNotify.h +61 -0
  106. data/rhoconnect-client/Java/RhoConnect/jni/include/com_rhomobile_rhoconnect_RhoConnectClient.h +181 -0
  107. data/rhoconnect-client/Java/RhoConnect/jni/include/com_rhomobile_rhoconnect_RhoConnectNotify.h +13 -0
  108. data/rhoconnect-client/Java/RhoConnect/jni/include/com_rhomobile_rhoconnect_RhoConnectNotify_IDelegate.h +13 -0
  109. data/rhoconnect-client/Java/RhoConnect/jni/include/com_rhomobile_rhoconnect_RhoConnectObjectNotify.h +13 -0
  110. data/rhoconnect-client/Java/RhoConnect/jni/include/com_rhomobile_rhoconnect_RhoConnectObjectNotify_IDelegate.h +13 -0
  111. data/rhoconnect-client/Java/RhoConnect/jni/include/com_rhomobile_rhoconnect_RhomModel.h +103 -0
  112. data/rhoconnect-client/Java/RhoConnect/jni/include/rhojava.inc +76 -0
  113. data/rhoconnect-client/Java/RhoConnect/jni/src/RhoConnectJniClient.cpp +401 -0
  114. data/rhoconnect-client/Java/RhoConnect/jni/src/RhoConnectJniModel.cpp +332 -0
  115. data/rhoconnect-client/Java/RhoConnect/jni/src/RhoConnectJniNotify.cpp +223 -0
  116. data/rhoconnect-client/Java/RhoConnect/jni/src/RhoConnectUtil.cpp +82 -0
  117. data/rhoconnect-client/Java/RhoConnect/jni/src/RhodesApp.cpp +114 -0
  118. data/rhoconnect-client/Java/RhoConnect/src/com/rhomobile/rhoconnect/RhoConnectClient.java +108 -0
  119. data/rhoconnect-client/Java/RhoConnect/src/com/rhomobile/rhoconnect/RhoConnectNotify.java +78 -0
  120. data/rhoconnect-client/Java/RhoConnect/src/com/rhomobile/rhoconnect/RhoConnectObjectNotify.java +71 -0
  121. data/rhoconnect-client/Java/RhoConnect/src/com/rhomobile/rhoconnect/RhomModel.java +195 -0
  122. data/rhoconnect-client/JavaScript/.classpath +10 -0
  123. data/rhoconnect-client/JavaScript/.gitignore +4 -0
  124. data/rhoconnect-client/JavaScript/.project +17 -0
  125. data/rhoconnect-client/JavaScript/README.textile +1 -0
  126. data/rhoconnect-client/JavaScript/build.xml +185 -0
  127. data/rhoconnect-client/JavaScript/doc/fsm-sample.js +44 -0
  128. data/rhoconnect-client/JavaScript/doc/fsm-sample.png +0 -0
  129. data/rhoconnect-client/JavaScript/src/RhoSyncJS.gwt.xml +21 -0
  130. data/rhoconnect-client/JavaScript/stubs/RhoSyncStubsJS.gwt.xml +21 -0
  131. data/rhoconnect-client/JavaScript/stubs/com/rho/Capabilities.java +7 -0
  132. data/rhoconnect-client/JavaScript/stubs/com/rho/IRhoRubyHelper.java +7 -0
  133. data/rhoconnect-client/JavaScript/stubs/com/rho/Mutex.java +5 -0
  134. data/rhoconnect-client/JavaScript/stubs/com/rho/RhoAppAdapter.java +39 -0
  135. data/rhoconnect-client/JavaScript/stubs/com/rho/RhoClassFactory.java +29 -0
  136. data/rhoconnect-client/JavaScript/stubs/com/rho/RhoConf.java +100 -0
  137. data/rhoconnect-client/JavaScript/stubs/com/rho/RhoEmptyLogger.java +7 -0
  138. data/rhoconnect-client/JavaScript/stubs/com/rho/RhoEmptyProfiler.java +5 -0
  139. data/rhoconnect-client/JavaScript/stubs/com/rho/RhoLogger.java +32 -0
  140. data/rhoconnect-client/JavaScript/stubs/com/rho/RhoProfiler.java +27 -0
  141. data/rhoconnect-client/JavaScript/stubs/com/rho/RhodesApp.java +25 -0
  142. data/rhoconnect-client/JavaScript/stubs/com/rho/TimeInterval.java +22 -0
  143. data/rhoconnect-client/JavaScript/stubs/com/rho/Tokenizer.java +23 -0
  144. data/rhoconnect-client/JavaScript/stubs/com/rho/db/DBAdapter.java +174 -0
  145. data/rhoconnect-client/JavaScript/stubs/com/rho/db/DBAttrManager.java +15 -0
  146. data/rhoconnect-client/JavaScript/stubs/com/rho/db/DBException.java +5 -0
  147. data/rhoconnect-client/JavaScript/stubs/com/rho/db/IDBResult.java +27 -0
  148. data/rhoconnect-client/JavaScript/stubs/com/rho/file/IFileAccess.java +7 -0
  149. data/rhoconnect-client/JavaScript/stubs/com/rho/file/SimpleFile.java +15 -0
  150. data/rhoconnect-client/JavaScript/stubs/com/rho/net/IHttpConnection.java +22 -0
  151. data/rhoconnect-client/JavaScript/stubs/com/rho/net/NetRequest.java +324 -0
  152. data/rhoconnect-client/JavaScript/stubs/com/rho/net/NetResponse.java +51 -0
  153. data/rhoconnect-client/JavaScript/stubs/com/rho/net/URI.java +64 -0
  154. data/rhoconnect-client/JavaScript/stubs/com/rho/sync/ClientRegister.java +15 -0
  155. data/rhoconnect-client/JavaScript/stubs/com/rho/sync/JSONArrayIterator.java +37 -0
  156. data/rhoconnect-client/JavaScript/stubs/com/rho/sync/JSONEntry.java +48 -0
  157. data/rhoconnect-client/JavaScript/stubs/com/rho/sync/JSONStructIterator.java +41 -0
  158. data/rhoconnect-client/JavaScript/stubs/com/rho/sync/SyncNotify.java +98 -0
  159. data/rhoconnect-client/JavaScript/stubs/com/rho/sync/SyncThread.java +92 -0
  160. data/rhoconnect-client/JavaScript/war/WEB-INF/lib/gwt-servlet-deps.jar +0 -0
  161. data/rhoconnect-client/JavaScript/war/WEB-INF/lib/gwt-servlet.jar +0 -0
  162. data/rhoconnect-client/JavaScript/war/js/fsm-sample.js +54 -0
  163. data/rhoconnect-client/JavaScript/war/js/rhosync-api.js +237 -0
  164. data/rhoconnect-client/JavaScript/war/js/rhosync-fsm.js +307 -0
  165. data/rhoconnect-client/JavaScript/war/rhosyncjs/4C71D69C9BBC9E6F05C6BA49B01BCBC1.cache.html +3122 -0
  166. data/rhoconnect-client/JavaScript/war/rhosyncjs/5146F4FFF34511C8BB2661E920B49E3A.cache.html +3254 -0
  167. data/rhoconnect-client/JavaScript/war/rhosyncjs/5248C67481D9D27AD0703D15CDBD2A1C.cache.html +3147 -0
  168. data/rhoconnect-client/JavaScript/war/rhosyncjs/EE1DC2692C9C32367B53A39E2358AF23.cache.html +3195 -0
  169. data/rhoconnect-client/JavaScript/war/rhosyncjs/clear.cache.gif +0 -0
  170. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/corner.png +0 -0
  171. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/corner_ie6.png +0 -0
  172. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/hborder.png +0 -0
  173. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/hborder_ie6.png +0 -0
  174. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/ie6/corner_dialog_topleft.png +0 -0
  175. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/ie6/corner_dialog_topright.png +0 -0
  176. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/ie6/hborder_blue_shadow.png +0 -0
  177. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/ie6/hborder_gray_shadow.png +0 -0
  178. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/ie6/vborder_blue_shadow.png +0 -0
  179. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/ie6/vborder_gray_shadow.png +0 -0
  180. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/splitPanelThumb.png +0 -0
  181. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/vborder.png +0 -0
  182. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/vborder_ie6.png +0 -0
  183. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/standard.css +1144 -0
  184. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/standard_rtl.css +1145 -0
  185. data/rhoconnect-client/JavaScript/war/rhosyncjs/hosted.html +350 -0
  186. data/rhoconnect-client/JavaScript/war/rhosyncjs/rhosyncjs.nocache.js +314 -0
  187. data/rhoconnect-client/JavaScript/war/test/SpecRunner.html +35 -0
  188. data/rhoconnect-client/JavaScript/war/test/dbtest.html +38 -0
  189. data/rhoconnect-client/JavaScript/war/test/lib/jasmine-1.0.1/MIT.LICENSE +20 -0
  190. data/rhoconnect-client/JavaScript/war/test/lib/jasmine-1.0.1/jasmine-html.js +188 -0
  191. data/rhoconnect-client/JavaScript/war/test/lib/jasmine-1.0.1/jasmine.css +166 -0
  192. data/rhoconnect-client/JavaScript/war/test/lib/jasmine-1.0.1/jasmine.js +2421 -0
  193. data/rhoconnect-client/JavaScript/war/test/spec/SpecHelper.js +7 -0
  194. data/rhoconnect-client/JavaScript/war/test/spec/SyncApiSpec.js +573 -0
  195. data/rhoconnect-client/JavaScript/war/test/spec/samples/PlayerSpec.js +58 -0
  196. data/rhoconnect-client/JavaScript/war/test/worker-test.js +17 -0
  197. data/rhoconnect-client/LICENSE +41 -0
  198. data/rhoconnect-client/ObjectiveC/RhoConnectClient.h +118 -0
  199. data/rhoconnect-client/ObjectiveC/RhoConnectClient.m +641 -0
  200. data/rhoconnect-client/ObjectiveC/RhoConnectClient.xcodeproj/project.pbxproj +1434 -0
  201. data/rhoconnect-client/ObjectiveC/RhoConnectNotify.h +83 -0
  202. data/rhoconnect-client/ObjectiveC/RhoConnectNotify.m +181 -0
  203. data/rhoconnect-client/ObjectiveC/RhoConnectObjectNotify.h +65 -0
  204. data/rhoconnect-client/ObjectiveC/RhoConnectObjectNotify.m +73 -0
  205. data/rhoconnect-client/ObjectiveC/RhomModel.h +101 -0
  206. data/rhoconnect-client/ObjectiveC/RhomModel.m +320 -0
  207. data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/MainWindow.xib +198 -0
  208. data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/RhoConnectClientTest-Info.plist +30 -0
  209. data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/RhoConnectClientTest.xcodeproj/project.pbxproj +373 -0
  210. data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/RhoConnectClientTestAppDelegate.h +58 -0
  211. data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/RhoConnectClientTestAppDelegate.m +84 -0
  212. data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/RhoConnectClientTest_Prefix.pch +8 -0
  213. data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/invalid_import_db.zip +0 -0
  214. data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/main.m +1096 -0
  215. data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/test.png +0 -0
  216. data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/test2.png +0 -0
  217. data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/valid_import_db.zip +0 -0
  218. data/rhoconnect-client/ObjectiveC/Tests/ptests/Classes/ptestsAppDelegate.h +62 -0
  219. data/rhoconnect-client/ObjectiveC/Tests/ptests/Classes/ptestsAppDelegate.m +35 -0
  220. data/rhoconnect-client/ObjectiveC/Tests/ptests/Classes/ptestsViewController.h +78 -0
  221. data/rhoconnect-client/ObjectiveC/Tests/ptests/Classes/ptestsViewController.m +549 -0
  222. data/rhoconnect-client/ObjectiveC/Tests/ptests/MainWindow.xib +227 -0
  223. data/rhoconnect-client/ObjectiveC/Tests/ptests/main.m +17 -0
  224. data/rhoconnect-client/ObjectiveC/Tests/ptests/ptests-Info.plist +30 -0
  225. data/rhoconnect-client/ObjectiveC/Tests/ptests/ptests.xcodeproj/project.pbxproj +363 -0
  226. data/rhoconnect-client/ObjectiveC/Tests/ptests/ptestsViewController.xib +641 -0
  227. data/rhoconnect-client/ObjectiveC/Tests/ptests/ptests_Prefix.pch +8 -0
  228. data/rhoconnect-client/README.textile +23 -0
  229. data/rhoconnect-client/Rakefile +20 -0
  230. data/rhoconnect-client/Samples/Java/android_store/.classpath +8 -0
  231. data/rhoconnect-client/Samples/Java/android_store/.project +33 -0
  232. data/rhoconnect-client/Samples/Java/android_store/AndroidManifest.xml +24 -0
  233. data/rhoconnect-client/Samples/Java/android_store/assets/apps/rhoconfig.txt +19 -0
  234. data/rhoconnect-client/Samples/Java/android_store/assets/apps/rhoconfig.txt.timestamp +1 -0
  235. data/rhoconnect-client/Samples/Java/android_store/assets/db/syncdb.schema +44 -0
  236. data/rhoconnect-client/Samples/Java/android_store/assets/db/syncdb.triggers +10 -0
  237. data/rhoconnect-client/Samples/Java/android_store/assets/db/syncdb_java.triggers +21 -0
  238. data/rhoconnect-client/Samples/Java/android_store/assets/rho.dat +8 -0
  239. data/rhoconnect-client/Samples/Java/android_store/default.properties +11 -0
  240. data/rhoconnect-client/Samples/Java/android_store/project.properties +14 -0
  241. data/rhoconnect-client/Samples/Java/android_store/res/drawable-hdpi/icon.png +0 -0
  242. data/rhoconnect-client/Samples/Java/android_store/res/drawable-ldpi/icon.png +0 -0
  243. data/rhoconnect-client/Samples/Java/android_store/res/drawable-mdpi/icon.png +0 -0
  244. data/rhoconnect-client/Samples/Java/android_store/res/layout/main.xml +12 -0
  245. data/rhoconnect-client/Samples/Java/android_store/res/values/strings.xml +5 -0
  246. data/rhoconnect-client/Samples/Java/android_store/rhoimpl.jar +0 -0
  247. data/rhoconnect-client/Samples/Java/android_store/src/com/rhomobile/android_store/StoreActivity.java +68 -0
  248. data/rhoconnect-client/Samples/Java/android_store/src/com/rhomobile/android_store/StoreApplication.java +15 -0
  249. data/rhoconnect-client/Samples/ObjectiveC/store/Classes/LoginViewController.h +70 -0
  250. data/rhoconnect-client/Samples/ObjectiveC/store/Classes/LoginViewController.m +94 -0
  251. data/rhoconnect-client/Samples/ObjectiveC/store/Classes/RhoConnectEngine.h +82 -0
  252. data/rhoconnect-client/Samples/ObjectiveC/store/Classes/RhoConnectEngine.m +119 -0
  253. data/rhoconnect-client/Samples/ObjectiveC/store/Classes/RootViewController.h +63 -0
  254. data/rhoconnect-client/Samples/ObjectiveC/store/Classes/RootViewController.m +314 -0
  255. data/rhoconnect-client/Samples/ObjectiveC/store/Classes/WaitLoginController.h +65 -0
  256. data/rhoconnect-client/Samples/ObjectiveC/store/Classes/WaitLoginController.m +110 -0
  257. data/rhoconnect-client/Samples/ObjectiveC/store/Classes/storeAppDelegate.h +61 -0
  258. data/rhoconnect-client/Samples/ObjectiveC/store/Classes/storeAppDelegate.m +171 -0
  259. data/rhoconnect-client/Samples/ObjectiveC/store/LoginViewController.xib +779 -0
  260. data/rhoconnect-client/Samples/ObjectiveC/store/MainWindow.xib +580 -0
  261. data/rhoconnect-client/Samples/ObjectiveC/store/RootViewController.xib +384 -0
  262. data/rhoconnect-client/Samples/ObjectiveC/store/WaitLoginController.xib +557 -0
  263. data/rhoconnect-client/Samples/ObjectiveC/store/icon.png +0 -0
  264. data/rhoconnect-client/Samples/ObjectiveC/store/main.m +22 -0
  265. data/rhoconnect-client/Samples/ObjectiveC/store/store-Info.plist +30 -0
  266. data/rhoconnect-client/Samples/ObjectiveC/store/store.xcodeproj/project.pbxproj +367 -0
  267. data/rhoconnect-client/Samples/ObjectiveC/store/store_Prefix.pch +14 -0
  268. data/rhoconnect-client/build.yml +3 -0
  269. data/rhoconnect-client/version +1 -0
  270. metadata +314 -0
@@ -0,0 +1,19 @@
1
+ # Rhodes runtime properties
2
+ #MinSeverity = 0
3
+ #LogToOutput = 1
4
+ #LogCategories = *
5
+ #ExcludeLogCategories =
6
+
7
+ # Sync server url. Typically this will look like 'http://<hostname>:<port>/application'
8
+ # For example: 'http://localhost:9292/application'
9
+ #syncserver = 'http://localhost:9292/application'
10
+ #syncserver = 'http://rhodes-store-server.herokuapp.com/application'
11
+ #sync_poll_interval=0
12
+
13
+ #syncserver = 'http://store-bulk.rhohub.com/application'
14
+ #bulksync_state=0
15
+
16
+ #logserver = 'http://rhologs.heroku.com?id=1234'
17
+ #logname='store'
18
+
19
+ #net_trace=1
@@ -0,0 +1,44 @@
1
+ CREATE TABLE client_info (
2
+ "client_id" VARCHAR(255) default NULL,
3
+ "session" VARCHAR(255) default NULL,
4
+ "token" VARCHAR(255) default NULL,
5
+ "token_sent" BIGINT default 0,
6
+ "reset" BIGINT default 0,
7
+ "port" VARCHAR(10) default NULL,
8
+ "last_sync_success" VARCHAR(100) default NULL);
9
+ CREATE TABLE object_values (
10
+ "source_id" BIGINT default NULL,
11
+ "attrib" varchar(255) default NULL,
12
+ "object" varchar(255) default NULL,
13
+ "value" varchar default NULL);
14
+ CREATE TABLE changed_values (
15
+ "source_id" BIGINT default NULL,
16
+ "attrib" varchar(255) default NULL,
17
+ "object" varchar(255) default NULL,
18
+ "value" varchar default NULL,
19
+ "attrib_type" varchar(255) default NULL,
20
+ "update_type" varchar(255) default NULL,
21
+ "sent" BIGINT default 0);
22
+ CREATE TABLE sources (
23
+ "source_id" BIGINT PRIMARY KEY,
24
+ "name" VARCHAR(255) default NULL,
25
+ "token" BIGINT default NULL,
26
+ "sync_priority" BIGINT,
27
+ "partition" VARCHAR(255),
28
+ "sync_type" VARCHAR(255),
29
+ "metadata" varchar default NULL,
30
+ "last_updated" BIGINT default 0,
31
+ "last_inserted_size" BIGINT default 0,
32
+ "last_deleted_size" BIGINT default 0,
33
+ "last_sync_duration" BIGINT default 0,
34
+ "last_sync_success" BIGINT default 0,
35
+ "backend_refresh_time" BIGINT default 0,
36
+ "source_attribs" varchar default NULL,
37
+ "schema" varchar default NULL,
38
+ "schema_version" varchar default NULL,
39
+ "associations" varchar default NULL,
40
+ "blob_attribs" varchar default NULL);
41
+ CREATE INDEX by_src_id on object_values ("source_id");
42
+ CREATE UNIQUE INDEX by_src_object ON object_values ("object", "attrib", "source_id");
43
+ CREATE INDEX by_src_value ON object_values ("attrib", "source_id", "value");
44
+
@@ -0,0 +1,10 @@
1
+ CREATE TRIGGER rhodeleteTrigger BEFORE DELETE ON object_values FOR EACH ROW
2
+ BEGIN
3
+ SELECT rhoOnDeleteObjectRecord(OLD.value, OLD.source_id, OLD.attrib );
4
+ END;
5
+ ;
6
+ CREATE TRIGGER rhoupdateTrigger BEFORE UPDATE ON object_values FOR EACH ROW WHEN NEW.value != OLD.value
7
+ BEGIN
8
+ SELECT rhoOnUpdateObjectRecord(OLD.value, OLD.source_id, OLD.attrib );
9
+ END;
10
+ ;
@@ -0,0 +1,21 @@
1
+ CREATE TABLE object_attribs_to_delete(
2
+ "source_id" BIGINT default NULL,
3
+ "attrib" varchar(255) default NULL,
4
+ "object" varchar(255) default NULL,
5
+ "value" varchar default NULL);
6
+ CREATE TABLE object_attribs_to_update(
7
+ "source_id" BIGINT default NULL,
8
+ "attrib" varchar(255) default NULL,
9
+ "object" varchar(255) default NULL,
10
+ "value" varchar default NULL);
11
+
12
+ CREATE TRIGGER rhodeleteTrigger BEFORE DELETE ON object_values FOR EACH ROW
13
+ BEGIN
14
+ INSERT INTO object_attribs_to_delete(source_id, attrib, value) VALUES (OLD.source_id, OLD.attrib, OLD.value);
15
+ END;
16
+ ;
17
+ CREATE TRIGGER rhoupdateTrigger BEFORE UPDATE ON object_values FOR EACH ROW WHEN NEW.value != OLD.value
18
+ BEGIN
19
+ INSERT INTO object_attribs_to_update(source_id, attrib, value) VALUES (OLD.source_id, OLD.attrib, OLD.value);
20
+ END;
21
+ ;
@@ -0,0 +1,9 @@
1
+ apps dir 4096 1309959201
2
+ apps/rhoconfig.txt file 1091 1309958873
3
+ apps/rhoconfig.txt.timestamp file 16 1309958873
4
+ apps/androidtest.png file 338349 1318264089
5
+ db dir 4096 1309959201
6
+ db/syncdb.schema file 1609 1309958874
7
+ db/syncdb.triggers file 380 1309958874
8
+ db/syncdb_java.triggers file 821 1309958874
9
+ rho.dat file 20480 1309959201
@@ -0,0 +1,36 @@
1
+ -optimizationpasses 5
2
+ -dontusemixedcaseclassnames
3
+ -dontskipnonpubliclibraryclasses
4
+ -dontpreverify
5
+ -verbose
6
+ -optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
7
+
8
+ -keep public class * extends android.app.Activity
9
+ -keep public class * extends android.app.Application
10
+ -keep public class * extends android.app.Service
11
+ -keep public class * extends android.content.BroadcastReceiver
12
+ -keep public class * extends android.content.ContentProvider
13
+ -keep public class * extends android.app.backup.BackupAgentHelper
14
+ -keep public class * extends android.preference.Preference
15
+ -keep public class com.android.vending.licensing.ILicensingService
16
+
17
+ -keepclasseswithmembernames class * {
18
+ native <methods>;
19
+ }
20
+
21
+ -keepclasseswithmembernames class * {
22
+ public <init>(android.content.Context, android.util.AttributeSet);
23
+ }
24
+
25
+ -keepclasseswithmembernames class * {
26
+ public <init>(android.content.Context, android.util.AttributeSet, int);
27
+ }
28
+
29
+ -keepclassmembers enum * {
30
+ public static **[] values();
31
+ public static ** valueOf(java.lang.String);
32
+ }
33
+
34
+ -keep class * implements android.os.Parcelable {
35
+ public static final android.os.Parcelable$Creator *;
36
+ }
@@ -0,0 +1,11 @@
1
+ # This file is automatically generated by Android Tools.
2
+ # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3
+ #
4
+ # This file must be checked in Version Control Systems.
5
+ #
6
+ # To customize properties used by the Ant build system use,
7
+ # "ant.properties", and override values to adapt the script to your
8
+ # project structure.
9
+
10
+ # Project target.
11
+ target=android-17
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:orientation="vertical"
4
+ android:layout_width="fill_parent"
5
+ android:layout_height="fill_parent"
6
+ >
7
+ <TextView
8
+ android:layout_width="fill_parent"
9
+ android:layout_height="wrap_content"
10
+ android:text="@string/hello"
11
+ />
12
+ </LinearLayout>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <resources>
3
+ <string name="hello">Hello World!</string>
4
+ <string name="app_name"></string>
5
+ </resources>
@@ -0,0 +1,343 @@
1
+ /*------------------------------------------------------------------------
2
+ * (The MIT License)
3
+ *
4
+ * Copyright (c) 2008-2011 Rhomobile, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in
14
+ * all copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ * THE SOFTWARE.
23
+ *
24
+ * http://rhomobile.com
25
+
26
+ * Copyright (c) 2011-2016 Symbol Technologies, Inc.
27
+ *
28
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
29
+ * of this software and associated documentation files (the "Software"), to deal
30
+ * in the Software without restriction, including without limitation the rights
31
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
32
+ * copies of the Software, and to permit persons to whom the Software is
33
+ * furnished to do so, subject to the following conditions:
34
+ *
35
+ * The above copyright notice and this permission notice shall be included in
36
+ * all copies or substantial portions of the Software.
37
+ *
38
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
39
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
40
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
41
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
42
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
43
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
44
+ * THE SOFTWARE.
45
+ *
46
+ * http://symbol.com
47
+ *------------------------------------------------------------------------*/
48
+
49
+ package com.rhomobile.rhoconnect_client_test;
50
+
51
+ import java.text.SimpleDateFormat;
52
+ import java.util.Collection;
53
+ import java.util.Date;
54
+ import java.util.HashMap;
55
+ import java.util.LinkedList;
56
+ import java.util.List;
57
+ import java.util.Map;
58
+ import java.util.Set;
59
+
60
+ import android.content.pm.ApplicationInfo;
61
+ import android.test.AndroidTestCase;
62
+
63
+ import com.rhomobile.rhodes.Logger;
64
+ import com.rhomobile.rhodes.RhoLogConf;
65
+ import com.rhomobile.rhodes.file.RhoFileApi;
66
+ import com.rhomobile.rhoconnect.RhoConnectClient;
67
+ import com.rhomobile.rhoconnect.RhoConnectObjectNotify;
68
+ import com.rhomobile.rhoconnect.RhomModel;
69
+ import com.rhomobile.rhoconnect.RhoConnectNotify;
70
+
71
+ public class TestRhoConnectClient extends AndroidTestCase {
72
+ private static final String TAG = TestRhoConnectClient.class.getSimpleName();
73
+
74
+ private final String SYNC_URL = "http://rhodes-store-server.herokuapp.com/application";
75
+
76
+ class ObjectNotifyDelegate implements RhoConnectObjectNotify.IDelegate
77
+ {
78
+ RhoConnectObjectNotify mNotify;
79
+ @Override
80
+ public void call(RhoConnectObjectNotify notify) {
81
+ mNotify = notify;
82
+ }
83
+ }
84
+
85
+ RhoConnectClient mClient;
86
+ RhomModel mModels[];
87
+ RhomModel mProduct;
88
+ RhomModel mCustomer;
89
+
90
+ @Override
91
+ protected void setUp()
92
+ {
93
+ System.loadLibrary("rhoconnectclient");
94
+
95
+ ApplicationInfo appInfo = this.getContext().getApplicationInfo();
96
+ try {
97
+ RhoFileApi.initRootPath(appInfo.dataDir, appInfo.sourceDir, null);
98
+ RhoFileApi.init(this.getContext());
99
+ RhoFileApi.setFsModeTransparrent(true);
100
+
101
+ RhoLogConf.setMinSeverity(0);
102
+ RhoLogConf.setEnabledCategories("*");
103
+
104
+ RhoConnectClient.nativeInit();
105
+ } catch (Exception e) {
106
+ fail(e.getMessage());
107
+ }
108
+
109
+ mClient = new RhoConnectClient();
110
+
111
+ mModels = new RhomModel[]{
112
+ new RhomModel("Perftest", RhomModel.SYNC_TYPE_NONE),
113
+ new RhomModel("Customer", RhomModel.SYNC_TYPE_INCREMENTAL),
114
+ new RhomModel("Product", RhomModel.SYNC_TYPE_INCREMENTAL)
115
+ };
116
+ mCustomer = mModels[1];
117
+ mProduct = mModels[2];
118
+
119
+ mProduct.getAssociations().put("quantity", "Customer");
120
+ mProduct.getAssociations().put("sku", "Customer");
121
+
122
+ mClient.initialize(mModels);
123
+ mClient.setThreadedMode(false);
124
+ mClient.setPollInterval(0);
125
+ mClient.setSyncServer(SYNC_URL);
126
+ mClient.setBulkSyncState(1);
127
+ }
128
+
129
+ @Override
130
+ protected void tearDown()
131
+ {
132
+ mClient.databaseFullResetAndLogout();
133
+ mClient.close();
134
+ }
135
+
136
+ public void test1InitiallyLoggedOut()
137
+ {
138
+ mClient.databaseFullResetAndLogout();
139
+ assertFalse(mClient.isLoggedIn());
140
+ }
141
+ public void test2Login()
142
+ {
143
+ RhoConnectNotify notify = mClient.loginWithUserSync("test", "");
144
+ assertEquals(notify.getErrorCode(), 0);
145
+ assertTrue(mClient.isLoggedIn());
146
+ }
147
+ public void test3SyncProductByName()
148
+ {
149
+ RhoConnectNotify notify = mClient.loginWithUserSync("test", "");
150
+ assertEquals(notify.getErrorCode(), 0);
151
+ assertTrue(mClient.isLoggedIn());
152
+
153
+ notify = mCustomer.sync();
154
+ assertEquals(0, notify.getErrorCode());
155
+ }
156
+
157
+ public void test4SyncAll()
158
+ {
159
+ RhoConnectNotify notify = mClient.loginWithUserSync("test", "");
160
+ assertEquals(notify.getErrorCode(), 0);
161
+ assertTrue(mClient.isLoggedIn());
162
+
163
+ notify = mClient.syncAll();
164
+ assertEquals(notify.getErrorCode(), 0);
165
+ }
166
+
167
+ public void test5CreateNewProduct()
168
+ {
169
+ Map<String, String> item = new HashMap<String, String>();
170
+ item.put("name", "AndroidTest");
171
+
172
+ mProduct.create(item);
173
+
174
+ assertTrue(item.containsKey("object"));
175
+ assertTrue(item.containsKey("source_id"));
176
+
177
+ Map<String, String> item2 = mProduct.find(item.get("object"));
178
+ assertTrue(item2 != null);
179
+ assertEquals(item.get("name"), item2.get("name"));
180
+
181
+ mProduct.sync();
182
+
183
+ Map<String, String> cond = new HashMap<String, String>();
184
+ cond.put("name", "AndroidTest");
185
+ Map<String, String> item3 = mProduct.findFirst(cond);
186
+ assertNotNull(item3);
187
+ assertFalse(item3.isEmpty());
188
+ assertEquals(item.get("name"), item3.get("name"));
189
+ }
190
+
191
+ public void test6CreateNewProductWithCustomer()
192
+ {
193
+ RhoConnectNotify notify = mClient.loginWithUserSync("test", "");
194
+ assertEquals(notify.getErrorCode(), 0);
195
+ assertTrue(mClient.isLoggedIn());
196
+
197
+ Map<String, String> cust1 = new HashMap<String, String>();
198
+ cust1.put("first", "CustTest1");
199
+ mCustomer.create(cust1);
200
+
201
+ Map<String, String> cust2 = new HashMap<String, String>();
202
+ cust2.put("first", "CustTest2");
203
+ mCustomer.create(cust2);
204
+
205
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
206
+ String prodName = dateFormat.format(new Date());
207
+
208
+ Map<String, String> item = new HashMap<String, String>();
209
+ item.put("name", prodName);
210
+ item.put("quantity", cust1.get("object"));
211
+ item.put("sku", cust2.get("object"));
212
+ mProduct.create(item);
213
+
214
+ notify = mClient.syncAll();
215
+ assertEquals(notify.getErrorMessage(), 0, notify.getErrorCode());
216
+
217
+ Map<String, String> prodCondition = new HashMap<String, String>();
218
+ prodCondition.put("name", prodName);
219
+
220
+ Map<String, String> prod = mProduct.findFirst(prodCondition);
221
+
222
+ assertFalse(prod.isEmpty());
223
+ assertFalse(item.get("object").equals(prod.get("object")));
224
+ assertFalse(prod.get("quantity").equals(cust1.get("object")));
225
+ assertFalse(prod.get("sku").equals(cust2.get("object")));
226
+
227
+ Map<String, String> cust11 = mCustomer.find(prod.get("quantity"));
228
+ assertFalse(cust11.isEmpty());
229
+ assertEquals(cust11.get("first"), cust1.get("first"));
230
+
231
+ Map<String, String> cust22 = mCustomer.find(prod.get("sku"));
232
+ assertFalse(cust22.isEmpty());
233
+ assertEquals(cust22.get("first"), cust2.get("first"));
234
+
235
+ }
236
+
237
+ public void test7CreateObjectNotify()
238
+ {
239
+ RhoConnectNotify notify = mClient.loginWithUserSync("test", "");
240
+ assertEquals(notify.getErrorCode(), 0);
241
+ assertTrue(mClient.isLoggedIn());
242
+
243
+ Map<String, String> item = new HashMap<String, String>();
244
+ item.put("name", "AndroidTest2");
245
+
246
+ mProduct.create(item);
247
+
248
+ assertTrue(item.containsKey("object"));
249
+ assertTrue(item.containsKey("source_id"));
250
+
251
+ Map<String, String> item2 = mProduct.find(item.get("object"));
252
+ assertNotNull(item2);
253
+ assertEquals(item.get("name"), item2.get("name"));
254
+
255
+ ObjectNotifyDelegate objectCallback = new ObjectNotifyDelegate();
256
+ mClient.setObjectNotification(objectCallback);
257
+ mClient.addObjectNotify(Integer.parseInt(item.get("source_id")), item.get("object"));
258
+
259
+ notify = mProduct.sync();
260
+ assertEquals(notify.getErrorMessage(), 0, notify.getErrorCode());
261
+
262
+ assertNotNull(objectCallback.mNotify);
263
+
264
+ String[] createdObjects = objectCallback.mNotify.getCreatedObjects();
265
+ assertNotNull(createdObjects);
266
+
267
+ int[] createdSourceIds = objectCallback.mNotify.getCreatedSourceIds();
268
+ assertNotNull(createdSourceIds);
269
+
270
+ assertEquals(createdObjects[0], item.get("object"));
271
+ }
272
+
273
+ public void test8ModifyProduct()
274
+ {
275
+ RhoConnectNotify notify = mClient.loginWithUserSync("test", "");
276
+ assertEquals(notify.getErrorCode(), 0);
277
+ assertTrue(mClient.isLoggedIn());
278
+
279
+ notify = mProduct.sync();
280
+ assertEquals(notify.getErrorMessage(), notify.getErrorCode(), 0);
281
+
282
+ Map<String, String> cond = new HashMap<String, String>();
283
+ cond.put("name", "AndroidTest");
284
+
285
+ Map<String,String> item = mProduct.findFirst(cond);
286
+
287
+ if(item == null || item.isEmpty()) {
288
+ test5CreateNewProduct();
289
+ item = mProduct.findFirst(cond);
290
+ }
291
+
292
+ assertNotNull(item);
293
+ assertTrue(item.size() > 0);
294
+
295
+ String object = item.get("object");
296
+
297
+ item.put("sku", item.get("sku") + "_TEST");
298
+ mProduct.save(item);
299
+
300
+ notify = mProduct.sync();
301
+ assertEquals(notify.getErrorMessage(), 0, notify.getErrorCode());
302
+
303
+ Map<String,String> foundItem = mProduct.find(object);
304
+
305
+ assertNotNull(foundItem);
306
+ assertFalse(foundItem.isEmpty());
307
+
308
+ assertEquals(item.get("sku"), foundItem.get("sku"));
309
+ }
310
+
311
+ public void test9FindBySql()
312
+ {
313
+ Collection<Map<String, String> > items = mProduct.findBySql(
314
+ "SELECT * FROM sources", null);
315
+
316
+ assertNotNull(items);
317
+
318
+ for(Map<String, String> item: items) {
319
+ Logger.T(TAG, "Next source:");
320
+ Set<String> keys = item.keySet();
321
+ for(String key: keys) {
322
+ if(key.equals("name"))
323
+ Logger.T(TAG, key + " => " + item.get(key));
324
+ }
325
+ }
326
+
327
+ assertEquals(4, items.size());
328
+
329
+ List<String> params = new LinkedList<String>();
330
+ params.add(mProduct.getName());
331
+
332
+ Collection<Map<String, String> > items2 = mProduct.findBySql(
333
+ "SELECT * FROM sources WHERE name=?", params);
334
+
335
+ assertNotNull(items2);
336
+ assertEquals(1, items2.size());
337
+ }
338
+ }
339
+
340
+
341
+
342
+
343
+