rhodes 3.3.3.beta.3 → 3.3.3.beta.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. data/Manifest.txt +16 -1
  2. data/Rakefile +77 -28
  3. data/doc/build.txt +5 -3
  4. data/doc/configuration.txt +13 -0
  5. data/doc/device-caps.txt +46 -27
  6. data/doc/rhom.txt +2 -2
  7. data/doc/test-log-debug.txt +6 -0
  8. data/doc/ui.txt +13 -0
  9. data/lib/build/jake.rb +11 -11
  10. data/lib/extensions/crypt/crypt/cbc.rb +5 -2
  11. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/Nfc.java +14 -4
  12. data/lib/framework/rho/render.rb +17 -4
  13. data/lib/framework/rho/rho.rb +1 -1
  14. data/lib/framework/rho/rhocontroller.rb +11 -1
  15. data/lib/framework/rhomotoapi.rb +110 -0
  16. data/platform/android/Rhodes/jni/Android.mk +2 -5
  17. data/platform/android/Rhodes/jni/include/rhodes/JNIRhodes.h +1 -0
  18. data/platform/android/Rhodes/jni/include/rhodes/fileapi.h +38 -0
  19. data/platform/android/Rhodes/jni/src/callbacks.cpp +7 -26
  20. data/platform/android/Rhodes/jni/src/extmanager.cpp +4 -1
  21. data/platform/android/Rhodes/jni/src/fileapi.cpp +38 -14
  22. data/platform/android/Rhodes/jni/src/mapview.cpp +1 -2
  23. data/platform/android/Rhodes/jni/src/rhodesapp.cpp +10 -0
  24. data/platform/android/Rhodes/jni/src/rhodessystem.cpp +1 -1
  25. data/platform/android/Rhodes/jni/src/signature.cpp +1 -4
  26. data/platform/android/Rhodes/rhobundle.xml +1 -1
  27. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +11 -1
  28. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivityListener.java +4 -3
  29. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +26 -6
  30. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +3 -1
  31. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/AbstractRhoExtension.java +70 -0
  32. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtData.java +3 -1
  33. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtManager.java +21 -7
  34. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtension.java +19 -10
  35. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtDataImpl.java +8 -5
  36. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManager.java +18 -0
  37. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerImpl.java +168 -31
  38. data/platform/android/Rhodes/src/com/rhomobile/rhodes/file/RhoFileApi.java +46 -9
  39. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +3 -2
  40. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/Signature.java +27 -53
  41. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/SignatureView.java +27 -3
  42. data/platform/android/Rhodes/src/com/rhomobile/rhodes/util/Utils.java +13 -14
  43. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebViewClient.java +12 -5
  44. data/platform/android/build/RhodesSRC_build.files +2 -1
  45. data/platform/android/build/android.rake +48 -17
  46. data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyAPI.java +1 -1
  47. data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +24 -3
  48. data/platform/iphone/Classes/AppManager/AppManager.m +1 -1
  49. data/platform/iphone/Classes/Camera/PickImageDelegate.m +27 -2
  50. data/platform/iphone/Classes/DateTimePickerDelegate.h +2 -0
  51. data/platform/iphone/Classes/DateTimePickerDelegate.m +85 -9
  52. data/platform/iphone/Classes/DateTimePickerViewController.h +21 -0
  53. data/platform/iphone/Classes/DateTimePickerViewController.m +75 -0
  54. data/platform/iphone/Classes/GeoLocation/LocationController.h +6 -2
  55. data/platform/iphone/Classes/GeoLocation/LocationController.m +54 -14
  56. data/platform/iphone/Classes/RhoMainView.h +2 -0
  57. data/platform/iphone/Classes/Rhodes.m +11 -5
  58. data/platform/iphone/Classes/Signature/SignatureDelegate.m +13 -12
  59. data/platform/iphone/Classes/Signature/SignatureViewController.m +2 -1
  60. data/platform/iphone/Classes/SimpleMainView.m +3 -0
  61. data/platform/iphone/Classes/SplitView/SplittedMainView.m +3 -0
  62. data/platform/iphone/Classes/TabbedMainView.m +30 -11
  63. data/platform/iphone/rbuild/iphone.rake +7 -1
  64. data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +6 -0
  65. data/platform/shared/RhoConnectClient/RhoConnectClient.cpp +1 -1
  66. data/platform/shared/common/BundleManager.cpp +42 -2
  67. data/platform/shared/common/ExtManager.h +7 -0
  68. data/platform/shared/common/RhoFile.cpp +170 -2
  69. data/platform/shared/common/RhoFile.h +4 -0
  70. data/platform/shared/common/RhodesApp.cpp +30 -0
  71. data/platform/shared/common/RhodesApp.h +1 -0
  72. data/platform/shared/common/map/OSMMapEngine.cpp +11 -3
  73. data/platform/shared/common/map/OSMMapEngine.h +3 -0
  74. data/platform/shared/logging/RhoLogConf.cpp +8 -9
  75. data/platform/shared/logging/RhoLogConf.h +5 -7
  76. data/platform/shared/logging/RhoLogSink.cpp +3 -3
  77. data/platform/shared/logging/RhoLogSink.h +1 -1
  78. data/platform/shared/net/HttpServer.cpp +17 -9
  79. data/platform/shared/qt/rhodes/main.cpp +1 -1
  80. data/platform/shared/ruby/ext/rho/rhoruby.c +4 -0
  81. data/platform/shared/ruby/ext/webview/webview.i +9 -4
  82. data/platform/shared/ruby/ext/webview/webview_wrap.c +2 -2
  83. data/platform/shared/test/Tests.cpp +2 -2
  84. data/platform/wm/build/build_inf.js +75 -47
  85. data/platform/wm/build/wm.rake +50 -53
  86. data/platform/wm/rhodes/Rhodes.cpp +40 -97
  87. data/platform/wm/rhodes/rho/common/ExtManager.cpp +23 -1
  88. data/platform/wm/rhodes/rho/rubyext/WebView.cpp +9 -0
  89. data/platform/wm/tools/detool/detool.cpp +103 -52
  90. data/platform/wp7/RhoRubyExtGen/RhoDateTimePicker.cs +60 -0
  91. data/platform/wp7/RhoRubyExtGen/RhoRubyExtGen.csproj +1 -0
  92. data/platform/wp7/RhoRubyExtGen/RhoWebView.cs +4 -4
  93. data/platform/wp7/RhoRubyLib/Initializers.Generated.cs +15 -1
  94. data/platform/wp7/RhoRubyLib/RhoRubyLib.csproj +12 -2
  95. data/platform/wp7/RhoRubyLib/WP_PlatformAdaptationLayer.cs +2 -0
  96. data/platform/wp7/RhoRubyLib/common/RhoFile.cs +3 -3
  97. data/platform/wp7/RhoRubyLib/common/RhoFilePath.cs +2 -2
  98. data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +39 -24
  99. data/platform/wp7/RhoRubyLib/json/RJSONTokener.cs +8 -1
  100. data/platform/wp7/RhoRubyLib/logging/RhoLogServerSink.cs +3 -3
  101. data/platform/wp7/RhoRubyLib/logging/RhoLogger.cs +1 -1
  102. data/platform/wp7/RhoRubyLib/net/HttpServer.cs +22 -15
  103. data/platform/wp7/RhoRubyLib/net/NetRequest.cs +1 -1
  104. data/platform/wp7/RhoRubyLib/rubyext/RhoDateTimePicker.cs +237 -0
  105. data/platform/wp7/RhoRubyLib/rubyext/RhoWebView.cs +5 -5
  106. data/platform/wp7/RhoRubyLib/views/RhoDateTimeDlg.xaml +37 -0
  107. data/platform/wp7/RhoRubyLib/views/RhoDateTimeDlg.xaml.cs +59 -0
  108. data/platform/wp7/RhoRubyLib/views/RhoView.xaml.cs +34 -41
  109. data/platform/wp7/rhodes/App.xaml.cs +1 -0
  110. data/platform/wp7/rhodes/Properties/WMAppManifest.xml +18 -18
  111. data/platform/wp7/rhodes/Rhodes.csproj +5 -1
  112. data/platform/wp7/rhodes/Toolkit.Content/ApplicationBar.Cancel.png +0 -0
  113. data/platform/wp7/rhodes/Toolkit.Content/ApplicationBar.Check.png +0 -0
  114. data/rakefile.rb +77 -28
  115. data/res/build-tools/Microsoft.Phone.Controls.Toolkit.dll +0 -0
  116. data/res/build-tools/YUICompressorLicense.txt +54 -0
  117. data/res/build-tools/detool.exe +0 -0
  118. data/res/build-tools/yuicompressor-2.4.7.jar +0 -0
  119. data/res/generators/templates/application/app/layout.erb +1 -0
  120. data/res/generators/templates/application/public/js/jquery-wp7-patch.js +8 -2
  121. data/res/generators/templates/application/public/js/syncengine.js +147 -0
  122. data/spec/phone_spec/app/Data/septest.json +1 -1
  123. data/spec/phone_spec/app/spec/asynchttp_spec.rb +11 -10
  124. data/spec/phone_spec/app/spec/blobsync_spec.rb +9 -34
  125. data/spec/phone_spec/app/spec/date_spec.rb +6 -6
  126. data/spec/phone_spec/app/spec/rho_spec.rb +1 -6
  127. data/spec/phone_spec/app/spec/rhofile_spec.rb +13 -7
  128. data/spec/phone_spec/app/spec/rhom_object_spec.rb +4 -3
  129. data/spec/phone_spec/app/spec/syncengine_spec.rb +12 -14
  130. data/spec/phone_spec/app/spec_runner.rb +9 -10
  131. data/version +1 -1
  132. metadata +20 -5
  133. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerSingleton.java +0 -15
