hutch-xamplr 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.txt +13 -0
- data/VERSION.yml +1 -1
- data/examples/random-people/people.rb +2 -2
- data/examples/random-people/query.rb +16 -11
- data/examples/random-people-shared-addresses/Makefile +16 -0
- data/examples/random-people-shared-addresses/batch-load-users.rb +86 -0
- data/examples/random-people-shared-addresses/find-mentions.rb +50 -0
- data/examples/random-people-shared-addresses/find-people-by-address.rb +110 -0
- data/examples/random-people-shared-addresses/optimise.rb +19 -0
- data/examples/random-people-shared-addresses/people.rb +50 -0
- data/examples/random-people-shared-addresses/query.rb +78 -0
- data/examples/random-people-shared-addresses/query2.rb +76 -0
- data/examples/random-people-shared-addresses/random-names.csv +10000 -0
- data/examples/random-people-shared-addresses/what-to-query-on.rb +82 -0
- data/examples/random-people-shared-addresses/xampl-gen.rb +36 -0
- data/examples/random-people-shared-addresses/xml/people.xml +14 -0
- data/lib/xamplr/TODO +1 -3
- data/lib/xamplr/{persister → obsolete}/fsdb.rb +0 -0
- data/lib/xamplr/persistence.rb +7 -3
- data/lib/xamplr/persister/tokyo-cabinet.rb +70 -7
- data/lib/xamplr/templates/element_data.template +29 -21
- data/lib/xamplr/templates/element_empty.template +29 -22
- data/lib/xamplr/templates/element_mixed.template +31 -24
- data/lib/xamplr/templates/element_simple.template +29 -22
- data/lib/xamplr/{Makefile → test-support/Makefile} +0 -0
- data/lib/xamplr/{bench-cache.rb → test-support/bench-cache.rb} +1 -1
- data/lib/xamplr/{bench-script.rb → test-support/bench-script.rb} +0 -0
- data/lib/xamplr/{bench.rb → test-support/bench.rb} +0 -0
- data/lib/xamplr/{bench2.rb → test-support/bench2.rb} +9 -9
- data/lib/xamplr/{test-cache.rb → test-support/test-cache.rb} +0 -0
- data/lib/xamplr/{test-data → test-support/test-data}/binding.xml +0 -0
- data/lib/xamplr/{test-data → test-support/test-data}/example.xml +0 -0
- data/lib/xamplr/{test-data → test-support/test-data}/internationalization-utf8.txt +0 -0
- data/lib/xamplr/{test-data → test-support/test-data}/labels.xml +0 -0
- data/lib/xamplr/{test-data → test-support/test-data}/labels001.xml +0 -0
- data/lib/xamplr/{test-deep-change.rb → test-support/test-deep-change.rb} +0 -0
- data/lib/xamplr/{test-elements.rb → test-support/test-elements.rb} +0 -0
- data/lib/xamplr/{test-indexed-array.rb → test-support/test-indexed-array.rb} +0 -0
- data/lib/xamplr/{test-misc.rb → test-support/test-misc.rb} +0 -0
- data/lib/xamplr/{test-names.rb → test-support/test-names.rb} +0 -0
- data/lib/xamplr/{test-rollback.rb → test-support/test-rollback.rb} +0 -0
- data/lib/xamplr/{test.rb → test-support/test.rb} +74 -74
- data/lib/xamplr/to-ruby.rb +19 -15
- data/lib/xamplr/to-xml.rb +5 -4
- data/lib/xamplr/visitor.rb +6 -2
- data/lib/xamplr/xampl-object.rb +4 -9
- metadata +43 -25
- data/lib/xamplr/BUGS +0 -3
- data/lib/xamplr/CHANGES +0 -16
- data/lib/xamplr/REQUIREMENTS +0 -2
- data/lib/xamplr/sqlite/sqlite-play.rb +0 -14
@@ -4,7 +4,7 @@
|
|
4
4
|
|if @element.persisted then
|
5
5
|
|
|
6
6
|
include Xampl::XamplPersistedObject
|
7
|
-
|
7
|
+
|
8
8
|
@@default_persister_format = nil
|
9
9
|
|
10
10
|
def default_persister_format
|
@@ -17,6 +17,13 @@
|
|
17
17
|
@@default_persister_format = format
|
18
18
|
end
|
19
19
|
|
20
|
+
def #{@element.class_name}.find_by_query
|
21
|
+
things = Xampl.find_xampl do | q |
|
22
|
+
q.add_condition('class', :equals, self.name)
|
23
|
+
yield(q)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
20
27
|
|
|
21
28
|
|else
|
22
29
|
|
|
@@ -25,7 +32,7 @@
|
|
25
32
|
|end
|
26
33
|
|
|
27
34
|
include Xampl::XamplWithMixedContent
|
28
|
-
|
35
|
+
|
29
36
|
@@tag = "#{@element.name}"
|
30
37
|
@@ns = "#{@element.namespace}"
|
31
38
|
@@ns_tag = "{#{@element.namespace}}#{@element.name}"
|
@@ -59,7 +66,7 @@
|
|
59
66
|
|
|
60
67
|
|
61
68
|
@@to_yaml_properties = [ "@#{@element.indexed_by_attr}" ]
|
62
|
-
@@to_yaml_properties_all = [
|
69
|
+
@@to_yaml_properties_all = [
|
63
70
|
|
64
71
|
|
|
65
72
|
|else
|
@@ -68,7 +75,7 @@
|
|
68
75
|
@@to_yaml_properties = [
|
69
76
|
|
|
70
77
|
| end
|
71
|
-
|
|
78
|
+
|
|
72
79
|
|@element.attribute_child.each{ | attribute |
|
73
80
|
|
|
74
81
|
"@#{attribute.name}",
|
@@ -76,8 +83,8 @@
|
|
76
83
|
|}
|
77
84
|
|
|
78
85
|
"@children"
|
79
|
-
]
|
80
|
-
|
86
|
+
]
|
87
|
+
|
81
88
|
def to_yaml_properties
|
82
89
|
|
|
83
90
|
|if @element.persisted then
|
@@ -152,7 +159,7 @@
|
|
152
159
|
|
|
153
160
|
| else
|
154
161
|
|
|
155
|
-
|
162
|
+
|
156
163
|
def initialize
|
157
164
|
super
|
158
165
|
|
|
@@ -187,7 +194,7 @@
|
|
187
194
|
|
188
195
|
changed
|
189
196
|
end
|
190
|
-
|
197
|
+
|
191
198
|
def clear_non_persistent_index_attributes
|
192
199
|
|
|
193
200
|
|@element.attribute_child.each{ | attribute |
|
@@ -199,11 +206,11 @@
|
|
199
206
|
|}
|
200
207
|
|
|
201
208
|
end
|
202
|
-
|
209
|
+
|
203
210
|
def append_to(other)
|
204
211
|
other.add_#{@element.attribute_name}(self)
|
205
212
|
end
|
206
|
-
|
213
|
+
|
207
214
|
|
|
208
215
|
|if @element.persisted then
|
209
216
|
|
|
@@ -232,11 +239,11 @@
|
|
232
239
|
def #{@element.class_name}.tag
|
233
240
|
@@tag
|
234
241
|
end
|
235
|
-
|
242
|
+
|
236
243
|
def #{@element.class_name}.ns
|
237
244
|
@@ns
|
238
245
|
end
|
239
|
-
|
246
|
+
|
240
247
|
def #{@element.class_name}.ns_tag
|
241
248
|
@@ns_tag
|
242
249
|
end
|
@@ -244,19 +251,19 @@
|
|
244
251
|
def #{@element.class_name}.safe_name
|
245
252
|
@@safe_name
|
246
253
|
end
|
247
|
-
|
254
|
+
|
248
255
|
def #{@element.class_name}.module_name
|
249
256
|
@@module_name
|
250
257
|
end
|
251
|
-
|
258
|
+
|
252
259
|
def tag
|
253
260
|
@@tag
|
254
261
|
end
|
255
|
-
|
262
|
+
|
256
263
|
def ns
|
257
264
|
@@ns
|
258
265
|
end
|
259
|
-
|
266
|
+
|
260
267
|
def ns_tag
|
261
268
|
@@ns_tag
|
262
269
|
end
|
@@ -264,11 +271,11 @@
|
|
264
271
|
def safe_name
|
265
272
|
@@safe_name
|
266
273
|
end
|
267
|
-
|
274
|
+
|
268
275
|
def module_name
|
269
276
|
@@module_name
|
270
277
|
end
|
271
|
-
|
278
|
+
|
272
279
|
def attributes
|
273
280
|
@@attributes
|
274
281
|
end
|
@@ -279,30 +286,30 @@
|
|
279
286
|
def indexed_by
|
280
287
|
:#{@element.indexed_by_attr}
|
281
288
|
end
|
282
|
-
|
289
|
+
|
283
290
|
def get_the_index
|
284
291
|
@#{@element.indexed_by_attr}
|
285
292
|
end
|
286
|
-
|
293
|
+
|
287
294
|
def set_the_index(index)
|
288
295
|
@#{@element.indexed_by_attr} = index
|
289
296
|
end
|
290
297
|
|
|
291
298
|
|end
|
292
299
|
|
|
293
|
-
|
300
|
+
|
294
301
|
def substitute_in_visit(visitor)
|
295
302
|
return visitor.substitute_in_visit_#{@element.attribute_name}(self) || self
|
296
303
|
end
|
297
|
-
|
304
|
+
|
298
305
|
def before_visit(visitor)
|
299
306
|
visitor.before_visit_#{@element.attribute_name}(self)
|
300
307
|
end
|
301
|
-
|
308
|
+
|
302
309
|
def visit(visitor)
|
303
310
|
visitor.visit_#{@element.attribute_name}(self)
|
304
311
|
end
|
305
|
-
|
312
|
+
|
306
313
|
def after_visit(visitor)
|
307
314
|
visitor.after_visit_#{@element.attribute_name}(self)
|
308
315
|
end
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|if @element.persisted then
|
5
5
|
|
|
6
6
|
include Xampl::XamplPersistedObject
|
7
|
-
|
7
|
+
|
8
8
|
@@default_persister_format = nil
|
9
9
|
|
10
10
|
def default_persister_format
|
@@ -17,6 +17,13 @@
|
|
17
17
|
@@default_persister_format = format
|
18
18
|
end
|
19
19
|
|
20
|
+
def #{@element.class_name}.find_by_query
|
21
|
+
things = Xampl.find_xampl do | q |
|
22
|
+
q.add_condition('class', :equals, self.name)
|
23
|
+
yield(q)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
20
27
|
|
|
21
28
|
|else
|
22
29
|
|
|
@@ -25,7 +32,7 @@
|
|
25
32
|
|end
|
26
33
|
|
|
27
34
|
include Xampl::XamplWithSimpleContent
|
28
|
-
|
35
|
+
|
29
36
|
@@tag = "#{@element.name}"
|
30
37
|
@@ns = "#{@element.namespace}"
|
31
38
|
@@ns_tag = "{#{@element.namespace}}#{@element.name}"
|
@@ -59,7 +66,7 @@
|
|
59
66
|
|
|
60
67
|
|
61
68
|
@@to_yaml_properties = [ "@#{@element.indexed_by_attr}" ]
|
62
|
-
@@to_yaml_properties_all = [
|
69
|
+
@@to_yaml_properties_all = [
|
63
70
|
|
|
64
71
|
|else
|
65
72
|
|
|
@@ -75,7 +82,7 @@
|
|
75
82
|
|}
|
76
83
|
|
|
77
84
|
"@_content"
|
78
|
-
]
|
85
|
+
]
|
79
86
|
|
80
87
|
def to_yaml_properties
|
81
88
|
|
|
@@ -151,7 +158,7 @@
|
|
151
158
|
|
|
152
159
|
| else
|
153
160
|
|
|
154
|
-
|
161
|
+
|
155
162
|
def initialize
|
156
163
|
super
|
157
164
|
|
|
@@ -185,7 +192,7 @@
|
|
185
192
|
|
186
193
|
changed
|
187
194
|
end
|
188
|
-
|
195
|
+
|
189
196
|
def clear_non_persistent_index_attributes
|
190
197
|
|
|
191
198
|
|@element.attribute_child.each{ | attribute |
|
@@ -197,11 +204,11 @@
|
|
197
204
|
|}
|
198
205
|
|
|
199
206
|
end
|
200
|
-
|
207
|
+
|
201
208
|
def append_to(other)
|
202
209
|
other.add_#{@element.attribute_name}(self)
|
203
210
|
end
|
204
|
-
|
211
|
+
|
205
212
|
|
|
206
213
|
|if @element.persisted then
|
207
214
|
|
|
@@ -230,11 +237,11 @@
|
|
230
237
|
def #{@element.class_name}.tag
|
231
238
|
@@tag
|
232
239
|
end
|
233
|
-
|
240
|
+
|
234
241
|
def #{@element.class_name}.ns
|
235
242
|
@@ns
|
236
243
|
end
|
237
|
-
|
244
|
+
|
238
245
|
def #{@element.class_name}.ns_tag
|
239
246
|
@@ns_tag
|
240
247
|
end
|
@@ -242,19 +249,19 @@
|
|
242
249
|
def #{@element.class_name}.safe_name
|
243
250
|
@@safe_name
|
244
251
|
end
|
245
|
-
|
252
|
+
|
246
253
|
def #{@element.class_name}.module_name
|
247
254
|
@@module_name
|
248
255
|
end
|
249
|
-
|
256
|
+
|
250
257
|
def tag
|
251
258
|
@@tag
|
252
259
|
end
|
253
|
-
|
260
|
+
|
254
261
|
def ns
|
255
262
|
@@ns
|
256
263
|
end
|
257
|
-
|
264
|
+
|
258
265
|
def ns_tag
|
259
266
|
@@ns_tag
|
260
267
|
end
|
@@ -262,11 +269,11 @@
|
|
262
269
|
def safe_name
|
263
270
|
@@safe_name
|
264
271
|
end
|
265
|
-
|
272
|
+
|
266
273
|
def module_name
|
267
274
|
@@module_name
|
268
275
|
end
|
269
|
-
|
276
|
+
|
270
277
|
def attributes
|
271
278
|
@@attributes
|
272
279
|
end
|
@@ -277,30 +284,30 @@
|
|
277
284
|
def indexed_by
|
278
285
|
:#{@element.indexed_by_attr}
|
279
286
|
end
|
280
|
-
|
287
|
+
|
281
288
|
def get_the_index
|
282
289
|
@#{@element.indexed_by_attr}
|
283
290
|
end
|
284
|
-
|
291
|
+
|
285
292
|
def set_the_index(index)
|
286
293
|
@#{@element.indexed_by_attr} = index
|
287
294
|
end
|
288
295
|
|
|
289
296
|
|end
|
290
297
|
|
|
291
|
-
|
298
|
+
|
292
299
|
def substitute_in_visit(visitor)
|
293
300
|
return visitor.substitute_in_visit_#{@element.attribute_name}(self) || self
|
294
301
|
end
|
295
|
-
|
302
|
+
|
296
303
|
def before_visit(visitor)
|
297
304
|
visitor.before_visit_#{@element.attribute_name}(self)
|
298
305
|
end
|
299
|
-
|
306
|
+
|
300
307
|
def visit(visitor)
|
301
308
|
visitor.visit_#{@element.attribute_name}(self)
|
302
309
|
end
|
303
|
-
|
310
|
+
|
304
311
|
def after_visit(visitor)
|
305
312
|
visitor.after_visit_#{@element.attribute_name}(self)
|
306
313
|
end
|
File without changes
|
File without changes
|
File without changes
|
@@ -9,7 +9,7 @@ include XamplExample
|
|
9
9
|
require "benchmark"
|
10
10
|
include Benchmark
|
11
11
|
|
12
|
-
require 'persister/fsdb'
|
12
|
+
#require 'persister/fsdb'
|
13
13
|
|
14
14
|
module Bench
|
15
15
|
|
@@ -32,10 +32,10 @@ module Bench
|
|
32
32
|
Xampl.enable_persister("bench2_no_rollback_filesystem", :filesystem)
|
33
33
|
writes += Bench.no_rollbacks(count_things, count)
|
34
34
|
}
|
35
|
-
x.report("fsdb") {
|
36
|
-
Xampl.enable_persister("bench2_no_rollback_fsdb", :fsdb)
|
37
|
-
Bench.no_rollbacks(count_things, count)
|
38
|
-
}
|
35
|
+
# x.report("fsdb") {
|
36
|
+
# Xampl.enable_persister("bench2_no_rollback_fsdb", :fsdb)
|
37
|
+
# Bench.no_rollbacks(count_things, count)
|
38
|
+
# }
|
39
39
|
end
|
40
40
|
puts " writes: #{writes}"
|
41
41
|
|
@@ -54,10 +54,10 @@ module Bench
|
|
54
54
|
Xampl.enable_persister("bench2_rollback_filesystem", :filesystem)
|
55
55
|
writes += Bench.rollbacks(count_things, count)
|
56
56
|
}
|
57
|
-
x.report("fsdb") {
|
58
|
-
Xampl.enable_persister("bench2_rollback_fsdb", :fsdb)
|
59
|
-
Bench.rollbacks(count_things, count)
|
60
|
-
}
|
57
|
+
# x.report("fsdb") {
|
58
|
+
# Xampl.enable_persister("bench2_rollback_fsdb", :fsdb)
|
59
|
+
# Bench.rollbacks(count_things, count)
|
60
|
+
# }
|
61
61
|
end
|
62
62
|
puts " writes: #{writes}"
|
63
63
|
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1455,80 +1455,80 @@ class TestXampl < Test::Unit::TestCase
|
|
1455
1455
|
pp_xml = root.pp_xml
|
1456
1456
|
end
|
1457
1457
|
|
1458
|
-
def test_fsdb_extension_persistence_basics
|
1459
|
-
require 'persister/fsdb'
|
1460
|
-
stuff = Stuff.new
|
1461
|
-
thing = Thing.new
|
1462
|
-
thing << stuff
|
1463
|
-
|
1464
|
-
thing.pid = "thing"
|
1465
|
-
|
1466
|
-
assert_xampl_exception(:name_required){
|
1467
|
-
Xampl.enable_persister(nil, :fsdb)
|
1468
|
-
}
|
1469
|
-
|
1470
|
-
pname = "test_fsdb_extension_persistence_basics" << Time.now.strftime("%Y%m%d-%H%M-%S") << rand.to_s
|
1471
|
-
Xampl.enable_persister(pname, :fsdb)
|
1472
|
-
|
1473
|
-
stuff = Stuff.new
|
1474
|
-
thing = Thing.new
|
1475
|
-
thing.pid = "thing"
|
1476
|
-
thing << stuff
|
1477
|
-
|
1478
|
-
assert_nil(Xampl.lookup(Thing, "thing"))
|
1479
|
-
|
1480
|
-
assert(nil == thing.persister)
|
1481
|
-
assert(thing.is_changed)
|
1482
|
-
assert_equal(0, Xampl.count_changed)
|
1483
|
-
|
1484
|
-
Xampl.introduce_to_persister(thing)
|
1485
|
-
|
1486
|
-
assert(thing.persister)
|
1487
|
-
assert_equal(1, Xampl.count_changed)
|
1488
|
-
assert_same(thing, Xampl.lookup(Thing, "thing"), "cannot lookup new stuff")
|
1489
|
-
|
1490
|
-
#Xampl.print_stats
|
1491
|
-
|
1492
|
-
assert_equal(1, Xampl.count_changed)
|
1493
|
-
writes = Xampl.sync
|
1494
|
-
assert_equal(1, writes)
|
1495
|
-
assert_equal(0, Xampl.count_changed)
|
1496
|
-
assert(Xampl.lookup(Thing, "thing"))
|
1497
|
-
|
1498
|
-
thing2 = Xampl.lookup(Thing, "thing")
|
1499
|
-
assert_same(thing, thing2, "cannot lookup cached stuff")
|
1500
|
-
|
1501
|
-
Xampl.clear_cache
|
1502
|
-
|
1503
|
-
found = Xampl.lookup(Thing, "thing")
|
1504
|
-
assert_not_same(thing, found)
|
1505
|
-
assert(thing === found)
|
1506
|
-
|
1507
|
-
Xampl.clear_cache
|
1508
|
-
|
1509
|
-
# now, changing thing will affect the DB -- VERY SUBTLE POSSIBLIITY OF BUG!
|
1510
|
-
thing.new_stuff
|
1511
|
-
assert_equal(2, thing.stuff.size)
|
1512
|
-
assert_equal(1, found.stuff.size)
|
1513
|
-
|
1514
|
-
writes = Xampl.sync
|
1515
|
-
|
1516
|
-
assert_equal(2, thing.stuff.size)
|
1517
|
-
assert_equal(1, found.stuff.size)
|
1518
|
-
|
1519
|
-
found2 = Xampl.lookup(Thing, "thing")
|
1520
|
-
|
1521
|
-
assert_equal(2, thing.stuff.size)
|
1522
|
-
assert_equal(1, found.stuff.size)
|
1523
|
-
assert_equal(2, found2.stuff.size)
|
1524
|
-
|
1525
|
-
assert(!(found === found2))
|
1526
|
-
assert(thing === found2)
|
1527
|
-
|
1528
|
-
assert_not_equal(found, found2)
|
1529
|
-
|
1530
|
-
#Xampl.print_stats
|
1531
|
-
end
|
1458
|
+
# def test_fsdb_extension_persistence_basics
|
1459
|
+
# require 'persister/fsdb'
|
1460
|
+
# stuff = Stuff.new
|
1461
|
+
# thing = Thing.new
|
1462
|
+
# thing << stuff
|
1463
|
+
#
|
1464
|
+
# thing.pid = "thing"
|
1465
|
+
#
|
1466
|
+
# assert_xampl_exception(:name_required){
|
1467
|
+
# Xampl.enable_persister(nil, :fsdb)
|
1468
|
+
# }
|
1469
|
+
#
|
1470
|
+
# pname = "test_fsdb_extension_persistence_basics" << Time.now.strftime("%Y%m%d-%H%M-%S") << rand.to_s
|
1471
|
+
# Xampl.enable_persister(pname, :fsdb)
|
1472
|
+
#
|
1473
|
+
# stuff = Stuff.new
|
1474
|
+
# thing = Thing.new
|
1475
|
+
# thing.pid = "thing"
|
1476
|
+
# thing << stuff
|
1477
|
+
#
|
1478
|
+
# assert_nil(Xampl.lookup(Thing, "thing"))
|
1479
|
+
#
|
1480
|
+
# assert(nil == thing.persister)
|
1481
|
+
# assert(thing.is_changed)
|
1482
|
+
# assert_equal(0, Xampl.count_changed)
|
1483
|
+
#
|
1484
|
+
# Xampl.introduce_to_persister(thing)
|
1485
|
+
#
|
1486
|
+
# assert(thing.persister)
|
1487
|
+
# assert_equal(1, Xampl.count_changed)
|
1488
|
+
# assert_same(thing, Xampl.lookup(Thing, "thing"), "cannot lookup new stuff")
|
1489
|
+
#
|
1490
|
+
# #Xampl.print_stats
|
1491
|
+
#
|
1492
|
+
# assert_equal(1, Xampl.count_changed)
|
1493
|
+
# writes = Xampl.sync
|
1494
|
+
# assert_equal(1, writes)
|
1495
|
+
# assert_equal(0, Xampl.count_changed)
|
1496
|
+
# assert(Xampl.lookup(Thing, "thing"))
|
1497
|
+
#
|
1498
|
+
# thing2 = Xampl.lookup(Thing, "thing")
|
1499
|
+
# assert_same(thing, thing2, "cannot lookup cached stuff")
|
1500
|
+
#
|
1501
|
+
# Xampl.clear_cache
|
1502
|
+
#
|
1503
|
+
# found = Xampl.lookup(Thing, "thing")
|
1504
|
+
# assert_not_same(thing, found)
|
1505
|
+
# assert(thing === found)
|
1506
|
+
#
|
1507
|
+
# Xampl.clear_cache
|
1508
|
+
#
|
1509
|
+
# # now, changing thing will affect the DB -- VERY SUBTLE POSSIBLIITY OF BUG!
|
1510
|
+
# thing.new_stuff
|
1511
|
+
# assert_equal(2, thing.stuff.size)
|
1512
|
+
# assert_equal(1, found.stuff.size)
|
1513
|
+
#
|
1514
|
+
# writes = Xampl.sync
|
1515
|
+
#
|
1516
|
+
# assert_equal(2, thing.stuff.size)
|
1517
|
+
# assert_equal(1, found.stuff.size)
|
1518
|
+
#
|
1519
|
+
# found2 = Xampl.lookup(Thing, "thing")
|
1520
|
+
#
|
1521
|
+
# assert_equal(2, thing.stuff.size)
|
1522
|
+
# assert_equal(1, found.stuff.size)
|
1523
|
+
# assert_equal(2, found2.stuff.size)
|
1524
|
+
#
|
1525
|
+
# assert(!(found === found2))
|
1526
|
+
# assert(thing === found2)
|
1527
|
+
#
|
1528
|
+
# assert_not_equal(found, found2)
|
1529
|
+
#
|
1530
|
+
# #Xampl.print_stats
|
1531
|
+
# end
|
1532
1532
|
|
1533
1533
|
def test_simple_extension_persistence_basics
|
1534
1534
|
stuff = Stuff.new
|