rhodes 2.2.6 → 2.3.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +20 -0
- data/README.md +46 -0
- data/Rakefile +85 -80
- data/bin/rhodes +2 -2
- data/bin/rhogen +1 -1
- data/doc/application.txt +277 -0
- data/doc/bb-css.txt +209 -0
- data/doc/build.txt +785 -0
- data/doc/configuration.txt +236 -0
- data/doc/connect-to-web-services.txt +282 -0
- data/doc/contributing.txt +64 -0
- data/doc/css-framework.txt +144 -0
- data/doc/device-caps.txt +1152 -0
- data/doc/extensions.txt +528 -0
- data/doc/files.txt +4 -0
- data/doc/generator.txt +141 -0
- data/doc/install.txt +35 -0
- data/doc/introduction.txt +88 -0
- data/doc/rhom.txt +826 -0
- data/doc/standard-css.txt +392 -0
- data/doc/synchronization.txt +542 -0
- data/doc/test-log-debug.txt +148 -0
- data/doc/tutorial.txt +136 -0
- data/doc/ui.txt +766 -0
- data/installer/EnvVarUpdate.nsh +328 -0
- data/installer/README.html +81 -0
- data/installer/RHOSYNC-LICENSE.txt +675 -0
- data/installer/icon.ico +0 -0
- data/installer/instant-rhodes.nsi +427 -0
- data/lib/build/jake.rb +15 -1
- data/lib/extensions/barcode/ext/barcode/platform/android/jni/src/imageprovider.cpp +1 -1
- data/lib/extensions/barcode/ext/barcode/platform/bb/Barcode6.files +45 -0
- data/lib/extensions/barcode/ext/barcode/platform/bb/Rakefile +6 -0
- data/lib/extensions/barcode/ext/barcode/platform/bb/barcode6.jdp +92 -0
- data/lib/extensions/barcode/ext/barcode/platform/iphone/Barcode.xcodeproj/project.pbxproj +7 -4
- data/lib/extensions/barcode/ext/barcode/platform/iphone/Rakefile +2 -1
- data/lib/extensions/barcode/ext/barcode/platform/wm/src/wm_imageprovider.cpp +1 -1
- data/lib/extensions/digest-sha1/ext/build.bat +1 -0
- data/lib/extensions/digest-sha1/ext/digest-sha1.vcproj +335 -0
- data/lib/extensions/esri/ext/build +17 -0
- data/lib/extensions/esri/ext/build.bat +29 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewFactory.h +7 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewFactory.mm +58 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewFactoryRegister.mm +22 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewManager.h +21 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewManager.mm +32 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/InitESRI.c +5 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/MapViewControllerESRI.h +143 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/MapViewControllerESRI.m +919 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/ESRI.xcodeproj/project.pbxproj +320 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/ESRI_Prefix.pch +7 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Rakefile +76 -0
- data/lib/extensions/esri/ext.yml +3 -0
- data/lib/extensions/net-http/monitor.rb +265 -0
- data/lib/extensions/net-http/net/ftp.rb +981 -0
- data/lib/extensions/net-http/thread.rb +367 -0
- data/lib/extensions/rhocgi/cgi.rb +16 -0
- data/lib/extensions/rhospec/rhospec.rb +118 -0
- data/lib/framework/base64.rb +91 -0
- data/lib/framework/builtinME.rb +13 -10
- data/lib/framework/ostruct.rb +145 -0
- data/lib/framework/res/back_btn.wm.png +0 -0
- data/lib/framework/res/blue_pushpin.wm.png +0 -0
- data/lib/framework/res/blue_pushpin_small.wm.png +0 -0
- data/lib/framework/res/callout.wm.png +0 -0
- data/lib/framework/res/callout_link.wm.png +0 -0
- data/lib/framework/res/forward_btn.wm.png +0 -0
- data/lib/framework/res/home_btn.wm.png +0 -0
- data/lib/framework/res/options_btn.wm.png +0 -0
- data/lib/framework/res/refresh_btn.wm.png +0 -0
- data/lib/framework/rho/render.rb +5 -2
- data/lib/framework/rho/rho.rb +320 -50
- data/lib/framework/rho/rhoapplication.rb +48 -10
- data/lib/framework/rho/rhonativeviewmanager.rb +73 -0
- data/lib/framework/rho/rhosupport.rb +15 -1
- data/lib/framework/rho/rhotabbar.rb +29 -0
- data/lib/framework/rho/rhotoolbar.rb +17 -0
- data/lib/framework/rho/rhoutils.rb +22 -6
- data/lib/framework/rhodes.rb +1 -1
- data/lib/framework/rholang/rhomsg_de.rb +4 -3
- data/lib/framework/rholang/rhomsg_en.rb +1 -0
- data/lib/framework/rholang/rhomsg_es.rb +1 -0
- data/lib/framework/rholang/rhomsg_it.rb +1 -0
- data/lib/framework/rhom/rhom.rb +31 -10
- data/lib/framework/rhom/rhom_db_adapter.rb +33 -23
- data/lib/framework/rhom/rhom_object_factory.rb +465 -249
- data/lib/framework/rhom/rhom_source.rb +22 -7
- data/lib/framework/version.rb +1 -1
- data/lib/rhodes.rb +1 -1
- data/platform/android/Rhodes/AndroidManifest.xml +83 -20
- data/platform/android/Rhodes/gen/com/rhomobile/rhodes/R.java +5 -0
- data/platform/android/Rhodes/jni/include/rhodes/RhoClassFactory.h +2 -0
- data/platform/android/Rhodes/jni/include/rhodes/details/rhojava.inc +9 -5
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_RhodesAppOptions.h +53 -0
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_RhodesService.h +46 -56
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_SplashScreen.h +10 -0
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_mapview_MapView.h +93 -0
- data/platform/android/Rhodes/jni/include/rhodes/rhocryptimpl.h +38 -0
- data/platform/android/Rhodes/jni/include/rhodes.h +64 -8
- data/platform/android/Rhodes/jni/src/RhoClassFactory.cpp +6 -0
- data/platform/android/Rhodes/jni/src/alert.cpp +5 -11
- data/platform/android/Rhodes/jni/src/bluetooth.cpp +66 -29
- data/platform/android/Rhodes/jni/src/callbacks.cpp +24 -21
- data/platform/android/Rhodes/jni/src/camera.cpp +2 -6
- data/platform/android/Rhodes/jni/src/datetimepicker.cpp +13 -11
- data/platform/android/Rhodes/jni/src/event.cpp +9 -15
- data/platform/android/Rhodes/jni/src/fileapi.cpp +13 -27
- data/platform/android/Rhodes/jni/src/logconf.cpp +3 -3
- data/platform/android/Rhodes/jni/src/mapview.cpp +696 -16
- data/platform/android/Rhodes/jni/src/menu.cpp +3 -3
- data/platform/android/Rhodes/jni/src/nativebar.cpp +55 -4
- data/platform/android/Rhodes/jni/src/nativeview.cpp +33 -0
- data/platform/android/Rhodes/jni/src/phonebook.cpp +6 -11
- data/platform/android/Rhodes/jni/src/rhoconf.cpp +4 -4
- data/platform/android/Rhodes/jni/src/rhocryptimpl.cpp +87 -0
- data/platform/android/Rhodes/jni/src/rhodes.cpp +55 -34
- data/platform/android/Rhodes/jni/src/ringtones.cpp +2 -3
- data/platform/android/Rhodes/jni/src/signature.cpp +3 -5
- data/platform/android/Rhodes/jni/src/splashscreen.cpp +7 -0
- data/platform/android/Rhodes/jni/src/sslimpl.cpp +17 -20
- data/platform/android/Rhodes/jni/src/webview.cpp +13 -12
- data/platform/android/Rhodes/res/drawable/callout.png +0 -0
- data/platform/android/Rhodes/res/drawable/callout_link.png +0 -0
- data/platform/android/Rhodes/res/drawable/signature_cancel.png +0 -0
- data/platform/android/Rhodes/res/drawable/signature_clear.png +0 -0
- data/platform/android/Rhodes/res/drawable/signature_ok.png +0 -0
- data/platform/android/Rhodes/res/layout/datetime.xml +4 -0
- data/platform/android/Rhodes/res/layout/signature.xml +24 -17
- data/platform/android/Rhodes/res/layout/status_bar_ongoing_event_progress_bar.xml +102 -0
- data/platform/android/Rhodes/res/values/strings.xml +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/AndroidR.java +6 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Base64.java +575 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/BaseActivity.java +83 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeBar.java +21 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushReceiver.java +23 -15
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushService.java +2 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoCryptImpl.java +151 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoMenu.java +2 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +372 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesAppOptions.java +11 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +58 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +705 -523
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RingtoneManager.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/SplashScreen.java +167 -85
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Utils.java +36 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +4 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/Alert.java +33 -20
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/IRhoBluetoothManager.java +2 -6
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManager.java +2 -24
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManagerNew.java +106 -36
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManagerOld.java +15 -58
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothSession.java +0 -7
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/Camera.java +6 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/FileList.java +4 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/ImageCapture.java +91 -27
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/datetime/DateTimePicker.java +6 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/datetime/DateTimePickerScreen.java +275 -42
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/EventStore.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/file/RhoFileApi.java +1 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/MainView.java +1 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +120 -43
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +518 -28
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java +2 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/GoogleMapView.java +434 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapTouch.java +20 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapView.java +296 -336
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MultiTouchHandler.java +111 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/OneTouchHandler.java +77 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/TouchHandler.java +10 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/nativeview/RhoNativeViewManager.java +0 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Contact.java +5 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorNew.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorOld.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/ImageCapture.java +6 -11
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/Signature.java +6 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/SignatureView.java +0 -7
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/ui/LogViewDialog.java +9 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/util/PerformOnUiThread.java +8 -8
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientNew.java +5 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientOld.java +11 -7
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebSettingsNew.java +3 -5
- data/platform/android/build/RhodesSRC_build.files +32 -23
- data/platform/android/build/android.rake +28 -11
- data/platform/android/build/androidcommon.rb +2 -0
- data/platform/android/build/librhocommon_build.files +9 -5
- data/platform/android/build/librhodes_build.files +1 -0
- data/platform/android/build/libruby_build.files +1 -0
- data/platform/bb/Hsqldb/Hsqldb.jdp +0 -2
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBResult.java +10 -2
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBStorage.java +37 -5
- data/platform/bb/Hsqldb/src/org/hsqldb/Column.java +5 -5
- data/platform/bb/Hsqldb/src/org/hsqldb/Expression.java +1 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/Function.java +73 -78
- data/platform/bb/Hsqldb/src/org/hsqldb/Library.java +288 -8
- data/platform/bb/RubyVM/RubyVM.jdp +3 -0
- data/platform/bb/RubyVM/src/com/rho/FilePath.java +13 -1
- data/platform/bb/RubyVM/src/com/rho/IRhoRubyHelper.java +2 -2
- data/platform/bb/RubyVM/src/com/rho/RhoAppAdapter.java +12 -0
- data/platform/bb/RubyVM/src/com/rho/RhoClassFactory.java +18 -1
- data/platform/bb/RubyVM/src/com/rho/RhoConf.java +128 -108
- data/platform/bb/RubyVM/src/com/rho/RhoLogConf.java +9 -10
- data/platform/bb/RubyVM/src/com/rho/RhoLogger.java +16 -1
- data/platform/bb/RubyVM/src/com/rho/RhoProfiler.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/RhoRuby.java +20 -0
- data/platform/bb/RubyVM/src/com/rho/RhodesApp.java +5 -2
- data/platform/bb/RubyVM/src/com/rho/ThreadQueue.java +65 -46
- data/platform/bb/RubyVM/src/com/rho/db/DBAdapter.java +192 -50
- data/platform/bb/RubyVM/src/com/rho/db/DBAttrManager.java +8 -114
- data/platform/bb/RubyVM/src/com/rho/db/DBException.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/db/IDBCallback.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/db/IDBResult.java +5 -3
- data/platform/bb/RubyVM/src/com/rho/db/IDBStorage.java +5 -1
- data/platform/bb/RubyVM/src/com/rho/file/FileAccessBB.java +109 -0
- data/platform/bb/RubyVM/src/com/rho/file/RhoFile.java +85 -0
- data/platform/bb/RubyVM/src/com/rho/net/NetRequest.java +12 -4
- data/platform/bb/RubyVM/src/com/rho/net/NetResponse.java +5 -0
- data/platform/bb/RubyVM/src/com/rho/net/RhoConnection.java +37 -23
- data/platform/bb/RubyVM/src/com/rho/net/URI.java +84 -0
- data/platform/bb/RubyVM/src/com/rho/sync/ClientRegister.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/sync/SyncEngine.java +119 -61
- data/platform/bb/RubyVM/src/com/rho/sync/SyncNotify.java +61 -24
- data/platform/bb/RubyVM/src/com/rho/sync/SyncSource.java +108 -54
- data/platform/bb/RubyVM/src/com/rho/sync/SyncThread.java +121 -163
- data/platform/bb/RubyVM/src/com/xruby/GeneratedMethods/RubyString_Methods.java +23 -0
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyMutex.java +1 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyRange.java +3 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyRegexp.java +3 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyString.java +208 -25
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyTime.java +3 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RhoSupport.java +5 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyAPI.java +12 -5
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyID.java +1 -0
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyKernelModule.java +16 -0
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyKernelModule_Methods.java +5 -0
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyValue.java +1 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/stdlib/RubyStringIO.java +4 -1
- data/platform/bb/{Hsqldb → RubyVM}/src/j2me/math/Number.java +33 -0
- data/platform/bb/build/RubyVM_build.files +3 -0
- data/platform/bb/build/bb.rake +140 -62
- data/platform/bb/build/hsqldb_build.files +0 -2
- data/platform/bb/build/rhodes_build.files +5 -0
- data/platform/bb/rhodes/platform/4.7/com/rho/RhoMainScreen.java +43 -7
- data/platform/bb/rhodes/platform/5.0/com/rho/BrowserAdapter5.java +23 -2
- data/platform/bb/rhodes/platform/5.0/com/rho/RhodesApplicationPlatform.java +5 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteCopyResult.java +143 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteResult.java +269 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteStorage.java +446 -0
- data/platform/bb/rhodes/platform/common/com/rho/BrowserAdapter5.java +3 -0
- data/platform/bb/rhodes/platform/common/com/rho/RhoMainScreen.java +12 -2
- data/platform/bb/rhodes/platform/common/com/rho/db/SqliteCopyResult.java +2 -0
- data/platform/bb/rhodes/platform/common/com/rho/db/SqliteResult.java +2 -0
- data/platform/bb/rhodes/platform/common/com/rho/db/SqliteStorage.java +2 -0
- data/platform/bb/rhodes/resources/mappin.png +0 -0
- data/platform/bb/rhodes/rhodes.jdp +3 -0
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +21 -18
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter5.java +150 -0
- data/platform/bb/rhodes/src/com/rho/IBrowserAdapter.java +1 -0
- data/platform/bb/rhodes/src/com/rho/RhoMainScreen.java +63 -4
- data/platform/bb/rhodes/src/com/rho/RhoRubyHelper.java +6 -5
- data/platform/bb/rhodes/src/com/rho/RhodesApplicationPlatform.java +242 -2
- data/platform/bb/rhodes/src/com/rho/db/SqliteCopyResult.java +143 -0
- data/platform/bb/rhodes/src/com/rho/db/SqliteResult.java +269 -0
- data/platform/bb/rhodes/src/com/rho/db/SqliteStorage.java +446 -0
- data/platform/bb/rhodes/src/com/rho/file/Jsr75File.java +1 -1
- data/platform/bb/rhodes/src/com/rho/net/NetworkAccess.java +71 -14
- data/platform/bb/rhodes/src/com/rho/net/bb/BBHttpConnection.java +4 -2
- data/platform/bb/rhodes/src/com/rho/rubyext/Alert.java +28 -12
- data/platform/bb/rhodes/src/com/rho/rubyext/System.java +100 -4
- data/platform/bb/rhodes/src/com/rho/rubyext/WebView.java +3 -2
- data/platform/bb/rhodes/src/com/rho/rubyext/XMLParser.java +1 -1
- data/platform/bb/rhodes/src/rhomobile/NativeBar.java +32 -0
- data/platform/bb/rhodes/src/rhomobile/PushListeningThread.java +9 -2
- data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +174 -41
- data/platform/bb/rhodes/src/rhomobile/datetime/DateTimePicker.java +52 -3
- data/platform/bb/rhodes/src/rhomobile/datetime/DateTimeScreen.java +33 -1
- data/platform/bb/rhodes/src/rhomobile/mapview/Annotation.java +2 -14
- data/platform/bb/rhodes/src/rhomobile/mapview/ESRIMapField.java +686 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/ESRIMapProvider.java +14 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/GeoCoding.java +13 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/GoogleGeoCoding.java +174 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/GoogleMapField.java +104 -330
- data/platform/bb/rhodes/src/rhomobile/mapview/MapTools.java +79 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/MapView.java +35 -12
- data/platform/bb/rhodes/src/rhomobile/mapview/MapViewParent.java +2 -1
- data/platform/bb/rhodes/src/rhomobile/mapview/MapViewScreen.java +336 -44
- data/platform/bb/rhodes/src/rhomobile/mapview/RhoMapField.java +3 -6
- data/platform/iphone/Classes/AppManager/AppManager.m +19 -4
- data/platform/iphone/Classes/DateTime.h +4 -0
- data/platform/iphone/Classes/DateTime.m +1 -1
- data/platform/iphone/Classes/DateTimePicker.m +8 -1
- data/platform/iphone/Classes/DateTimePickerDelegate.m +7 -1
- data/platform/iphone/Classes/Event/Event.m +2 -2
- data/platform/iphone/Classes/MapView/MapViewController.h +4 -1
- data/platform/iphone/Classes/MapView/MapViewController.m +6 -46
- data/platform/iphone/Classes/MapView/MapViewManager.h +26 -0
- data/platform/iphone/Classes/MapView/MapViewManager.m +172 -0
- data/platform/iphone/Classes/NativeBar.h +34 -0
- data/platform/iphone/Classes/NativeBar.m +131 -26
- data/platform/iphone/Classes/NativeView/NVDelegate.h +26 -0
- data/platform/iphone/Classes/NativeView/NVDelegate.m +40 -0
- data/platform/iphone/Classes/NativeView/NVViewController.h +24 -0
- data/platform/iphone/Classes/NativeView/NVViewController.m +90 -0
- data/platform/iphone/Classes/NativeView/RhoNativeViewManager.mm +449 -0
- data/platform/iphone/Classes/{RhoNativeViewManagerOC.h → NativeView/RhoNativeViewManagerOC.h} +15 -0
- data/platform/iphone/Classes/RhoAlert.m +3 -3
- data/platform/iphone/Classes/RhoMainView.h +3 -0
- data/platform/iphone/Classes/Rhodes.h +6 -2
- data/platform/iphone/Classes/Rhodes.m +47 -79
- data/platform/iphone/Classes/Signature/SignatureViewController.m +1 -0
- data/platform/iphone/Classes/SimpleMainView.h +18 -1
- data/platform/iphone/Classes/SimpleMainView.m +180 -35
- data/platform/iphone/Classes/SplitView/LeftViewController.h +1 -1
- data/platform/iphone/Classes/SplitView/LeftViewController.m +13 -7
- data/platform/iphone/Classes/SplitView/RightViewController.h +1 -1
- data/platform/iphone/Classes/SplitView/RightViewController.m +26 -11
- data/platform/iphone/Classes/SplitView/SplittedMainView.h +1 -6
- data/platform/iphone/Classes/SplitView/SplittedMainView.m +14 -52
- data/platform/iphone/Classes/TabbedMainView.h +25 -3
- data/platform/iphone/Classes/TabbedMainView.m +340 -14
- data/platform/iphone/ESRI/BluePushpin.png +0 -0
- data/platform/iphone/ESRI/BluePushpin@2x.png +0 -0
- data/platform/iphone/ESRI/esri.png +0 -0
- data/platform/iphone/ESRI/esri@2x.png +0 -0
- data/platform/iphone/Info.plist +1 -1
- data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +26 -3
- data/platform/iphone/rbuild/iphone.rake +100 -4
- data/platform/iphone/rhorubylib/rhorubylib.xcodeproj/project.pbxproj +12 -0
- data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +116 -12
- data/platform/shared/SyncClient/SyncClient.cpp +29 -3
- data/platform/shared/SyncClient/SyncClient.h +2 -1
- data/platform/shared/common/IRhoClassFactory.h +3 -0
- data/platform/shared/common/IRhoCrypt.h +16 -0
- data/platform/shared/common/IRhoThreadImpl.h +1 -0
- data/platform/shared/common/RhoAppAdapter.h +2 -0
- data/platform/shared/common/RhoConf.cpp +97 -46
- data/platform/shared/common/RhoConf.h +14 -13
- data/platform/shared/common/RhoFile.cpp +10 -0
- data/platform/shared/common/RhoFile.h +1 -0
- data/platform/shared/common/RhoMath.cpp +43 -0
- data/platform/shared/common/RhoMath.h +27 -0
- data/platform/shared/common/RhoNativeViewManager.h +27 -1
- data/platform/shared/common/RhoPort.h +11 -0
- data/platform/shared/common/RhoStd.h +5 -0
- data/platform/shared/common/RhoThread.cpp +1 -1
- data/platform/shared/common/RhoThread.h +1 -1
- data/platform/shared/common/RhodesApp.cpp +381 -139
- data/platform/shared/common/RhodesApp.h +24 -10
- data/platform/shared/common/RhodesAppBase.cpp +72 -1
- data/platform/shared/common/RhodesAppBase.h +5 -1
- data/platform/shared/common/SplashScreen.h +4 -4
- data/platform/shared/common/ThreadQueue.cpp +44 -17
- data/platform/shared/common/ThreadQueue.h +4 -0
- data/platform/shared/common/app_build_configs.c +0 -1
- data/platform/shared/common/iphone/RhoClassfactory.h +6 -0
- data/platform/shared/common/iphone/RhoCryptImpl.h +47 -0
- data/platform/shared/common/iphone/RhoCryptImpl.mm +286 -0
- data/platform/shared/common/map/ESRIMapEngine.cpp +921 -0
- data/platform/shared/common/map/ESRIMapEngine.h +255 -0
- data/platform/shared/common/map/GoogleMapEngine.cpp +160 -0
- data/platform/shared/common/map/GoogleMapEngine.h +52 -0
- data/platform/shared/common/map/MapEngine.cpp +304 -0
- data/platform/shared/common/map/MapEngine.h +214 -0
- data/platform/shared/db/DBAdapter.cpp +147 -18
- data/platform/shared/db/DBAdapter.h +38 -12
- data/platform/shared/db/DBAttrManager.cpp +4 -3
- data/platform/shared/db/DBAttrManager.h +7 -7
- data/platform/shared/db/res/db/syncdb.triggers +0 -5
- data/platform/shared/db/res/db/syncdb_java.triggers +21 -0
- data/platform/shared/json/JSONIterator.cpp +11 -1
- data/platform/shared/json/JSONIterator.h +1 -0
- data/platform/shared/logging/RhoLogConf.cpp +29 -12
- data/platform/shared/net/CURLNetRequest.cpp +80 -25
- data/platform/shared/net/CURLNetRequest.h +6 -2
- data/platform/shared/net/HttpServer.cpp +12 -6
- data/platform/shared/net/HttpServer.h +2 -1
- data/platform/shared/net/INetRequest.h +1 -0
- data/platform/shared/ruby/ext/alert/alert.i +5 -0
- data/platform/shared/ruby/ext/alert/alert_wrap.c +439 -108
- data/platform/shared/ruby/ext/datetimepicker/datetimepicker.i +42 -0
- data/platform/shared/ruby/ext/datetimepicker/datetimepicker_wrap.c +521 -120
- data/platform/shared/ruby/ext/nativebar/nativebar.i +16 -0
- data/platform/shared/ruby/ext/nativebar/nativebar_wrap.c +623 -128
- data/platform/shared/ruby/ext/nativeviewmanager/nativeviewmanager.i +18 -0
- data/platform/shared/ruby/ext/nativeviewmanager/nativeviewmanager_wrap.c +2321 -0
- data/platform/shared/ruby/ext/rho/extensions.c +0 -1
- data/platform/shared/ruby/ext/rho/rhoruby.c +53 -0
- data/platform/shared/ruby/ext/rho/rhoruby.h +6 -0
- data/platform/shared/ruby/ext/sqlite3_api/sqlite3_api_wrap.c +6 -3
- data/platform/shared/ruby/ext/syncengine/syncengine.i +9 -1
- data/platform/shared/ruby/ext/syncengine/syncengine_wrap.c +61 -0
- data/platform/shared/ruby/ext/system/system.i +4 -0
- data/platform/shared/ruby/ext/system/system_wrap.c +33 -5
- data/platform/shared/rubyext/RhoAppAdapter.cpp +11 -1
- data/platform/shared/rubyext/System.cpp +9 -0
- data/platform/shared/rubyext/WebView.h +1 -0
- data/platform/shared/sqlite/crypto.c +907 -0
- data/platform/shared/sqlite/sqlite3.c +6 -0
- data/platform/shared/sync/SyncEngine.cpp +49 -19
- data/platform/shared/sync/SyncEngine.h +0 -1
- data/platform/shared/sync/SyncNotify.cpp +14 -5
- data/platform/shared/sync/SyncNotify.h +2 -2
- data/platform/shared/sync/SyncSource.cpp +79 -33
- data/platform/shared/sync/SyncSource.h +1 -0
- data/platform/shared/sync/SyncThread.cpp +26 -11
- data/platform/shared/xruby/src/com/xruby/compiler/codedom/StringExpression.java +4 -2
- data/platform/wm/RhoLib/RhoLib.vcproj +108 -72
- data/platform/wm/build/wm.rake +6 -0
- data/platform/wm/rhodes/Alert.cpp +4 -3
- data/platform/wm/rhodes/Alert.h +1 -1
- data/platform/wm/rhodes/DateTimePicker.cpp +30 -3
- data/platform/wm/rhodes/DateTimePicker.h +9 -1
- data/platform/wm/rhodes/MainWindow.cpp +121 -61
- data/platform/wm/rhodes/MainWindow.h +29 -4
- data/platform/wm/rhodes/MapView/Graphics.cpp +547 -0
- data/platform/wm/rhodes/MapView/Graphics.h +136 -0
- data/platform/wm/rhodes/MapView/MapViewManager.cpp +391 -0
- data/platform/wm/rhodes/MapView/MapViewManager.h +158 -0
- data/platform/wm/rhodes/RhoCryptImpl.cpp +248 -0
- data/platform/wm/rhodes/RhoCryptImpl.h +51 -0
- data/platform/wm/rhodes/RhoNativeViewManager.cpp +208 -0
- data/platform/wm/rhodes/Rhodes.cpp +94 -102
- data/platform/wm/rhodes/Rhodes.rc +27 -0
- data/platform/wm/rhodes/SyncStatusDlg.cpp +1 -0
- data/platform/wm/rhodes/SyncStatusDlg.h +2 -1
- data/platform/wm/rhodes/bluetooth/Bluetooth.cpp +7 -4
- data/platform/wm/rhodes/camera/Camera.cpp +36 -15
- data/platform/wm/rhodes/camera/Camera.h +0 -4
- data/platform/wm/rhodes/resource.h +10 -2
- data/platform/wm/rhodes/rho/common/RhoClassFactory.cpp +7 -0
- data/platform/wm/rhodes/rho/common/RhoClassFactory.h +1 -0
- data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +10 -2
- data/platform/wm/rhodes/rho/net/NetRequestImpl.h +10 -0
- data/platform/wm/rhodes/rho/rubyext/NativeToolbar.cpp +513 -0
- data/platform/wm/rhodes/rho/rubyext/NativeToolbar.h +74 -0
- data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +22 -10
- data/platform/wm/rhodes/rho/rubyext/WebView.cpp +5 -0
- data/platform/wm/rhodes/rhodes.vcproj +38 -2
- data/platform/wm/rhodes/stdafx.h +2 -1
- data/platform/wm/rubylib/rubylib.vcproj +12 -0
- data/rakefile.rb +85 -80
- data/res/build-tools/iphonesim/Source/iPhoneSimulator.m +14 -3
- data/res/build-tools/iphonesim/build/Release/iphonesim +0 -0
- data/res/build-tools/iphonesim/iphonesim.xcodeproj/project.pbxproj +2 -0
- data/res/build-tools/xruby-0.3.3.jar +0 -0
- data/res/generators/templates/application/app/application.rb +2 -2
- data/res/generators/templates/application/app/helpers/application_helper.rb +1 -1
- data/res/generators/templates/application/public/css/android.css +1 -0
- data/res/generators/templates/application/public/jqtouch/jquery.1.3.2.min.js +1 -1
- data/res/generators/templates/application/rhoconfig.txt +66 -14
- data/rhodes.gemspec +3 -3
- data/spec/framework_spec/app/spec/core/file/expand_path_spec.rb +7 -3
- data/spec/framework_spec/build.yml +1 -1
- data/spec/phone_spec/Rakefile +1 -0
- data/spec/phone_spec/app/Account/account.rb +2 -0
- data/spec/phone_spec/app/Account_s/account_s.rb +7 -0
- data/spec/phone_spec/app/spec/{fixtures → array/fixtures}/classes.rb +0 -0
- data/spec/phone_spec/app/spec/{array_pack_spec.rb → array/pack_spec.rb} +2 -1
- data/spec/phone_spec/app/spec/bulksync_spec.rb +1 -0
- data/spec/phone_spec/app/spec/contacts_spec.rb +2 -0
- data/spec/phone_spec/app/spec/rho_spec.rb +34 -233
- data/spec/phone_spec/app/spec/rhom_object_spec.rb +396 -87
- data/spec/phone_spec/app/spec/string/element_set_spec.rb +251 -0
- data/spec/phone_spec/app/spec/string/end_with_spec.rb +49 -0
- data/spec/phone_spec/app/spec/string/fixtures/classes.rb +27 -0
- data/spec/phone_spec/app/spec/{lstrip_spec.rb → string/lstrip_spec.rb} +0 -0
- data/spec/phone_spec/app/spec/string/replace_spec.rb +52 -0
- data/spec/phone_spec/app/spec/{rstrip_spec.rb → string/rstrip_spec.rb} +0 -0
- data/spec/phone_spec/app/spec/string/slice_spec.rb +473 -0
- data/spec/phone_spec/app/spec/string/split_spec.rb +302 -0
- data/spec/phone_spec/app/spec/string/start_with_spec.rb +48 -0
- data/spec/phone_spec/app/spec/{strip_spec.rb → string/strip_spec.rb} +0 -0
- data/spec/phone_spec/app/spec/syncengine_spec.rb +30 -1
- data/spec/phone_spec/app/spec_runner.rb +15 -7
- data/spec/phone_spec/build.yml +2 -2
- metadata +154 -25
- data/README.textile +0 -45
- data/platform/android/Rhodes/AndroidManifest.full.xml +0 -62
- data/platform/android/Rhodes/gen/com/rhomobile/rhodes/Manifest.java +0 -14
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoActivity.java +0 -20
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Rhodes.java +0 -193
- data/platform/bb/Hsqldb/src/com/rho/file/FileAccessBB.java +0 -25
- data/platform/bb/RubyVM/src/com/rho/AppBuildConfig.java +0 -22
- data/platform/bb/RubyVM/src/com/rho/Capabilities.java +0 -6
- data/platform/bb/RubyVM/src/com/rho/Extensions.java +0 -11
- data/platform/iphone/Classes/RhoNativeViewManager.mm +0 -226
@@ -20,11 +20,9 @@
|
|
20
20
|
require 'rhom'
|
21
21
|
require 'rho/rhoutils'
|
22
22
|
|
23
|
+
USE_HSQLDB = System.get_property('platform') == 'Blackberry' #&& System.get_property('os_version')[0].to_i() < 5
|
23
24
|
USE_COPY_FILES = !defined? RHO_ME
|
24
25
|
|
25
|
-
#TODO:
|
26
|
-
#BB: issue with sql search : https://www.pivotaltracker.com/story/show/3182398 ; after fix uncomment all RHO_ME comments
|
27
|
-
|
28
26
|
def getAccount
|
29
27
|
return Account_s if $spec_settings[:schema_model]
|
30
28
|
|
@@ -49,13 +47,17 @@ def getCase_str
|
|
49
47
|
'Case'
|
50
48
|
end
|
51
49
|
|
50
|
+
def getTestDB
|
51
|
+
::Rho::RHO.get_db_partitions['local']
|
52
|
+
end
|
53
|
+
|
52
54
|
def clean_db_data
|
53
55
|
#Rhom::Rhom.database_full_reset(true)
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
56
|
+
getTestDB().start_transaction
|
57
|
+
getTestDB().delete_all_from_table('client_info')
|
58
|
+
getTestDB().delete_all_from_table('object_values')
|
59
|
+
getTestDB().delete_all_from_table('changed_values')
|
60
|
+
getTestDB().commit
|
59
61
|
end
|
60
62
|
|
61
63
|
def copy_file(src, dst_dir)
|
@@ -67,8 +69,10 @@ class Test_Helper
|
|
67
69
|
def before_all(tables, folder)
|
68
70
|
@tables = tables
|
69
71
|
@folder = folder
|
70
|
-
|
71
|
-
|
72
|
+
|
73
|
+
Rho::RHO.load_all_sources()
|
74
|
+
@save_sync_types = getTestDB().select_from_table('sources','name, sync_type')
|
75
|
+
getTestDB().update_into_table('sources',{'sync_type'=>'none'})
|
72
76
|
|
73
77
|
Rho::RhoConfig.sources[getAccount_str()]['sync_type'] = 'incremental' if $spec_settings[:sync_model]
|
74
78
|
Rho::RhoConfig.sources[getCase_str()]['sync_type'] = 'incremental' if $spec_settings[:sync_model]
|
@@ -82,8 +86,8 @@ class Test_Helper
|
|
82
86
|
if USE_COPY_FILES
|
83
87
|
Rho::RhoUtils.load_offline_data(@tables, @folder, @source_map)
|
84
88
|
|
85
|
-
src_path = Rho::RhoFSConnector::get_db_fullpathname('
|
86
|
-
if
|
89
|
+
src_path = Rho::RhoFSConnector::get_db_fullpathname('local')
|
90
|
+
if USE_HSQLDB
|
87
91
|
src_path.sub!(".sqlite", ".data")
|
88
92
|
copy_file( src_path, Rho::RhoFSConnector::get_blob_folder() )
|
89
93
|
src_path.sub!(".data", ".script")
|
@@ -96,9 +100,9 @@ class Test_Helper
|
|
96
100
|
|
97
101
|
def after_each
|
98
102
|
if USE_COPY_FILES
|
99
|
-
dst_path = Rho::RhoFSConnector::get_db_fullpathname('
|
103
|
+
dst_path = Rho::RhoFSConnector::get_db_fullpathname('local')
|
100
104
|
src_path = File.join( Rho::RhoFSConnector::get_blob_folder(), File.basename(dst_path))
|
101
|
-
if
|
105
|
+
if USE_HSQLDB
|
102
106
|
src_path.sub!(".sqlite", ".data")
|
103
107
|
copy_file( src_path, File.dirname(dst_path) )
|
104
108
|
src_path.sub!(".data", ".script")
|
@@ -119,7 +123,7 @@ class Test_Helper
|
|
119
123
|
|
120
124
|
def after_all
|
121
125
|
@save_sync_types.each do |src|
|
122
|
-
|
126
|
+
getTestDB().update_into_table('sources',{'sync_type'=>src['sync_type']}, {'name'=>src['name']})
|
123
127
|
end
|
124
128
|
|
125
129
|
Rho::RhoConfig.sources[getAccount_str()]['sync_type'] = 'none'
|
@@ -150,7 +154,7 @@ describe "Rhom::RhomObject" do
|
|
150
154
|
# getAccount.get_source_id.should == "23"
|
151
155
|
#getCase.get_source_id.should == "1"
|
152
156
|
#end
|
153
|
-
|
157
|
+
#=begin
|
154
158
|
it "should dynamically assign values" do
|
155
159
|
account = getAccount.new
|
156
160
|
account.name = 'hello name'
|
@@ -186,6 +190,20 @@ describe "Rhom::RhomObject" do
|
|
186
190
|
results[1].name.should == "Aeroprise"
|
187
191
|
results[1].industry.should == "Technology"
|
188
192
|
end
|
193
|
+
|
194
|
+
it "should compare 2 props" do
|
195
|
+
results = getAccount.find_all(:order => 'name', :orderdir => "DESC")
|
196
|
+
results.length.should == 2
|
197
|
+
|
198
|
+
res = false
|
199
|
+
if results[0].name == results[1].name
|
200
|
+
res = true
|
201
|
+
else
|
202
|
+
res = false
|
203
|
+
end
|
204
|
+
|
205
|
+
res.should == false
|
206
|
+
end
|
189
207
|
|
190
208
|
it "should have correct number of attributes" do
|
191
209
|
@account = getAccount.find(:all, :order => 'name', :orderdir => "DESC").first
|
@@ -217,6 +235,14 @@ describe "Rhom::RhomObject" do
|
|
217
235
|
|
218
236
|
end
|
219
237
|
|
238
|
+
it "should save string with zero" do
|
239
|
+
val = "\1\2\3\0\5\8\6\7\34"
|
240
|
+
|
241
|
+
item = getAccount.create(:industry => Rho::RhoSupport::binary_encode(val))
|
242
|
+
item2 = getAccount.find(item.object)
|
243
|
+
Rho::RhoSupport::binary_decode(item2.industry).should == val
|
244
|
+
end
|
245
|
+
|
220
246
|
it "should create multiple records offline" do
|
221
247
|
vars = {"name"=>"foobarthree", "industry"=>"entertainment"}
|
222
248
|
getAccount.changed?.should == false
|
@@ -242,7 +268,7 @@ describe "Rhom::RhomObject" do
|
|
242
268
|
end
|
243
269
|
|
244
270
|
it "should update attribs while save" do
|
245
|
-
records =
|
271
|
+
records = getTestDB().select_from_table('changed_values','*', 'update_type' => 'update')
|
246
272
|
records.length.should == 0
|
247
273
|
|
248
274
|
acct = getAccount.find(:first)
|
@@ -253,15 +279,15 @@ describe "Rhom::RhomObject" do
|
|
253
279
|
acct2.name.should == 'soccer'
|
254
280
|
|
255
281
|
if $spec_settings[:sync_model]
|
256
|
-
records =
|
282
|
+
records = getTestDB().select_from_table('changed_values','*', 'update_type' => 'update')
|
257
283
|
records.length.should == 1
|
258
284
|
end
|
259
285
|
|
260
286
|
end
|
261
287
|
|
262
288
|
it "should create records with no attribs in database" do
|
263
|
-
|
264
|
-
res =
|
289
|
+
getTestDB().delete_all_from_table('object_values')
|
290
|
+
res = getTestDB().select_from_table('object_values',"*")
|
265
291
|
res.length.should == 0
|
266
292
|
vars = {"name"=>"foobarthree", "industry"=>"entertainment"}
|
267
293
|
account = getAccount.create(vars)
|
@@ -330,10 +356,11 @@ describe "Rhom::RhomObject" do
|
|
330
356
|
@account3.industry.should == update_attributes['industry']
|
331
357
|
|
332
358
|
if $spec_settings[:sync_model]
|
333
|
-
records =
|
334
|
-
records.length.should ==
|
359
|
+
records = getTestDB().select_from_table('changed_values','*', 'update_type' => 'create')
|
360
|
+
records.length.should == 1
|
361
|
+
records[0]['attrib'].should == 'object'
|
335
362
|
|
336
|
-
records =
|
363
|
+
records = getTestDB().select_from_table('changed_values','*', 'update_type' => 'update')
|
337
364
|
records.length.should == 0
|
338
365
|
end
|
339
366
|
end
|
@@ -356,22 +383,23 @@ describe "Rhom::RhomObject" do
|
|
356
383
|
@account3.industry.should == update_attributes['industry']
|
357
384
|
|
358
385
|
if $spec_settings[:sync_model]
|
359
|
-
records =
|
360
|
-
records.length.should ==
|
386
|
+
records = getTestDB().select_from_table('changed_values','*', 'update_type' => 'create')
|
387
|
+
records.length.should == 1
|
388
|
+
records[0]['attrib'].should == 'object'
|
361
389
|
|
362
|
-
records =
|
390
|
+
records = getTestDB().select_from_table('changed_values','*', 'update_type' => 'update')
|
363
391
|
records.length.should == 0
|
364
392
|
end
|
365
393
|
end
|
366
394
|
|
367
395
|
it "should destroy a record" do
|
368
|
-
count = getAccount.
|
369
|
-
@account = getAccount.find(:
|
396
|
+
count = getAccount.count
|
397
|
+
@account = getAccount.find(:first)
|
370
398
|
destroy_id = @account.object
|
371
399
|
@account.destroy
|
372
400
|
@account_nil = getAccount.find(destroy_id)
|
373
401
|
@account_nil.should be_nil
|
374
|
-
new_count = getAccount.
|
402
|
+
new_count = getAccount.count
|
375
403
|
(count - 1).should == new_count
|
376
404
|
end
|
377
405
|
|
@@ -384,25 +412,25 @@ describe "Rhom::RhomObject" do
|
|
384
412
|
@new_acct.industry.should == "Technology"
|
385
413
|
|
386
414
|
if $spec_settings[:sync_model]
|
387
|
-
records =
|
415
|
+
records = getTestDB().select_from_table('changed_values','*', 'update_type' => 'update')
|
388
416
|
records.length.should == 1
|
389
417
|
end
|
390
418
|
end
|
391
419
|
|
392
420
|
it "should fully update a record" do
|
393
421
|
new_attributes = {"name"=>"Mobio US", "industry"=>"Electronics"}
|
394
|
-
@account = getAccount.find(:
|
422
|
+
@account = getAccount.find(:first)
|
395
423
|
@account.update_attributes(new_attributes)
|
396
424
|
@account.name.should == "Mobio US"
|
397
425
|
@account.industry.should == "Electronics"
|
398
426
|
|
399
|
-
@new_acct = getAccount.find(:
|
427
|
+
@new_acct = getAccount.find(:first)
|
400
428
|
|
401
429
|
@new_acct.name.should == "Mobio US"
|
402
430
|
@new_acct.industry.should == "Electronics"
|
403
431
|
|
404
432
|
if $spec_settings[:sync_model]
|
405
|
-
records =
|
433
|
+
records = getTestDB().select_from_table('changed_values','*', 'update_type' => 'update')
|
406
434
|
records.length.should == 2
|
407
435
|
end
|
408
436
|
end
|
@@ -417,7 +445,7 @@ describe "Rhom::RhomObject" do
|
|
417
445
|
@new_acct.industry.should == "Technology"
|
418
446
|
|
419
447
|
if $spec_settings[:sync_model]
|
420
|
-
records =
|
448
|
+
records = getTestDB().select_from_table('changed_values','*', 'update_type' => 'update')
|
421
449
|
records.length.should == 1
|
422
450
|
end
|
423
451
|
|
@@ -474,13 +502,13 @@ describe "Rhom::RhomObject" do
|
|
474
502
|
@new_acct.industry.should == "Technology"
|
475
503
|
|
476
504
|
if $spec_settings[:sync_model]
|
477
|
-
records =
|
505
|
+
records = getTestDB().select_from_table('changed_values','*', 'update_type' => 'update')
|
478
506
|
records.length.should == 1
|
479
507
|
end
|
480
508
|
end
|
481
509
|
|
482
510
|
it "should update a record with full mode" do
|
483
|
-
records =
|
511
|
+
records = getTestDB().select_from_table('changed_values','*', 'update_type' => 'update')
|
484
512
|
records.length.should == 0
|
485
513
|
|
486
514
|
new_attributes = {"created_by_name"=>"evgeny"}
|
@@ -490,14 +518,15 @@ describe "Rhom::RhomObject" do
|
|
490
518
|
@new_case.created_by_name.should == "evgeny"
|
491
519
|
|
492
520
|
if $spec_settings[:sync_model]
|
493
|
-
records =
|
494
|
-
records.length.should ==
|
521
|
+
records = getTestDB().select_from_table('changed_values','*', 'update_type' => 'update')
|
522
|
+
records.length.should == 1
|
523
|
+
records[0]['attrib'].should == 'object'
|
495
524
|
end
|
496
525
|
|
497
526
|
end
|
498
527
|
|
499
528
|
it "should save a record with full mode" do
|
500
|
-
records =
|
529
|
+
records = getTestDB().select_from_table('changed_values','*', 'update_type' => 'update')
|
501
530
|
records.length.should == 0
|
502
531
|
|
503
532
|
#new_attributes = {"created_by_name"=>"evgeny"}
|
@@ -509,8 +538,9 @@ describe "Rhom::RhomObject" do
|
|
509
538
|
@new_case.created_by_name.should == "evgeny"
|
510
539
|
|
511
540
|
if $spec_settings[:sync_model]
|
512
|
-
records =
|
513
|
-
records.length.should ==
|
541
|
+
records = getTestDB().select_from_table('changed_values','*', 'update_type' => 'update')
|
542
|
+
records.length.should == 1
|
543
|
+
records[0]['attrib'].should == 'object'
|
514
544
|
end
|
515
545
|
|
516
546
|
end
|
@@ -591,30 +621,38 @@ describe "Rhom::RhomObject" do
|
|
591
621
|
@new_acct.name.should == ""
|
592
622
|
@new_acct.industry.should == "Technology"
|
593
623
|
end
|
594
|
-
|
624
|
+
|
595
625
|
it "should store only last updated value for attrib" do
|
626
|
+
object_id = '44e804f2-4933-4e20-271c-48fcecd9450d'
|
596
627
|
new_attributes1 = {"new_name"=>"Mobio Europe"}
|
597
|
-
@account = getAccount.find(
|
628
|
+
@account = getAccount.find(object_id)
|
598
629
|
@account.update_attributes(new_attributes1)
|
630
|
+
if $spec_settings[:sync_model]
|
631
|
+
records = getTestDB().select_from_table('changed_values','*', 'update_type' => 'update')
|
632
|
+
records.length.should == 1
|
633
|
+
end
|
599
634
|
|
600
|
-
@new_acct = getAccount.find(
|
635
|
+
@new_acct = getAccount.find(object_id)
|
601
636
|
|
602
637
|
@new_acct.new_name.should == "Mobio Europe"
|
603
638
|
@new_acct.name.should == "Mobio India"
|
604
639
|
@new_acct.industry.should == "Technology"
|
605
640
|
|
606
641
|
new_attributes2 = {"new_name"=>"Mobio Asia"}
|
607
|
-
@account = getAccount.find(
|
642
|
+
@account = getAccount.find(object_id)
|
608
643
|
@account.update_attributes(new_attributes2)
|
644
|
+
if $spec_settings[:sync_model]
|
645
|
+
records = getTestDB().select_from_table('changed_values','*', 'update_type' => 'update')
|
646
|
+
records.length.should == 1
|
647
|
+
end
|
609
648
|
|
610
|
-
@new_acct = getAccount.find(
|
649
|
+
@new_acct = getAccount.find(object_id)
|
611
650
|
|
612
651
|
@new_acct.new_name.should == "Mobio Asia"
|
613
652
|
@new_acct.name.should == "Mobio India"
|
614
653
|
@new_acct.industry.should == "Technology"
|
615
|
-
|
616
654
|
if $spec_settings[:sync_model]
|
617
|
-
records =
|
655
|
+
records = getTestDB().select_from_table('changed_values','*', 'update_type' => 'update')
|
618
656
|
records.length.should == 1
|
619
657
|
end
|
620
658
|
end
|
@@ -649,7 +687,7 @@ describe "Rhom::RhomObject" do
|
|
649
687
|
end
|
650
688
|
|
651
689
|
it "should find with conditions" do
|
652
|
-
@accts = getAccount.find(:all, :conditions => {'industry' => 'Technology'}, :order => 'name', :orderdir => "
|
690
|
+
@accts = getAccount.find(:all, :conditions => {'industry' => 'Technology'}, :order => 'name', :orderdir => "desc")
|
653
691
|
@accts.length.should == 2
|
654
692
|
@accts[0].name.should == "Mobio India"
|
655
693
|
@accts[0].industry.should == "Technology"
|
@@ -664,12 +702,6 @@ describe "Rhom::RhomObject" do
|
|
664
702
|
@accts[0].industry.should == "Technology"
|
665
703
|
end
|
666
704
|
|
667
|
-
it "should find with SQL multiple conditions" do
|
668
|
-
@acct = getAccount.find(:first, :conditions => [ "name = ? AND industry = ?", "'Mobio India'", "'Technology'" ])
|
669
|
-
@acct.name.should == "Mobio India"
|
670
|
-
@acct.industry.should == "Technology"
|
671
|
-
end
|
672
|
-
|
673
705
|
it "should find with advanced OR conditions" do
|
674
706
|
query = '%IND%'
|
675
707
|
@accts = getAccount.find( :all,
|
@@ -746,6 +778,17 @@ describe "Rhom::RhomObject" do
|
|
746
778
|
nCount.should == 0
|
747
779
|
end
|
748
780
|
|
781
|
+
it "should find with advanced AND conditions and non-string value" do
|
782
|
+
res = getAccount.find( :all,
|
783
|
+
:conditions => {
|
784
|
+
{:func=>'length', :name=>'name', :op=>'>'} => 0
|
785
|
+
},
|
786
|
+
:op => 'AND')
|
787
|
+
|
788
|
+
res.should_not be_nil
|
789
|
+
res.length.should == 2
|
790
|
+
end
|
791
|
+
|
749
792
|
it "should search with LIKE" do
|
750
793
|
query2 = '%CHNolo%' #LIKE is case insensitive by default
|
751
794
|
nCount = getAccount.find( :count,
|
@@ -756,6 +799,55 @@ describe "Rhom::RhomObject" do
|
|
756
799
|
nCount.should_not == 0
|
757
800
|
end
|
758
801
|
|
802
|
+
it "should search with 3 LIKE" do
|
803
|
+
getAccount.create({:SurveyID=>"Survey1", :CallID => 'Call1', :SurveyResultID => 'SurveyResult1'})
|
804
|
+
getAccount.create({:SurveyID=>"Survey2", :CallID => 'Call2', :SurveyResultID => 'SurveyResult2'})
|
805
|
+
getAccount.create({:SurveyID=>"Survey3", :CallID => 'Call3', :SurveyResultID => 'SurveyResult3'})
|
806
|
+
|
807
|
+
shift_callreport = true
|
808
|
+
prevresult = getAccount.find(:first, :conditions =>
|
809
|
+
{{:func => 'LOWER', :name => 'SurveyID', :op => 'LIKE'} => 'survey%',
|
810
|
+
{:func => 'LOWER', :name => 'CallID', :op => 'LIKE'} => 'call%',
|
811
|
+
{:func => 'LOWER', :name => 'SurveyResultID', :op => 'LIKE'} => 'surveyresult%'},
|
812
|
+
:op => 'AND') if shift_callreport
|
813
|
+
|
814
|
+
prevresult.should_not be_nil
|
815
|
+
end
|
816
|
+
|
817
|
+
it "should search with IN array" do
|
818
|
+
items = getAccount.find( :all,
|
819
|
+
:conditions => {
|
820
|
+
{:name=>'industry', :op=>'IN'} => ["Technology", "Technology2"] }
|
821
|
+
)
|
822
|
+
|
823
|
+
items.length.should == 2
|
824
|
+
|
825
|
+
items = getAccount.find( :all,
|
826
|
+
:conditions => {
|
827
|
+
{:name=>'industry', :op=>'IN'} => ["Technology2"] }
|
828
|
+
)
|
829
|
+
|
830
|
+
items.length.should == 0
|
831
|
+
|
832
|
+
end
|
833
|
+
|
834
|
+
it "should search with IN string" do
|
835
|
+
items = getAccount.find( :all,
|
836
|
+
:conditions => {
|
837
|
+
{:name=>'industry', :op=>'IN'} => "\"Technology\", \"Technology2\"" }
|
838
|
+
)
|
839
|
+
|
840
|
+
items.length.should == 2
|
841
|
+
|
842
|
+
items = getAccount.find( :all,
|
843
|
+
:conditions => {
|
844
|
+
{:name=>'industry', :op=>'IN'} => "\"Technology2\"" }
|
845
|
+
)
|
846
|
+
|
847
|
+
items.length.should == 0
|
848
|
+
|
849
|
+
end
|
850
|
+
|
759
851
|
it "should find with group of advanced conditions" do
|
760
852
|
query = '%IND%'
|
761
853
|
cond1 = {
|
@@ -885,48 +977,73 @@ describe "Rhom::RhomObject" do
|
|
885
977
|
|
886
978
|
end
|
887
979
|
|
888
|
-
it "should return records when order by is nil for some records" do
|
889
|
-
@accts = getAccount.find(:all, :order => 'shipping_address_country', :dont_ignore_missed_attribs => true)
|
890
|
-
@accts.length.should == 2
|
891
|
-
|
892
|
-
if ( @accts[1].name == "Aeroprise" )
|
893
|
-
@accts[1].name.should == "Aeroprise"
|
894
|
-
else
|
895
|
-
@accts[0].name.should == "Aeroprise"
|
896
|
-
end
|
897
|
-
end
|
898
|
-
|
899
980
|
it "should delete_all" do
|
900
981
|
vars = {"name"=>"foobarthree", "industry"=>"entertainment"}
|
901
982
|
account = getAccount.create(vars)
|
983
|
+
getAccount.count.should > 0
|
984
|
+
if $spec_settings[:sync_model]
|
985
|
+
records = getTestDB().select_from_table('changed_values','*', {'source_id' => getAccount().get_source_id(), "update_type"=>'delete'} )
|
986
|
+
records.length.should == 0
|
987
|
+
|
988
|
+
records = getTestDB().select_from_table('changed_values','*', {'source_id' => getAccount().get_source_id(), "update_type"=>'create'} )
|
989
|
+
records.length.should > 0
|
990
|
+
|
991
|
+
end
|
902
992
|
|
903
993
|
getAccount.delete_all
|
904
994
|
|
905
|
-
getAccount.
|
995
|
+
getAccount.count.should == 0
|
906
996
|
|
907
997
|
if $spec_settings[:sync_model]
|
908
|
-
records =
|
998
|
+
records = getTestDB().select_from_table('changed_values','*', {'source_id' => getAccount().get_source_id(), "update_type"=>'delete'} )
|
999
|
+
records.length.should > 0
|
1000
|
+
|
1001
|
+
records = getTestDB().select_from_table('changed_values','*', {'source_id' => getAccount().get_source_id(), "update_type"=>'create'} )
|
909
1002
|
records.length.should == 0
|
1003
|
+
|
910
1004
|
end
|
911
1005
|
end
|
912
1006
|
|
913
1007
|
it "should delete_all with conditions" do
|
914
1008
|
vars = {"name"=>"foobarthree", "industry"=>"entertainment"}
|
915
1009
|
account = getAccount.create(vars)
|
1010
|
+
@accts = getAccount.find(:all, :conditions => {'name' => 'Mobio India'})
|
1011
|
+
@accts.length.should > 0
|
1012
|
+
|
1013
|
+
if $spec_settings[:sync_model]
|
1014
|
+
records = getTestDB().select_from_table('changed_values','*', {'source_id' => getAccount().get_source_id(), "update_type"=>'delete'} )
|
1015
|
+
records.length.should == 0
|
1016
|
+
|
1017
|
+
records = getTestDB().select_from_table('changed_values','*', {'source_id' => getAccount().get_source_id(), "update_type"=>'create'} )
|
1018
|
+
records.length.should > 0
|
1019
|
+
|
1020
|
+
end
|
916
1021
|
|
917
1022
|
getAccount.delete_all(:conditions => {'name' => 'Mobio India'})
|
918
1023
|
|
919
1024
|
@accts = getAccount.find(:all, :conditions => {'name' => 'Mobio India'})
|
920
1025
|
@accts.length.should == 0
|
921
1026
|
|
922
|
-
if $spec_settings[:sync_model]
|
923
|
-
records =
|
1027
|
+
if $spec_settings[:sync_model]
|
1028
|
+
records = getTestDB().select_from_table('changed_values','*', {'source_id' => getAccount().get_source_id(), "update_type"=>'delete'} )
|
924
1029
|
records.length.should > 0
|
925
|
-
|
1030
|
+
|
1031
|
+
records = getTestDB().select_from_table('changed_values','*', {'source_id' => getAccount().get_source_id(), "update_type"=>'create'} )
|
1032
|
+
records.length.should > 0
|
1033
|
+
|
1034
|
+
end
|
926
1035
|
|
927
1036
|
end
|
928
1037
|
|
929
1038
|
it "should delete_all with conditions across objects" do
|
1039
|
+
@accts = getAccount.find(:all, :conditions => {'industry' => 'Technology'})
|
1040
|
+
@accts.length.should > 0
|
1041
|
+
|
1042
|
+
if $spec_settings[:sync_model]
|
1043
|
+
records = getTestDB().select_from_table('changed_values','*', {'source_id' => getAccount().get_source_id(), "update_type"=>'delete'} )
|
1044
|
+
records.length.should == 0
|
1045
|
+
end
|
1046
|
+
|
930
1047
|
getAccount.delete_all(:conditions => {'industry' => 'Technology'})
|
931
1048
|
|
932
1049
|
@accts = getAccount.find(:all, :conditions => {'industry' => 'Technology'})
|
@@ -935,15 +1052,186 @@ describe "Rhom::RhomObject" do
|
|
935
1052
|
@accts = getAccount.find(:all)
|
936
1053
|
|
937
1054
|
@accts.length.should == 0
|
1055
|
+
|
1056
|
+
if $spec_settings[:sync_model]
|
1057
|
+
records = getTestDB().select_from_table('changed_values','*', {'source_id' => getAccount().get_source_id(), "update_type"=>'delete'} )
|
1058
|
+
records.length.should > 0
|
1059
|
+
end
|
1060
|
+
|
938
1061
|
end
|
939
1062
|
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
1063
|
+
it "should delete_all not delete from other sources" do
|
1064
|
+
vars = {"name"=>"Aeroprise"}
|
1065
|
+
account = getCase().create(vars)
|
1066
|
+
|
1067
|
+
accts = getAccount.find(:all)
|
1068
|
+
accts.length.should > 0
|
1069
|
+
|
1070
|
+
test_cond = {'name' => 'Aeroprise'}
|
1071
|
+
|
1072
|
+
cases = getCase().find(:all, :conditions => test_cond)
|
1073
|
+
cases.length.should > 0
|
1074
|
+
|
1075
|
+
if $spec_settings[:sync_model]
|
1076
|
+
records = getTestDB().select_from_table('changed_values','*', {'source_id' => getAccount().get_source_id(), "update_type"=>'delete'} )
|
1077
|
+
records.length.should == 0
|
1078
|
+
|
1079
|
+
records = getTestDB().select_from_table('changed_values','*', {'source_id' => getCase().get_source_id(), "update_type"=>'create'} )
|
1080
|
+
records.length.should > 0
|
1081
|
+
end
|
1082
|
+
|
1083
|
+
getAccount.delete_all(:conditions => test_cond)
|
1084
|
+
|
1085
|
+
accts = getAccount.find(:all, :conditions => test_cond)
|
1086
|
+
accts.length.should == 0
|
1087
|
+
|
1088
|
+
cases = getCase().find(:all, :conditions => test_cond)
|
1089
|
+
cases.length.should > 0
|
1090
|
+
|
1091
|
+
accts = getAccount.find(:all)
|
1092
|
+
accts.length.should > 0
|
1093
|
+
|
1094
|
+
if $spec_settings[:sync_model]
|
1095
|
+
records = getTestDB().select_from_table('changed_values','*', {'source_id' => getAccount().get_source_id(), "update_type"=>'delete'} )
|
1096
|
+
records.length.should > 0
|
1097
|
+
|
1098
|
+
records = getTestDB().select_from_table('changed_values','*', {'source_id' => getCase().get_source_id(), "update_type"=>'create'} )
|
1099
|
+
records.length.should > 0
|
1100
|
+
end
|
1101
|
+
|
1102
|
+
end
|
1103
|
+
|
1104
|
+
it "should delete_all with multiple conditions" do
|
1105
|
+
vars = {"name"=>"Aeroprise", "website"=>"test.com"}
|
1106
|
+
account = getAccount.create(vars)
|
1107
|
+
|
1108
|
+
test_cond = {'name' => 'Aeroprise', 'website'=>'aeroprise.com'}
|
1109
|
+
accts = getAccount.find(:all, :conditions => test_cond)
|
1110
|
+
accts.length.should == 1
|
1111
|
+
|
1112
|
+
if $spec_settings[:sync_model]
|
1113
|
+
records = getTestDB().select_from_table('changed_values','*', {'source_id' => getAccount().get_source_id(), "update_type"=>'delete'} )
|
1114
|
+
records.length.should == 0
|
1115
|
+
|
1116
|
+
records = getTestDB().select_from_table('changed_values','*', {'source_id' => getAccount().get_source_id(), "update_type"=>'create'} )
|
1117
|
+
records.length.should > 0
|
1118
|
+
|
1119
|
+
end
|
1120
|
+
|
1121
|
+
getAccount.delete_all(:conditions => test_cond)
|
1122
|
+
|
1123
|
+
accts = getAccount.find(:all, :conditions => test_cond)
|
1124
|
+
accts.length.should == 0
|
1125
|
+
|
1126
|
+
accts = getAccount.find(:all, :conditions => vars)
|
1127
|
+
accts.length.should == 1
|
1128
|
+
|
1129
|
+
if $spec_settings[:sync_model]
|
1130
|
+
records = getTestDB().select_from_table('changed_values','*', {'source_id' => getAccount().get_source_id(), "update_type"=>'delete'} )
|
1131
|
+
records.length.should > 0
|
1132
|
+
|
1133
|
+
records = getTestDB().select_from_table('changed_values','*', {'source_id' => getAccount().get_source_id(), "update_type"=>'create'} )
|
1134
|
+
records.length.should == 1
|
1135
|
+
records[0]['attrib'].should == 'object'
|
1136
|
+
end
|
1137
|
+
|
1138
|
+
end
|
1139
|
+
|
1140
|
+
it "should delete_all with advanced conditions" do
|
1141
|
+
vars = {"name"=>"Aeroprise", "website"=>"test.com"}
|
1142
|
+
account = getAccount.create(vars)
|
1143
|
+
|
1144
|
+
test_cond = {{:func=>'UPPER', :name=>'name', :op=>'LIKE'} => 'AERO%',
|
1145
|
+
{:func=>'UPPER', :name=>'website', :op=>'LIKE'} => 'TEST%'}
|
1146
|
+
|
1147
|
+
accts = getAccount.find(:all, :conditions => test_cond, :op => 'OR')
|
1148
|
+
accts.length.should == 2
|
1149
|
+
|
1150
|
+
if $spec_settings[:sync_model]
|
1151
|
+
records = getTestDB().select_from_table('changed_values','*', {'source_id' => getAccount().get_source_id(), "update_type"=>'delete'} )
|
1152
|
+
records.length.should == 0
|
1153
|
+
|
1154
|
+
records = getTestDB().select_from_table('changed_values','*', {'source_id' => getAccount().get_source_id(), "update_type"=>'create'} )
|
1155
|
+
records.length.should > 0
|
1156
|
+
|
1157
|
+
end
|
1158
|
+
|
1159
|
+
getAccount.delete_all(:conditions => test_cond, :op => 'OR')
|
1160
|
+
|
1161
|
+
accts = getAccount.find(:all, :conditions => test_cond, :op => 'OR')
|
1162
|
+
accts.length.should == 0
|
1163
|
+
|
1164
|
+
accts = getAccount.find(:all, :conditions => vars)
|
1165
|
+
accts.length.should == 0
|
1166
|
+
|
1167
|
+
if $spec_settings[:sync_model]
|
1168
|
+
records = getTestDB().select_from_table('changed_values','*', {'source_id' => getAccount().get_source_id(), "update_type"=>'delete'} )
|
1169
|
+
records.length.should > 0
|
1170
|
+
|
1171
|
+
records = getTestDB().select_from_table('changed_values','*', {'source_id' => getAccount().get_source_id(), "update_type"=>'create'} )
|
1172
|
+
records.length.should == 0
|
1173
|
+
|
1174
|
+
end
|
1175
|
+
|
1176
|
+
end
|
1177
|
+
|
1178
|
+
it "should not find with advanced condition" do
|
1179
|
+
vars = {"name"=>"Aeroprise", "website"=>"testaa.com"}
|
1180
|
+
account = getAccount.create(vars)
|
1181
|
+
|
1182
|
+
test_cond = {{:func=>'UPPER', :name=>'name', :op=>'LIKE'} => 'AERO%',
|
1183
|
+
{:func=>'UPPER', :name=>'website', :op=>'LIKE'} => 'TEST'}
|
1184
|
+
|
1185
|
+
accts = getAccount.find(:all, :select => ['name', 'website'], :conditions => test_cond, :op => 'OR')
|
1186
|
+
accts.length.should > 0
|
1187
|
+
accts = getAccount.find(:all, :select => ['name', 'website'], :conditions => {{:func=>'UPPER', :name=>'website', :op=>'='} => 'TEST'} )
|
1188
|
+
accts.length.should == 0
|
1189
|
+
accts = getAccount.find(:all, :select => ['name', 'website'], :conditions => {{:func=>'UPPER', :name=>'website', :op=>'='} => 'XY'} )
|
1190
|
+
accts.length.should == 0
|
1191
|
+
accts = getAccount.find(:all, :select => ['name', 'website'], :conditions => {{:func=>'UPPER', :name=>'website', :op=>'='} => 'AMO'} )
|
1192
|
+
accts.length.should == 0
|
1193
|
+
accts = getAccount.find(:all, :select => ['name', 'website'], :conditions => {{:func=>'LOWER', :name=>'website', :op=>'='} => 'test'} )
|
1194
|
+
accts.length.should == 0
|
1195
|
+
accts = getAccount.find(:all, :select => ['name', 'website'], :conditions => {{:name=>'website', :op=>'LIKE'} => 'test'} )
|
1196
|
+
accts.length.should == 0
|
1197
|
+
accts = getAccount.find(:all, :select => ['name', 'website'], :conditions => {{:name=>'website', :op=>'LIKE'} => 'te'} )
|
1198
|
+
accts.length.should == 0
|
1199
|
+
accts = getAccount.find(:all, :select => ['name', 'website'], :conditions => {{:name=>'website', :op=>'LIKE'} => 'om'} )
|
1200
|
+
accts.length.should == 0
|
1201
|
+
accts = getAccount.find(:all, :select => ['name', 'website'], :conditions => {{:name=>'website', :op=>'LIKE'} => 'xy'} )
|
1202
|
+
accts.length.should == 0
|
1203
|
+
end
|
1204
|
+
|
1205
|
+
|
1206
|
+
it "should support blob type" do
|
1207
|
+
|
1208
|
+
#TODO: fix blob for schema models
|
1209
|
+
unless $spec_settings[:schema_model]
|
1210
|
+
file_name = File.join(Rho::RhoApplication::get_blob_folder, 'MyText123.txt')
|
1211
|
+
puts "file_name : #{file_name}"
|
1212
|
+
File.delete(file_name) if File.exists?(file_name)
|
1213
|
+
File.exists?(file_name).should == false
|
1214
|
+
|
1215
|
+
write_data = "this is blob test"
|
1216
|
+
f = File.new(file_name, "w")
|
1217
|
+
f.write(write_data)
|
1218
|
+
f.close
|
1219
|
+
|
1220
|
+
File.exists?(file_name).should == true
|
1221
|
+
blob_name = file_name[__rhoGetCurrentDir().length(), file_name.length()-__rhoGetCurrentDir().length()]
|
1222
|
+
puts "blob_name : #{blob_name}"
|
1223
|
+
|
1224
|
+
item = getAccount.create({'my_text'=>blob_name})
|
1225
|
+
item.my_text.should == blob_name
|
1226
|
+
File.exists?(file_name).should == true
|
1227
|
+
|
1228
|
+
item.destroy
|
1229
|
+
|
1230
|
+
item2 = getAccount.find(item.object)
|
1231
|
+
item2.should be_nil
|
1232
|
+
File.exists?(file_name).should == false
|
1233
|
+
end
|
1234
|
+
end
|
947
1235
|
|
948
1236
|
it "should include only selected column" do
|
949
1237
|
@accts = getAccount.find(:all, :select => ['name'], :order => 'name', :orderdir => 'DESC' )
|
@@ -986,44 +1274,64 @@ describe "Rhom::RhomObject" do
|
|
986
1274
|
@accts[0].name.should == "Aeroprise"
|
987
1275
|
@accts[0].industry.should == "Technology"
|
988
1276
|
end
|
1277
|
+
|
1278
|
+
it "should find with sql multiple conditions" do
|
1279
|
+
@acct = getAccount.find(:first, :conditions => [ "name = ? AND industry = ?", "'Mobio India'", "'Technology'" ], :select => ['name', 'industry'])
|
1280
|
+
@acct.name.should == "Mobio India"
|
1281
|
+
@acct.industry.should == "Technology"
|
1282
|
+
end
|
989
1283
|
|
990
1284
|
it "should support sql conditions arg" do
|
991
|
-
@accts = getAccount.find(:all, :conditions => "name = 'Mobio India'")
|
1285
|
+
@accts = getAccount.find(:all, :conditions => "name = 'Mobio India'", :select => ['name', 'industry'])
|
992
1286
|
@accts.length.should == 1
|
993
1287
|
@accts[0].name.should == "Mobio India"
|
994
1288
|
@accts[0].industry.should == "Technology"
|
995
1289
|
end
|
996
1290
|
|
997
1291
|
it "should support simple sql conditions" do
|
998
|
-
@accts = getAccount.find(:all, :conditions => ["name = ?", "'Mobio India'"])
|
1292
|
+
@accts = getAccount.find(:all, :conditions => ["name = ?", "'Mobio India'"], :select => ['name', 'industry'])
|
999
1293
|
@accts.length.should == 1
|
1000
1294
|
@accts[0].name.should == "Mobio India"
|
1001
1295
|
@accts[0].industry.should == "Technology"
|
1002
1296
|
end
|
1003
1297
|
|
1004
1298
|
it "should support complex sql conditions arg" do
|
1005
|
-
@accts = getAccount.find(:all, :conditions => "name like 'Mobio%'")
|
1299
|
+
@accts = getAccount.find(:all, :conditions => "name like 'Mobio%'", :select => ['name', 'industry'])
|
1006
1300
|
@accts.length.should == 1
|
1007
1301
|
@accts[0].name.should == "Mobio India"
|
1008
1302
|
@accts[0].industry.should == "Technology"
|
1009
1303
|
end
|
1010
1304
|
|
1011
1305
|
it "should support sql conditions single filter" do
|
1012
|
-
@accts = getAccount.find(:all, :conditions => ["name like ?", "'Mob%'"])
|
1306
|
+
@accts = getAccount.find(:all, :conditions => ["name like ?", "'Mob%'"], :select => ['name', 'industry'])
|
1013
1307
|
@accts.length.should == 1
|
1014
1308
|
@accts[0].name.should == "Mobio India"
|
1015
1309
|
@accts[0].industry.should == "Technology"
|
1016
1310
|
end
|
1017
1311
|
|
1018
1312
|
it "should support sql conditions with multiple filters" do
|
1019
|
-
@accts = getAccount.find(:all, :conditions => ["name like ? and industry like ?", "'Mob%'", "'Tech%'"])
|
1313
|
+
@accts = getAccount.find(:all, :conditions => ["name like ? and industry like ?", "'Mob%'", "'Tech%'"], :select => ['name', 'industry'])
|
1020
1314
|
@accts.length.should == 1
|
1021
1315
|
@accts[0].name.should == "Mobio India"
|
1022
1316
|
@accts[0].industry.should == "Technology"
|
1023
1317
|
end
|
1024
1318
|
|
1025
|
-
end
|
1026
1319
|
|
1320
|
+
it "should return records when order by is nil for some records" do
|
1321
|
+
return if USE_HSQLDB
|
1322
|
+
@accts = getAccount.find(:all, :order => 'shipping_address_country', :dont_ignore_missed_attribs => true, :select => ['name'])
|
1323
|
+
@accts.length.should == 2
|
1324
|
+
|
1325
|
+
if ( @accts[1].name == "Aeroprise" )
|
1326
|
+
@accts[1].name.should == "Aeroprise"
|
1327
|
+
else
|
1328
|
+
@accts[0].name.should == "Aeroprise"
|
1329
|
+
end
|
1330
|
+
end
|
1331
|
+
|
1332
|
+
#=end
|
1333
|
+
end
|
1334
|
+
#=begin
|
1027
1335
|
describe "Rhom#paginate" do
|
1028
1336
|
|
1029
1337
|
before(:all) do
|
@@ -1059,19 +1367,19 @@ describe "Rhom#paginate" do
|
|
1059
1367
|
{:object => '527579259', :name => 'test', :address => 'bcgi7t4e3e', :industry => 'ozjdrljgm2'}]
|
1060
1368
|
|
1061
1369
|
def get_expected
|
1062
|
-
if !
|
1370
|
+
if !USE_HSQLDB
|
1063
1371
|
return @expected_s if $spec_settings[:schema_model]
|
1064
1372
|
|
1065
1373
|
@expected
|
1066
1374
|
else
|
1067
1375
|
return @expected if $spec_settings[:schema_model]
|
1068
1376
|
|
1069
|
-
@
|
1377
|
+
@expected #_b
|
1070
1378
|
end
|
1071
1379
|
end
|
1072
1380
|
|
1073
1381
|
it "should support paginate with no options" do
|
1074
|
-
return if
|
1382
|
+
return if USE_HSQLDB and !$spec_settings[:schema_model]
|
1075
1383
|
|
1076
1384
|
3.times do |x|
|
1077
1385
|
@accts = getAccount.paginate(:page => x)
|
@@ -1133,3 +1441,4 @@ end
|
|
1133
1441
|
end
|
1134
1442
|
end
|
1135
1443
|
|
1444
|
+
#=end
|