@@ -1 +1 @@
1
- {"Manufacturer List" : [{"manufacturer" : ""},{"manufacturer" : "\u00a9 Funky Monkey Snacks"},{"manufacturer" : "www.tmebeer.com"}];"Category List" : [{"id" : "189","name" : "Crackers"},{"id" : "190","name" : "Fruit & Vegetable Juices"}]};
1
+ {"Manufacturer List" : [{"manufacturer" : ""},{"manufacturer" : "\u00a9 Funky Monkey Snacks"},{"manufacturer" : "www.tmebeer.com"}],"Category List" : [{"id" : "189","name" : "Crackers"},{"id" : "190","name" : "Fruit & Vegetable Juices"}]};
@@ -35,7 +35,7 @@ describe "AsyncHttp" do
35
35
 
36
36
  #TODO: post_test
37
37
  end
38
-
38
+ if !defined?(RHO_WP7)
39
39
  it "should http download" do
40
40
 
41
41
  file_name = File.join(Rho::RhoApplication::get_base_app_path(), 'test.jpg')
@@ -43,12 +43,12 @@ describe "AsyncHttp" do
43
43
  File.exists?(file_name).should == false
44
44
 
45
45
  res = Rho::AsyncHttp.download_file(
46
- :url => 'http://rhomobile.com/wp-content/themes/rhomobile/img/imgs_21.jpg',
46
+ :url => 'http://www.rhomobile.com/wp-content/themes/rhomobile_theme/images/misc/ruby_app.jpg',
47
47
  :filename => file_name )
