rhoconnect 3.3.3 → 3.3.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 3.3.4 (2012-08-28)
2
+ * flush_zdata was not properly cleaning the related Redis storage (which led to incorrect CUD queue states)
3
+
1
4
  ## 3.3.3 (2012-08-21)
2
5
  * allow selective bulk_sync source parameter to be sent as a comma-separated string
3
6
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rhoconnect (3.3.3)
4
+ rhoconnect (3.3.4)
5
5
  bundler (~> 1.0)
6
6
  json (~> 1.6.0)
7
7
  rake (~> 0.9.2.2)
@@ -65,7 +65,7 @@ GEM
65
65
  cabin (~> 0.4.3)
66
66
  clamp (= 0.3.1)
67
67
  json (= 1.6.6)
68
- highline (1.6.13)
68
+ highline (1.6.14)
69
69
  hike (1.2.1)
70
70
  jasmine (1.2.1)
71
71
  jasmine-core (>= 1.2.0)
data/README.md CHANGED
@@ -2,13 +2,56 @@ RhoConnect App Integration Server
2
2
  -------------------------------------------------------------
3
3
  RhoConnect is an app integration server which keeps enterprise data current and available on users’ devices.
4
4
 
5
- Prerequisites
5
+ Development Prerequisites
6
6
  -------------------------------------------------------------
7
- You will need to install the Qt libraray <http://qt.nokia.com/downloads> in order to run the specs.
7
+ You will need to install the following in order to run the RhoConnect specs.
8
8
 
9
- More Info
9
+ * QT: <http://qt.nokia.com/downloads>
10
+ * RVM: <https://rvm.io/> or RB-env: <https://github.com/sstephenson/rbenv> with Ruby 1.9.3p194+ installed
11
+ * Bundler: <http://gembundler.com/>
12
+ * Redis: <http://redis.io>
13
+ * Java JDK 1.6+: <http://www.oracle.com/technetwork/java/javase/downloads/index.html>
14
+ * hsqldata.jar: <https://github.com/rhomobile/hsqldata/downloads> - put this in a directory called vendor/
15
+
16
+ Running Tests
17
+ -------------------------------------------------------------
18
+
19
+ * Install dependencies
20
+
21
+ ```
22
+ $ bundle install
23
+ ```
24
+
25
+ * Start redis (assumes it is installed in /usr/local/bin)
26
+
27
+ ```
28
+ $ rake redis:start
29
+ ```
30
+
31
+ * Run RhoConnect specs
32
+
33
+ ```
34
+ $ rake spec
35
+ ```
36
+
37
+ You will see a lot of output including backtraces as negative tests produce exceptions that print to stdout. This is normal. At the end you should see something like the following:
38
+
39
+ <pre>
40
+ Finished in 47.47 seconds
41
+ 543 examples, 0 failures
42
+ ...
43
+ Running Jasmine specs...
44
+ .........................................
45
+ PASS: 41 tests, 0 failures, 0.05 secs.
46
+ </pre>
47
+
48
+ If you have 0 failures, everything is good!
49
+
50
+ Test Layout
51
+ -------------------------------------------------------------
52
+ RhoConnect uses the [RSpec](https://www.relishapp.com/rspec/) framework to implement tests. All tests are located in the `spec/` directory. Tests use the following file naming convention: `classname_spec.rb` where `classname` is the class under test (i.e. `server_spec.rb` tests the `Server` class).
53
+
54
+ Resources
10
55
  -------------------------------------------------------------
11
- * Intro to Rhodes & RhoConnect: <http://docs.rhomobile.com>
12
- * RhoConnect: <http://docs.rhomobile.com/rhoconnect/introduction>
13
- * Tutorial: <http://docs.rhomobile.com/rhoconnect/tutorial>
14
- * RDoc (still rough): <http://rdoc.info/projects/rhomobile/rhoconnect>
56
+ * RhoConnect: <http://docs.rhomobile.com/rhoconnect/introduction>
57
+ * Tutorial: <http://docs.rhomobile.com/rhoconnect/tutorial>
@@ -364,12 +364,10 @@ module Rhoconnect
364
364
  current_score_data = Store.db.zrevrange(dockey,0,0,:with_scores => true)
365
365
  current_score = current_score_data[-1].to_i if current_score_data
366
366
  current_score += 1
367
- Store.db.pipelined do
368
- data.each do |key,hash_value|
369
- unique_record_key = setelement(current_score,assoc_key, key)
370
- Store.db.zadd(dockey, current_score, unique_record_key)
371
- Store.put_data(unique_record_key,{key => hash_value})
372
- end
367
+ data.each do |key,hash_value|
368
+ unique_record_key = setelement(current_score,assoc_key, key)
369
+ Store.db.zadd(dockey, current_score, unique_record_key)
370
+ Store.put_data("#{dockey}:#{unique_record_key}",{key => hash_value})
373
371
  end
374
372
  true
375
373
  end
@@ -382,7 +380,7 @@ module Rhoconnect
382
380
  unless data.nil?
383
381
  scores = []
384
382
  data.each do |zsetkey|
385
- obj_hash = Store.get_data zsetkey
383
+ obj_hash = Store.get_data "#{dockey}:#{zsetkey}"
386
384
  score,key,objkey = getelement(zsetkey)
387
385
  if scores[-1] != score
388
386
  ret << obj_hash
@@ -399,10 +397,8 @@ module Rhoconnect
399
397
  # Deletes all keys and their hashes from the Redis DB
400
398
  def flush_zdata(dockey)
401
399
  data = Store.db.zrange(dockey, 0, -1)
402
- Store.db.pipelined do
403
- data.each do |hash_key|
404
- Store.db.del(hash_key)
405
- end
400
+ data.each do |hash_key|
401
+ _delete_doc("#{dockey}:#{hash_key}")
406
402
  end
407
403
  Store.db.zremrangebyrank(dockey, 0, -1)
408
404
  end
@@ -1,3 +1,3 @@
1
1
  module Rhoconnect
2
- VERSION = '3.3.3'
2
+ VERSION = '3.3.4'
3
3
  end
data/spec/store_spec.rb CHANGED
@@ -237,6 +237,8 @@ describe "Store" do
237
237
  zdata,keys = Store.get_zdata('doc1')
238
238
  zdata.should == []
239
239
  keys.should == []
240
+ zdocs = Store.get_data('doc1:1:my_assoc_key:1')
241
+ zdocs.should == {}
240
242
  end
241
243
 
242
244
  if defined?(JRUBY_VERSION)