48
- #puts "res : #{res}"
48
+ puts "res : #{res}"
49
49
 
50
50
  res['status'].should == 'ok'
51
- res['headers']['content-length'].to_i.should == 8945
51
+ res['headers']['content-length'].to_i.should == 14451
52
52
  res['headers']['content-type'].should == 'image/jpeg'
53
53
 
54
54
  File.exists?(file_name).should == true
@@ -57,12 +57,13 @@ describe "AsyncHttp" do
57
57
 
58
58
  #check that in case of one more download, files keeps the same
59
59
  res = Rho::AsyncHttp.download_file(
60
- :url => 'http://rhomobile.com/wp-content/themes/rhomobile/img/imgs_21.jpg',
60
+ :url => 'http://www.rhomobile.com/wp-content/themes/rhomobile_theme/images/misc/ruby_app.jpg',
61
61
  :filename => file_name )
62
- #puts "res : #{res}"
62
+ puts "res : #{res}"
63
63
 
64
64
  res['status'].should == 'ok'
65
- res['headers']['content-length'].to_i.should == 0
65
+ res['headers']['content-length'].to_i.should == 12554
66
+ res['http_error'].should == '206'
66
67
  #res['headers']['content-type'].should == 'image/jpeg'
67
68
 
68
69
  File.exists?(file_name).should == true
@@ -70,16 +71,16 @@ describe "AsyncHttp" do
70
71
 
71
72
  #check that in case of network error, files keeps the same
72
73
  res = Rho::AsyncHttp.download_file(
73
- :url => 'http://rhomobile.com/wp-content/themes/rhomobile/img/imgs_21__BAD.jpg',
74
+ :url => 'http://www.rhomobile.com/wp-content/themes/rhomobile_theme/images/misc/ruby_app_BAD.jpg',
74
75
  :filename => file_name )
75
- #puts "res : #{res}"
76
+ puts "res : #{res}"
76
77
  res['status'].should == 'error'
77
78
  res['http_error'].should == '404'
78
79
 
79
80
  File.exists?(file_name).should == true
80
81
  File.size(file_name).should == orig_len
81
82
  end
82
-
83
+ end
83
84
  it "should http upload" do
84
85
 
85
86
  server = 'http://rhologs.heroku.com'
@@ -55,56 +55,30 @@ describe "BlobSync_test" do
55
55
  Rho::RhoConfig.bulksync_state='1'
56
56
  end
57
57
 
58
- it "should sync BlobTest" do
59
- SyncEngine.logged_in.should == 1
60
-
61
- res = ::Rho::RhoSupport::parse_query_parameters getBlobTest.sync( "/app/Settings/sync_notify")
62
- res['status'].should == 'ok'
63
- res['error_code'].to_i.should == ::Rho::RhoError::ERR_NONE
64
- end
65
-
66
- it "should delete all Test Blobs" do
67
- SyncEngine.logged_in.should == 1
68
-
69
- items = getBlobTest.find(:all ) #, :conditions => {:name => 'BlobTestItem'})
70
- items.should_not == nil
71
-
72
- items.each do |item|
73
- file_name = File.join(Rho::RhoApplication::get_blob_path(item.image_uri))
74
- File.exists?(file_name).should == true
75
- item.destroy
76
- File.exists?(file_name).should == false
77
- end
78
58
 
79
- getBlobTest.sync( "/app/Settings/sync_notify")
80
- sleep(2) #wait till sync server update data
81
-
82
- res = ::Rho::RhoSupport::parse_query_parameters getBlobTest.sync( "/app/Settings/sync_notify")
83
- res['status'].should == 'ok'
84
- res['error_code'].to_i.should == ::Rho::RhoError::ERR_NONE
85
-
86
- item2 = getBlobTest.find(:first ) #, :conditions => {:name => 'BlobTestItem'})
87
- item2.should == nil
88
- end
89
59
 
90
60
  def copy_file(src, dst_dir)
61
+ if !defined?(RHO_WP7)
91
62
  content = File.binread(src)
63
+ else
64
+ content = File.read(src)
65
+ end
92
66
  File.open(File.join( dst_dir, File.basename(src) ), "wb"){|f| f.write(content) }
93
67
  end
94
68
 
95
- if !defined?(RHO_WP7)
96
69
  it "should create new BlobTest" do
97
70
  SyncEngine.logged_in.should == 1
98
71
 
99
72
  file_name = File.join(Rho::RhoApplication::get_model_path('app',getBlobTest_str()), 'test.png')
100
73
  copy_file(file_name, Rho::RhoApplication::get_blob_folder() )
101
74
  file_name = File.join(Rho::RhoApplication::get_blob_folder(), 'test.png')
102
-
75
+ if !defined?(RHO_WP7)
103
76
  file_size = File.size(file_name)
77
+ end
104
78
  file_content = File.read(file_name)
105
79
 
106
80
  item = getBlobTest.new
107
- #item.name = 'BlobTestItem'
81
+ item.name = 'BlobTestItem'
108
82
  item.image_uri = file_name
109
83
  item.save
110
84
  getBlobTest.sync( "/app/Settings/sync_notify")
@@ -120,7 +94,9 @@ describe "BlobSync_test" do
120
94
 
121
95
  items[0].image_uri.should_not == file_name
122
96
  new_file_name = File.join(Rho::RhoApplication::get_blob_path(items[0].image_uri))
97
+ if !defined?(RHO_WP7)
123
98
  File.size(new_file_name).should == file_size
99
+ end
124
100
  content_new = File.read(new_file_name)
125
101
  content_new.should == file_content
126
102
 
@@ -162,7 +138,6 @@ describe "BlobSync_test" do
162
138
  # content_new.should == file_content
163
139
 
164
140
  end
165
- end
166
141
 
167
142
  it "should logout" do
168
143
  SyncEngine.logout()
@@ -58,7 +58,6 @@ if !defined? RHO_ME
58
58
  end
59
59
  end
60
60
 
61
- if !defined?(RHO_WP7)
62
61
  it "should support operations with dates" do
63
62
  to_day = Date.civil(2010, 3, 21)
64
63
  to_day2 = Date.civil(2011, 3, 21)
@@ -68,11 +67,13 @@ if !defined?(RHO_WP7)
68
67
  puts "res : #{res.day}"
69
68
 
70
69
  res = to_day2-to_day
71
-
72
- if !defined? RHO_ME
73
- res.to_s.should == "365/1"
70
+
71
+ if defined? RHO_ME
72
+ res.to_s.should == "365"
73
+ elsif defined?(RHO_WP7)
74
+ res.to_s.should == "365"
74
75
  else
75
- res.to_s.should == "365"
76
+ res.to_s.should == "365/1"
76
77
  end
77
78
 
78
79
  puts "res : #{res}"
@@ -82,6 +83,5 @@ end
82
83
  puts "res : #{res.day}"
83
84
 
84
85
  end
85
- end
86
86
 
87
87
  end
@@ -39,14 +39,12 @@ describe "RhoConfig" do
39
39
  Rho::RhoConfig.options_path = '/app/Settings'
40
40
  end
41
41
 
42
- if !defined?(RHO_WP7)
43
42
  it "should populate configuration in sources table" do
44
43
  sources = ::Rho::RHO.get_user_db().select_from_table('sources','*')
45
44
  sources.size.should == 0
46
45
 
47
46
  Rho::RhoConfig.sources().size.should > 0
48
47
  end
49
- end
50
48
 
51
49
  it "should have start_path" do
52
50
  Rho::RhoConfig.start_path.should == '/app'
@@ -117,7 +115,6 @@ describe "RhoError" do
117
115
 
118
116
  end
119
117
 
120
- if !defined?(RHO_WP7)
121
118
  describe "RhomSource" do
122
119
 
123
120
  it "should find first source" do
@@ -154,7 +151,6 @@ describe "RhomSource" do
154
151
  end
155
152
 
156
153
  end
157
- end
158
154
 
159
155
  describe "RhoRuby" do
160
156
 
@@ -175,7 +171,6 @@ describe "RhoRuby" do
175
171
  val[10].should == '9'
176
172
  =end
177
173
  end
178
-
179
174
  if !defined?(RHO_WP7)
180
175
  it "should support encoding" do
181
176
  "Utf8 String".force_encoding( Encoding::UTF_8 )
@@ -321,7 +316,7 @@ if !defined?(RHO_WP7)
321
316
  res = (1..6).group_by {|i| i%3}
322
317
  res.should == {0=>[3, 6], 1=>[1, 4], 2=>[2, 5]}
323
318
  end
324
- end
319
+ end
325
320
 
326
321
  it "should split with regex" do
327
322
  str = "http://www.abc.com/abc/servlet/SearchServlet?act=viewDetail&LanguageCountry=en_US&searchLang=en_US&caseLang=en_US&orgPrefix=NCMC&caseNum=1234567&seqNum=1"
@@ -2,7 +2,6 @@ describe "RhoFile" do
2
2
 
3
3
  before(:all) do
4
4
  clear()
5
-
6
5
  dir_name = Rho::RhoApplication::get_app_path('DataTemp')
7
6
  Dir.mkdir(dir_name) unless Dir.exists?(dir_name)
8
7
  end
@@ -32,7 +31,7 @@ describe "RhoFile" do
32
31
  content.should == write_data1 + write_data2
33
32
 
34
33
  end
35
-
34
+ if !defined?(RHO_WP7)
36
35
  it "should binary read/write" do
37
36
  file_testname = File.join(Rho::RhoApplication::get_model_path('app', 'Data'), 'test.png')
38
37
  test_content = File.binread(file_testname)
@@ -49,17 +48,20 @@ describe "RhoFile" do
49
48
  content = File.binread(file_name)
50
49
  content.should == test_content
51
50
  end
52
-
51
+ end
53
52
  def create_file_in_cache(dir_name, file, ext)
54
53
  # get full file path
55
54
  f = File.join(dir_name, "#{file}"+ "#{ext}")
56
55
  #check if file exists and return to fileName action if yes.
57
56
  return "exist" if File.exists?(f)
58
-
57
+
58
+ dd = 0
59
+ if !defined?(RHO_WP7)
59
60
  # if no, get number of files in saving location. call delete action if equals 14
60
61
  files = Dir.entries(dir_name)
61
62
  #puts "files: #{files}"
62
63
  dd = files.size - 2 #skip . and ..
64
+ end
63
65
  if dd == 2
64
66
  return "limit"
65
67
  else
@@ -85,9 +87,10 @@ describe "RhoFile" do
85
87
 
86
88
  res = create_file_in_cache(dir_name, "cache_test", "1")
87
89
  res.should == "exist"
88
-
90
+ if !defined?(RHO_WP7)
89
91
  res = create_file_in_cache(dir_name, "cache_test", "3")
90
92
  res.should == "limit"
93
+ end
91
94
 
92
95
  end
93
96
 
@@ -101,12 +104,14 @@ describe "RhoFile" do
101
104
  File.exist?(nil)
102
105
  rescue Exception => e
103
106
  bExc = e.is_a?(TypeError)
104
- end
107
+ end
105
108
 
106
- bExc.should == true
109
+ bExc.should == true
110
+
107
111
  File.exist?("").should == false
108
112
  end
109
113
 
114
+ if !defined?(RHO_WP7)
110
115
  it "should readnonexistfile" do
111
116
  file_name = Rho::RhoFSConnector::get_app_path('app') + 'lang/lang_345'
112
117
  File.exist?(file_name).should == false
@@ -123,6 +128,7 @@ describe "RhoFile" do
123
128
  bExc.should == true
124
129
  end
125
130
  end
131
+ end
126
132
 
127
133
  def clear
128
134
  (1..2).each do |n|
@@ -1603,7 +1603,7 @@ end
1603
1603
 
1604
1604
  end
1605
1605
  #=end
1606
-
1606
+ if !defined?(RHO_WP7)
1607
1607
  it "should not add property to freezed model" do
1608
1608
 
1609
1609
  if !$spec_settings[:schema_model]
@@ -1614,7 +1614,7 @@ end
1614
1614
  #props['property'].should_not be_nil
1615
1615
  #props['property']['description'].should_not be_nil
1616
1616
  end
1617
-
1617
+
1618
1618
  lambda { obj = getCase().new( :wrong_address => 'test') }.should raise_error(ArgumentError)
1619
1619
  lambda { obj = getCase().create( :wrong_address => 'test') }.should raise_error(ArgumentError)
1620
1620
 
@@ -1635,7 +1635,8 @@ end
1635
1635
  end
1636
1636
 
1637
1637
  end
1638
-
1638
+ end
1639
+
1639
1640
  it "should add property to freezed model" do
1640
1641
  if !$spec_settings[:schema_model]
1641
1642
  props = Rho::RhoConfig.sources()[getCase_str()]
@@ -59,11 +59,9 @@ def syncserver_url
59
59
  when /apple/i then 'iphone'
60
60
  when /symbian/i then 'symbian'
61
61
  when /wp7/i then 'wp'
62
- when /windows/i then 'wm'
63
62
  end
64
63
  platform = 'win32' if System.get_property('device_name') == 'Win32'
65
64
 
66
- puts "platform: #{platform}"
67
65
  exact_url = SYNC_SERVER_URL.gsub(/exact_platform/, platform)
68
66
  puts "going to reset server: #{exact_url}"
69
67
  exact_url
@@ -103,19 +101,19 @@ describe "SyncEngine_test" do
103
101
  Rho::RhoConfig.bulksync_state='1'
104
102
 
105
103
  end
106
-
104
+
107
105
  if !defined?(RHO_WP7)
108
106
  it "should database_full_reset_ex raise an exception" do
109
107
  exc = false
110
108
  begin
111
- Rhom::Rhom.database_full_reset_ex( :models => [getProduct_str], :reset_client_info => true )
109
+ Rhom::Rhom.database_full_reset_ex( :models => [getProduct_str], :reset_client_info => true )
112
110
  rescue => e
113
111
  exc = true
114
112
  end
115
113
 
116
114
  exc.should be_true
117
115
  end
118
- end
116
+ end
119
117
 
120
118
  it "should database_full_reset_ex support different parameters" do
121
119
  Rhom::Rhom.database_full_reset_ex()
@@ -260,7 +258,7 @@ end
260
258
  res['status'].should == 'complete'
261
259
  res['error_code'].to_i.should == ::Rho::RhoError::ERR_NONE
262
260
  end
263
-
261
+
264
262
  it "should sync all" do
265
263
  SyncEngine.logged_in.should == 1
266
264
 
@@ -863,7 +861,7 @@ end
863
861
  item2 = getProduct.find(item.object)
864
862
  item2.vars.should_not be_nil
865
863
  end
866
-
864
+
867
865
  it "should not sync non-exist properties from freezed model" do
868
866
  SyncEngine.logged_in.should == 1
869
867
 
@@ -874,7 +872,7 @@ end
874
872
  cust = getCustomer().find(:first, :conditions => {:first => 'CustTest2'} )
875
873
  cust.should_not be_nil
876
874
 
877
- Rhom::Rhom.database_full_reset
875
+ Rhom::Rhom.database_full_reset
878
876
  Rho::RhoConfig.bulksync_state='1'
879
877
 
880
878
  cust1 = getCustomer().find(:first)
@@ -882,11 +880,11 @@ end
882
880
 
883
881
  saved_src = Rho::RhoConfig.sources[getCustomer_str()]
884
882
  begin
885
- if !$spec_settings[:schema_model]
883
+ if !$spec_settings[:schema_model]
886
884
  Rho::RhoConfig.sources[getCustomer_str()]['freezed'] = true
887
885
  else
888
- Rho::RhoConfig.sources[getCustomer_str()]['schema']['property'].delete('first')
889
- end
886
+ Rho::RhoConfig.sources[getCustomer_str()]['schema']['property'].delete('first')
887
+ end
890
888
  ::Rho::RHO.init_sync_source_properties(Rho::RhoConfig::sources.values)
891
889
 
892
890
  res2 = ::Rho::RhoSupport::parse_query_parameters getCustomer.sync( "/app/Settings/sync_notify")
@@ -899,11 +897,11 @@ end
899
897
 
900
898
  cust2 = getCustomer().find(:first, :conditions => {:first => 'CustTest2'} )
901
899
  cust2.should be_nil
902
- ensure
900
+ ensure
903
901
  Rho::RhoConfig.sources[getCustomer_str()] = saved_src
904
- end
902
+ end
905
903
  end
906
-
904
+
907
905
  it "should logout" do
908
906
  SyncEngine.logout()
909
907
 
@@ -15,17 +15,15 @@ class SpecRunner < MSpecScript
15
15
  config[:files] << "spec/array/pack_spec"
16
16
 
17
17
  config[:files] << "spec/rho_spec"
18
-
19
-
18
+
20
19
  if !defined?(RHO_WP7)
21
20
  config[:files] << "spec/crypt_spec"
22
- config[:files] << "spec/json_spec"
23
- config[:files] << "spec/xml_spec"
24
- config[:files] << "spec/rhofile_spec"
25
-
26
- config[:files] << "spec/asynchttp_spec"
27
21
  end
28
22
 
23
+ config[:files] << "spec/json_spec"
24
+ config[:files] << "spec/xml_spec"
25
+ config[:files] << "spec/rhofile_spec"
26
+ config[:files] << "spec/asynchttp_spec"
29
27
  config[:files] << "spec/date_spec"
30
28
  config[:files] << "spec/bsearch_spec"
31
29
 
@@ -34,7 +32,7 @@ end
34
32
  config[:files] << [ "spec/rhom_object_spec",
35
33
  [ {:schema_model=>true, :sync_model=>true}, {:schema_model=>true, :sync_model=>false},
36
34
  {:schema_model=>false, :sync_model=>true} , {:schema_model=>false, :sync_model=>false} ] ]
37
-
35
+
38
36
  if !defined?(RHO_WP7)
39
37
  config[:files] << "spec/contacts_spec" unless System.get_property('device_name') == 'Win32'
40
38
 
@@ -44,13 +42,14 @@ if !defined?(RHO_WP7)
44
42
  config[:files] << "spec/barcode_spec" unless System.get_property('platform') == 'WINDOWS'
45
43
  config[:files] << "spec/mapview_spec" unless System.get_property('platform') == 'WINDOWS'
46
44
  end
45
+
47
46
  config[:files] << "spec/nativebar_spec" if System.get_property('platform') != 'Blackberry'
48
47
  config[:files] << "spec/navbar_spec" if System.get_property('platform') == 'APPLE' || System.get_property('platform') == 'ANDROID'
49
48
 
50
49
  config[:files] << "spec/xruby_spec" if defined? RHO_ME
51
50
 
52
- config[:files] << [ "spec/syncengine_spec", [ {:schema_model=>true }, {:schema_model=>false } ] ]
53
- config[:files] << [ "spec/blobsync_spec", [ {:schema_model=>true }, {:schema_model=>false } ] ]
51
+ config[:files] << [ "spec/syncengine_spec", [ {:schema_model=>true }, {:schema_model=>false } ] ]
52
+ config[:files] << [ "spec/blobsync_spec", [ {:schema_model=>true }, {:schema_model=>false } ] ]
54
53
 
55
54
  if !defined?(RHO_WP7)
56
55
  config[:files] << "spec/bulksync_spec"