umlaut 3.0.0alpha10 → 3.0.0alpha11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. data/app/models/collection.rb +7 -1
  2. data/app/models/referent.rb +11 -77
  3. data/app/models/request.rb +2 -2
  4. data/app/models/service_store.rb +4 -0
  5. data/app/models/service_wave.rb +1 -1
  6. data/lib/section_renderer.rb +9 -5
  7. data/lib/service.rb +0 -62
  8. data/lib/service_adaptors/isi.rb +1 -1
  9. data/lib/service_adaptors/jcr.rb +1 -1
  10. data/lib/umlaut/version.rb +1 -1
  11. data/lib/umlaut_configurable.rb +1 -0
  12. data/test/dummy/config/environments/profile.rb +24 -0
  13. data/test/dummy/config/primo.yml +271 -0
  14. data/test/dummy/config/umlaut_services-TEST.yml +37 -0
  15. data/test/dummy/profile/sfx_collection_prof.rb +22 -0
  16. data/test/dummy/tmp/cache/assets/C2A/410/sprockets%2Fd654b74912b4773a2534616863fb6565 +0 -0
  17. data/test/dummy/tmp/cache/assets/C45/A30/sprockets%2F39494895e462697b478d3d0c79298a26 +0 -0
  18. data/test/dummy/tmp/cache/assets/C5F/340/sprockets%2F99692920160b7a279b86a80415b79db7 +0 -0
  19. data/test/dummy/tmp/cache/assets/C70/4D0/sprockets%2F034ad2036e623081bd352800786dfe80 +0 -0
  20. data/test/dummy/tmp/cache/assets/C80/980/sprockets%2Fc94807409c1523d43e18d25f35d93c41 +0 -0
  21. data/test/dummy/tmp/cache/assets/{D0E/570/sprockets%2Fd4a16e3bdd7c7b9543c446b1b0174688 → CBD/730/sprockets%2F034c1086748b981c36672d5a56e7fed6} +0 -0
  22. data/test/dummy/tmp/cache/assets/CBF/B60/sprockets%2F08ca89671549936265dcb673bf02e36f +0 -0
  23. data/test/dummy/tmp/cache/assets/CC9/9F0/sprockets%2F306166316e2cafd13c15e62b51a2339d +0 -0
  24. data/test/dummy/tmp/cache/assets/CD6/300/sprockets%2F397ec39d3d883789effe506c38760368 +0 -0
  25. data/test/dummy/tmp/cache/assets/CD7/DD0/sprockets%2F4f1fe68aa2042a0970bde9b185530646 +0 -0
  26. data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  27. data/test/dummy/tmp/cache/assets/CF7/2B0/sprockets%2F25a7c73655bd3598173b39d9f98bcd46 +0 -0
  28. data/test/dummy/tmp/cache/assets/CFE/080/sprockets%2F37fe9f4255baddbd549a659914929398 +0 -0
  29. data/test/dummy/tmp/cache/assets/{CE1/F50/sprockets%2F6e6b593b107866863500ba0fee5a9e24 → D16/F90/sprockets%2F5fe3c021048c6f9a6086bed7736d87b1} +0 -0
  30. data/test/dummy/tmp/cache/assets/{CDD/7D0/sprockets%2F60687bff4553a7f8c701bb9627a6200a → D24/360/sprockets%2F6987b047a96dc685ba3cf39b31477f6d} +0 -0
  31. data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  32. data/test/dummy/tmp/cache/assets/D37/2B0/sprockets%2F40834fb07d7318c1fddd5003bd9e04f6 +0 -0
  33. data/test/dummy/tmp/cache/assets/D43/0D0/sprockets%2F682843a8d0795a5fbcfeb2f0c81727d0 +0 -0
  34. data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  35. data/test/dummy/tmp/cache/assets/D50/A30/sprockets%2F7d8b294ac433db5d056538f8cf7c66b9 +0 -0
  36. data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  37. data/test/dummy/tmp/cache/assets/D6C/7D0/sprockets%2F8a05d6981ec0d38c51739bef0b3a9c2b +0 -0
  38. data/test/dummy/tmp/cache/assets/D94/FF0/sprockets%2F3b56a1aa77de0d570c38a4a9d5f4b1d6 +0 -0
  39. data/test/dummy/tmp/cache/assets/D97/6B0/sprockets%2Fb070e8c799d1a4ad5e62e0a1ae3b83e6 +0 -0
  40. data/test/dummy/tmp/cache/assets/DA6/A80/sprockets%2F92e26d8e58d5bcc8b8f6c25d1b05b9c1 +0 -0
  41. data/test/dummy/tmp/cache/assets/{DB7/BD0/sprockets%2Ff2c59778ab79dcfd3792f46f2ce82f2a → DC0/D20/sprockets%2F1ccf7405cd252dcec4bf23af82e2563a} +0 -0
  42. data/test/dummy/tmp/cache/assets/{D5C/B00/sprockets%2F2b7ac06cc680d7480c06b917bac5a6b0 → DD2/D80/sprockets%2Fc66d103807d0f971fbbcf9aa8b8b27ee} +0 -0
  43. data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
  44. data/test/dummy/tmp/cache/assets/DE8/790/sprockets%2Fd1333bde2b9aafcc712d11dd09ab35d8 +0 -0
  45. data/test/dummy/tmp/cache/assets/DF5/5E0/sprockets%2F8e64a37c73cdc0b37a4ccfcb42ab45d8 +0 -0
  46. data/test/dummy/tmp/cache/assets/DF7/960/sprockets%2F99ac6db10b44a64fbba4ee847b35ba8b +0 -0
  47. data/test/dummy/tmp/cache/assets/{C84/A00/sprockets%2F3ba04c88513936081d59d8771f6804aa → DFC/040/sprockets%2F15ea81cf915c0cb1dfc9cc04c9fef364} +0 -0
  48. data/test/dummy/tmp/cache/assets/DFD/300/sprockets%2Fabac9489cf7f1db8ef00d72a1571ee1e +0 -0
  49. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  50. data/test/dummy/tmp/cache/assets/E38/FE0/sprockets%2Fe1fc875efa817cbb94a5d8de25ea4e6b +0 -0
  51. data/test/dummy/tmp/cache/assets/E5F/960/sprockets%2Fdc007b6cad5c7ef08e33ec28cfff0ef6 +0 -0
  52. data/test/dummy/tmp/performance/BenchmarkerTest#test_puts_foo_gc_runs.csv +2 -0
  53. data/test/dummy/tmp/performance/BenchmarkerTest#test_puts_foo_gc_time.csv +2 -0
  54. data/test/dummy/tmp/performance/BenchmarkerTest#test_puts_foo_memory.csv +2 -0
  55. data/test/dummy/tmp/performance/BenchmarkerTest#test_puts_foo_objects.csv +2 -0
  56. data/test/dummy/tmp/performance/BenchmarkerTest#test_puts_foo_wall_time.csv +2 -0
  57. data/test/dummy/tmp/performance/ProfilerTest#test_puts_foo_process_time_flat.txt +11 -0
  58. data/test/dummy/tmp/performance/ProfilerTest#test_puts_foo_process_time_graph.html +303 -0
  59. data/test/dummy/tmp/performance/ProfilerTest#test_puts_foo_process_time_stack.html +546 -0
  60. data/test/dummy/tmp/performance/ProfilerTest#test_puts_foo_process_time_tree.txt +38 -0
  61. data/test/dummy/tmp/performance/empty.png +0 -0
  62. data/test/dummy/tmp/performance/minus.png +0 -0
  63. data/test/dummy/tmp/performance/plus.png +0 -0
  64. data/test/test_helper.rb +36 -0
  65. data/test/unit/aleph_patron_test.rb +40 -35
  66. data/test/unit/aleph_record_benchmarks.rb +28 -24
  67. data/test/unit/aleph_record_test.rb +31 -26
  68. data/test/unit/collection_test.rb +17 -18
  69. data/test/unit/google_book_search_test.rb +18 -44
  70. data/test/unit/primo_searcher_test.rb +325 -321
  71. data/test/unit/primo_service_test.rb +924 -919
  72. data/test/unit/primo_ws_test.rb +141 -138
  73. data/test/unit/service_test.rb +2 -16
  74. metadata +93 -100
  75. data/test/dummy/tmp/cache/assets/C73/920/sprockets%2Fd371318f22900492fd180f17c5e2a504 +0 -0
  76. data/test/dummy/tmp/cache/assets/C8F/780/sprockets%2Fe47e28558116fb5f8038754e60d1961d +0 -0
  77. data/test/dummy/tmp/cache/assets/CAA/EB0/sprockets%2F1d179210e8b76f1ea63c802688a015e4 +0 -9271
  78. data/test/dummy/tmp/cache/assets/CB2/DA0/sprockets%2Fa1808990b72376256db2ae3818c0e9b5 +0 -0
  79. data/test/dummy/tmp/cache/assets/CBB/9C0/sprockets%2F706f28923fb754cad04b9107c89986a1 +0 -0
  80. data/test/dummy/tmp/cache/assets/CDC/680/sprockets%2F2b68ef632d12610f3c9563168bfa7c05 +0 -0
  81. data/test/dummy/tmp/cache/assets/CEA/2A0/sprockets%2F9c8607157b998108ce08f4aca39f810a +0 -0
  82. data/test/dummy/tmp/cache/assets/CF5/9B0/sprockets%2F7933bfe880731b396791f1682ce3f7fa +0 -0
  83. data/test/dummy/tmp/cache/assets/CFB/2F0/sprockets%2F62d51f0aa5cac4b1cf7091823772a604 +0 -0
  84. data/test/dummy/tmp/cache/assets/D22/060/sprockets%2F9aec77b768e91a802d284271c58e2f7e +0 -0
  85. data/test/dummy/tmp/cache/assets/D33/6D0/sprockets%2F500129c57f1146e556ec3aacd6cd38c1 +0 -0
  86. data/test/dummy/tmp/cache/assets/D33/FD0/sprockets%2F2ba0b4e6334a77b923e5f770381bb2bf +0 -0
  87. data/test/dummy/tmp/cache/assets/D4C/0A0/sprockets%2F7810d837eec3ac57ad78756af83a6a55 +0 -0
  88. data/test/dummy/tmp/cache/assets/D4C/E30/sprockets%2F631abf89746799b7a5b2b3b4f6294bcd +0 -0
  89. data/test/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4 +0 -873
  90. data/test/dummy/tmp/cache/assets/D5D/AD0/sprockets%2Fbdb053d9a6a967788f09fbc555d69f58 +0 -0
  91. data/test/dummy/tmp/cache/assets/D66/890/sprockets%2F06287a78ed20d8214197eab03bfca5dd +0 -0
  92. data/test/dummy/tmp/cache/assets/D6B/2A0/sprockets%2F81f17ab0ed20f4a8d9355f7a1d872eb2 +0 -0
  93. data/test/dummy/tmp/cache/assets/D70/080/sprockets%2F24d3ce40ae5cc827a9183b1fb837e84e +0 -0
  94. data/test/dummy/tmp/cache/assets/D71/6B0/sprockets%2Fde558b71b494cf09b1bf055c8dff0353 +0 -0
  95. data/test/dummy/tmp/cache/assets/D72/610/sprockets%2Fa8c708eeb30ef93de34d755d4f45d023 +0 -0
  96. data/test/dummy/tmp/cache/assets/D74/4C0/sprockets%2F64fdf30f75592d6e45fcfc45a48d20a2 +0 -0
  97. data/test/dummy/tmp/cache/assets/D76/AD0/sprockets%2Fe2158cde93188cf5ab6457bc6d6602ec +0 -0
  98. data/test/dummy/tmp/cache/assets/D7A/E40/sprockets%2F9622ffcc499a57627cd1bb18fe31b8e4 +0 -11772
  99. data/test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +0 -0
  100. data/test/dummy/tmp/cache/assets/D9B/770/sprockets%2F8aacf02eb7dbb0949704b28f27b87e0b +0 -0
  101. data/test/dummy/tmp/cache/assets/DF7/F30/sprockets%2F7bc16c4109b17fabe29f8ddbbf732d1c +0 -0
  102. data/test/dummy/tmp/cache/assets/E03/570/sprockets%2F493bdc0ac14cd4f57fdfe4253f992bde +0 -0
  103. data/test/dummy/tmp/cache/assets/E09/850/sprockets%2F4bf497a38ecfef660b2f0ebb852d5e9c +0 -0
  104. data/test/dummy/tmp/cache/assets/E0B/4B0/sprockets%2F7988df51a61c81ce6ede4a2d4c8cce4f +0 -377
  105. data/test/dummy/tmp/cache/assets/E6F/A00/sprockets%2Fd32bcea45ea04a6aaee95b3aa840cbab +0 -0
@@ -0,0 +1,546 @@
1
+ <html><head>
2
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
3
+ <title>ruby-prof call tree</title>
4
+ <style type="text/css">
5
+ <!--
6
+ body {
7
+ font-size:70%;
8
+ padding:0px;
9
+ margin:5px;
10
+ margin-right:0px;
11
+ margin-left:0px;
12
+ background: #ffffff;
13
+ }
14
+ ul {
15
+ margin-left:0px;
16
+ margin-top:0px;
17
+ margin-bottom:0px;
18
+ padding-left:0px;
19
+ list-style-type:none;
20
+ }
21
+ li {
22
+ margin-left:11px;
23
+ padding:0px;
24
+ white-space:nowrap;
25
+ border-top:1px solid #cccccc;
26
+ border-left:1px solid #cccccc;
27
+ border-bottom:none;
28
+ }
29
+ .thread {
30
+ margin-left:11px;
31
+ background:#708090;
32
+ padding-top:3px;
33
+ padding-left:12px;
34
+ padding-bottom:2px;
35
+ border-left:1px solid #CCCCCC;
36
+ border-top:1px solid #CCCCCC;
37
+ font-weight:bold;
38
+ }
39
+ .hidden {
40
+ display:none;
41
+ width:0px;
42
+ height:0px;
43
+ margin:0px;
44
+ padding:0px;
45
+ border-style:none;
46
+ }
47
+ .color01 { background:#adbdeb }
48
+ .color05 { background:#9daddb }
49
+ .color0 { background:#8d9dcb }
50
+ .color1 { background:#89bccb }
51
+ .color2 { background:#56e3e7 }
52
+ .color3 { background:#32cd70 }
53
+ .color4 { background:#a3d53c }
54
+ .color5 { background:#c4cb34 }
55
+ .color6 { background:#dcb66d }
56
+ .color7 { background:#cda59e }
57
+ .color8 { background:#be9d9c }
58
+ .color9 { background:#cf947a }
59
+ #commands {
60
+ font-size:10pt;
61
+ padding:10px;
62
+ margin-left:11px;
63
+ margin-bottom:0px;
64
+ margin-top:0px;
65
+ background:#708090;
66
+ border-top:1px solid #cccccc;
67
+ border-left:1px solid #cccccc;
68
+ border-bottom:none;
69
+ }
70
+ #titlebar {
71
+ font-size:10pt;
72
+ padding:10px;
73
+ margin-left:11px;
74
+ margin-bottom:0px;
75
+ margin-top:10px;
76
+ background:#8090a0;
77
+ border-top:1px solid #cccccc;
78
+ border-left:1px solid #cccccc;
79
+ border-bottom:none;
80
+ }
81
+ #help {
82
+ font-size:10pt;
83
+ padding:10px;
84
+ margin-left:11px;
85
+ margin-bottom:0px;
86
+ margin-top:0px;
87
+ background:#8090a0;
88
+ display:none;
89
+ border-top:1px solid #cccccc;
90
+ border-left:1px solid #cccccc;
91
+ border-bottom:none;
92
+ }
93
+ #sentinel {
94
+ height: 400px;
95
+ margin-left:11px;
96
+ background:#8090a0;
97
+ border-top:1px solid #cccccc;
98
+ border-left:1px solid #cccccc;
99
+ border-bottom:none;
100
+ }
101
+ input { margin-left:10px; }
102
+ -->
103
+ </style>
104
+ <script type="text/javascript">
105
+ /*
106
+ Copyright (C) 2005,2009 Stefan Kaes
107
+ skaes@railsexpress.de
108
+ */
109
+
110
+ function rootNode() {
111
+ return currentThread;
112
+ }
113
+
114
+ function hideUL(node) {
115
+ var lis = node.childNodes
116
+ var l = lis.length;
117
+ for (var i=0; i < l ; i++ ) {
118
+ hideLI(lis[i]);
119
+ }
120
+ }
121
+
122
+ function showUL(node) {
123
+ var lis = node.childNodes;
124
+ var l = lis.length;
125
+ for (var i=0; i < l ; i++ ) {
126
+ showLI(lis[i]);
127
+ }
128
+ }
129
+
130
+ function findUlChild(li){
131
+ var ul = li.childNodes[2];
132
+ while (ul && ul.nodeName != "UL") {
133
+ ul = ul.nextSibling;
134
+ }
135
+ return ul;
136
+ }
137
+
138
+ function isLeafNode(li) {
139
+ var img = li.firstChild;
140
+ return (img.src.indexOf('empty.png') > -1);
141
+ }
142
+
143
+ function hideLI(li) {
144
+ if (isLeafNode(li))
145
+ return;
146
+
147
+ var img = li.firstChild;
148
+ img.src = 'plus.png';
149
+
150
+ var ul = findUlChild(li);
151
+ if (ul) {
152
+ ul.style.display = 'none';
153
+ hideUL(ul);
154
+ }
155
+ }
156
+
157
+ function showLI(li) {
158
+ if (isLeafNode(li))
159
+ return;
160
+
161
+ var img = li.firstChild;
162
+ img.src = 'minus.png';
163
+
164
+ var ul = findUlChild(li);
165
+ if (ul) {
166
+ ul.style.display = 'block';
167
+ showUL(ul);
168
+ }
169
+ }
170
+
171
+ function toggleLI(li) {
172
+ var img = li.firstChild;
173
+ if (img.src.indexOf("minus.png")>-1)
174
+ hideLI(li);
175
+ else {
176
+ if (img.src.indexOf("plus.png")>-1)
177
+ showLI(li);
178
+ }
179
+ }
180
+
181
+ function aboveThreshold(text, threshold) {
182
+ var match = text.match(/\d+[.,]\d+/);
183
+ return (match && parseFloat(match[0].replace(/,/, '.'))>=threshold);
184
+ }
185
+
186
+ function setThresholdLI(li, threshold) {
187
+ var img = li.firstChild;
188
+ var text = img.nextSibling;
189
+ var ul = findUlChild(li);
190
+
191
+ var visible = aboveThreshold(text.nodeValue, threshold) ? 1 : 0;
192
+
193
+ var count = 0;
194
+ if (ul) {
195
+ count = setThresholdUL(ul, threshold);
196
+ }
197
+ if (count>0) {
198
+ img.src = 'minus.png';
199
+ }
200
+ else {
201
+ img.src = 'empty.png';
202
+ }
203
+ if (visible) {
204
+ li.style.display = 'block'
205
+ }
206
+ else {
207
+ li.style.display = 'none'
208
+ }
209
+ return visible;
210
+ }
211
+
212
+ function setThresholdUL(node, threshold) {
213
+ var lis = node.childNodes;
214
+ var l = lis.length;
215
+
216
+ var count = 0;
217
+ for ( var i = 0; i < l ; i++ ) {
218
+ count = count + setThresholdLI(lis[i], threshold);
219
+ }
220
+
221
+ var visible = (count > 0) ? 1 : 0;
222
+ if (visible) {
223
+ node.style.display = 'block';
224
+ }
225
+ else {
226
+ node.style.display = 'none';
227
+ }
228
+ return visible;
229
+ }
230
+
231
+ function toggleChildren(img, event) {
232
+ event.cancelBubble=true;
233
+
234
+ if (img.src.indexOf('empty.png') > -1)
235
+ return;
236
+
237
+ var minus = (img.src.indexOf('minus.png') > -1);
238
+
239
+ if (minus) {
240
+ img.src = 'plus.png';
241
+ }
242
+ else
243
+ img.src = 'minus.png';
244
+
245
+ var li = img.parentNode;
246
+ var ul = findUlChild(li);
247
+ if (ul) {
248
+ if (minus)
249
+ ul.style.display = 'none';
250
+ else
251
+ ul.style.display = 'block';
252
+ }
253
+ if (minus)
254
+ moveSelectionIfNecessary(li);
255
+ }
256
+
257
+ function showChildren(li) {
258
+ var img = li.firstChild;
259
+ if (img.src.indexOf('empty.png') > -1)
260
+ return;
261
+ img.src = 'minus.png';
262
+
263
+ var ul = findUlChild(li);
264
+ if (ul) {
265
+ ul.style.display = 'block';
266
+ }
267
+ }
268
+
269
+ function setThreshold() {
270
+ var tv = document.getElementById("threshold").value;
271
+ if (tv.match(/[0-9]+([.,][0-9]+)?/)) {
272
+ var f = parseFloat(tv.replace(/,/, '.'));
273
+ var threads = document.getElementsByName("thread");
274
+ var l = threads.length;
275
+ for ( var i = 0; i < l ; i++ ) {
276
+ setThresholdUL(threads[i], f);
277
+ }
278
+ var p = selectedNode;
279
+ while (p && p.style.display=='none')
280
+ p=p.parentNode.parentNode;
281
+ if (p && p.nodeName=="LI")
282
+ selectNode(p);
283
+ }
284
+ else {
285
+ alert("Please specify a decimal number as threshold value!");
286
+ }
287
+ }
288
+
289
+ function collapseAll(event) {
290
+ event.cancelBubble=true;
291
+ var threads = document.getElementsByName("thread");
292
+ var l = threads.length;
293
+ for ( var i = 0; i < l ; i++ ) {
294
+ hideUL(threads[i]);
295
+ }
296
+ selectNode(rootNode(), null);
297
+ }
298
+
299
+ function expandAll(event) {
300
+ event.cancelBubble=true;
301
+ var threads = document.getElementsByName("thread");
302
+ var l = threads.length;
303
+ for ( var i = 0; i < l ; i++ ) {
304
+ showUL(threads[i]);
305
+ }
306
+ }
307
+
308
+ function toggleHelp(node) {
309
+ var help = document.getElementById("help");
310
+ if (node.value == "Show Help") {
311
+ node.value = "Hide Help";
312
+ help.style.display = 'block';
313
+ }
314
+ else {
315
+ node.value = "Show Help";
316
+ help.style.display = 'none';
317
+ }
318
+ }
319
+
320
+ var selectedNode = null;
321
+ var selectedColor = null;
322
+ var selectedThread = null;
323
+
324
+ function descendentOf(a,b){
325
+ while (a!=b && b!=null)
326
+ b=b.parentNode;
327
+ return (a==b);
328
+ }
329
+
330
+ function moveSelectionIfNecessary(node){
331
+ if (descendentOf(node, selectedNode))
332
+ selectNode(node, null);
333
+ }
334
+
335
+ function selectNode(node, event) {
336
+ if (event) {
337
+ event.cancelBubble = true;
338
+ thread = findThread(node);
339
+ selectThread(thread);
340
+ }
341
+ if (selectedNode) {
342
+ selectedNode.style.background = selectedColor;
343
+ }
344
+ selectedNode = node;
345
+ selectedColor = node.style.background;
346
+ selectedNode.style.background = "red";
347
+ selectedNode.scrollIntoView();
348
+ window.scrollBy(0,-400);
349
+ }
350
+
351
+ function moveUp(){
352
+ var p = selectedNode.previousSibling;
353
+ while (p && p.style.display == 'none')
354
+ p = p.previousSibling;
355
+ if (p && p.nodeName == "LI") {
356
+ selectNode(p, null);
357
+ }
358
+ }
359
+
360
+ function moveDown(){
361
+ var p = selectedNode.nextSibling;
362
+ while (p && p.style.display == 'none')
363
+ p = p.nextSibling;
364
+ if (p && p.nodeName == "LI") {
365
+ selectNode(p, null);
366
+ }
367
+ }
368
+
369
+ function moveLeft(){
370
+ var p = selectedNode.parentNode.parentNode;
371
+ if (p && p.nodeName=="LI") {
372
+ selectNode(p, null);
373
+ }
374
+ }
375
+
376
+ function moveRight(){
377
+ if (!isLeafNode(selectedNode)) {
378
+ showChildren(selectedNode);
379
+ var ul = findUlChild(selectedNode);
380
+ if (ul) {
381
+ selectNode(ul.firstChild, null);
382
+ }
383
+ }
384
+ }
385
+
386
+ function moveForward(){
387
+ if (isLeafNode(selectedNode)) {
388
+ var p = selectedNode;
389
+ while ((p.nextSibling == null || p.nextSibling.style.display=='none') && p.nodeName=="LI") {
390
+ p = p.parentNode.parentNode;
391
+ }
392
+ if (p.nodeName=="LI")
393
+ selectNode(p.nextSibling, null);
394
+ }
395
+ else {
396
+ moveRight();
397
+ }
398
+ }
399
+
400
+ function isExpandedNode(li){
401
+ var img = li.firstChild;
402
+ return(img.src.indexOf('minus.png')>-1);
403
+ }
404
+
405
+ function moveBackward(){
406
+ var p = selectedNode;
407
+ var q = p.previousSibling;
408
+ while (q != null && q.style.display=='none')
409
+ q = q.previousSibling;
410
+ if (q == null) {
411
+ p = p.parentNode.parentNode;
412
+ } else {
413
+ while (!isLeafNode(q) && isExpandedNode(q)) {
414
+ q = findUlChild(q).lastChild;
415
+ while (q.style.display=='none')
416
+ q = q.previousSibling;
417
+ }
418
+ p = q;
419
+ }
420
+ if (p.nodeName=="LI")
421
+ selectNode(p, null);
422
+ }
423
+
424
+ function moveHome() {
425
+ selectNode(currentThread);
426
+ }
427
+
428
+ var currentThreadIndex = null;
429
+
430
+ function findThread(node){
431
+ while (node && node.parentNode.nodeName!="BODY") {
432
+ node = node.parentNode;
433
+ }
434
+ return node.firstChild;
435
+ }
436
+
437
+ function selectThread(node){
438
+ var threads = document.getElementsByName("thread");
439
+ currentThread = node;
440
+ for (var i=0; i<threads.length; i++) {
441
+ if (threads[i]==currentThread.parentNode)
442
+ currentThreadIndex = i;
443
+ }
444
+ }
445
+
446
+ function nextThread(){
447
+ var threads = document.getElementsByName("thread");
448
+ if (currentThreadIndex==threads.length-1)
449
+ currentThreadIndex = 0;
450
+ else
451
+ currentThreadIndex += 1
452
+ currentThread = threads[currentThreadIndex].firstChild;
453
+ selectNode(currentThread, null);
454
+ }
455
+
456
+ function previousThread(){
457
+ var threads = document.getElementsByName("thread");
458
+ if (currentThreadIndex==0)
459
+ currentThreadIndex = threads.length-1;
460
+ else
461
+ currentThreadIndex -= 1
462
+ currentThread = threads[currentThreadIndex].firstChild;
463
+ selectNode(currentThread, null);
464
+ }
465
+
466
+ function switchThread(node, event){
467
+ event.cancelBubble = true;
468
+ selectThread(node.nextSibling.firstChild);
469
+ selectNode(currentThread, null);
470
+ }
471
+
472
+ function handleKeyEvent(event){
473
+ var code = event.charCode ? event.charCode : event.keyCode;
474
+ var str = String.fromCharCode(code);
475
+ switch (str) {
476
+ case "a": moveLeft(); break;
477
+ case "s": moveDown(); break;
478
+ case "d": moveRight(); break;
479
+ case "w": moveUp(); break;
480
+ case "f": moveForward(); break;
481
+ case "b": moveBackward(); break;
482
+ case "x": toggleChildren(selectedNode.firstChild, event); break;
483
+ case "*": toggleLI(selectedNode); break;
484
+ case "n": nextThread(); break;
485
+ case "h": moveHome(); break;
486
+ case "p": previousThread(); break;
487
+ }
488
+ }
489
+ document.onkeypress=function(event){ handleKeyEvent(event) };
490
+
491
+ window.onload=function(){
492
+ var images = document.getElementsByTagName("img");
493
+ for (var i=0; i<images.length; i++) {
494
+ var img = images[i];
495
+ if (img.className == "toggle") {
496
+ img.onclick = function(event){ toggleChildren(this, event); };
497
+ }
498
+ }
499
+ var divs = document.getElementsByTagName("div");
500
+ for (i=0; i<divs.length; i++) {
501
+ var div = divs[i];
502
+ if (div.className == "thread")
503
+ div.onclick = function(event){ switchThread(this, event) };
504
+ }
505
+ var lis = document.getElementsByTagName("li");
506
+ for (var i=0; i<lis.length; i++) {
507
+ lis[i].onclick = function(event){ selectNode(this, event); };
508
+ }
509
+ var threads = document.getElementsByName("thread");
510
+ currentThreadIndex = 0;
511
+ currentThread = threads[0].firstChild;
512
+ selectNode(currentThread, null);
513
+ }
514
+ </script>
515
+ </head><body>
516
+ <div id="titlebar">
517
+ Call tree for application <b>script/rails </b><br/>
518
+ Generated on Mon Feb 27 18:37:48 -0500 2012 with options {:min_percent=&gt;0.01}<br/>
519
+ </div>
520
+ <div id="commands">
521
+ <span style="font-size: 11pt; font-weight: bold;">Threshold:</span>
522
+ <input value="1.0" size="3" id="threshold" type="text">
523
+ <input value="Apply" onclick="setThreshold();" type="submit">
524
+ <input value="Expand All" onclick="expandAll(event);" type="submit">
525
+ <input value="Collapse All" onclick="collapseAll(event);" type="submit">
526
+ <input value="Show Help" onclick="toggleHelp(this);" type="submit">
527
+ </div>
528
+ <div style="display: none;" id="help">
529
+ <img src="empty.png"> Enter a decimal value <i>d</i> into the threshold field and click "Apply"
530
+ to hide all nodes marked with time values lower than <i>d</i>.<br>
531
+ <img src="empty.png"> Click on "Expand All" for full tree expansion.<br>
532
+ <img src="empty.png"> Click on "Collapse All" to show only top level nodes.<br>
533
+ <img src="empty.png"> Use a, s, d, w as in Quake or Urban Terror to navigate the tree.<br>
534
+ <img src="empty.png"> Use f and b to navigate the tree in preorder forward and backwards.<br>
535
+ <img src="empty.png"> Use x to toggle visibility of a subtree.<br>
536
+ <img src="empty.png"> Use * to expand/collapse a whole subtree.<br>
537
+ <img src="empty.png"> Use h to navigate to thread root.<br>
538
+ <img src="empty.png"> Use n and p to navigate between threads.<br>
539
+ <img src="empty.png"> Click on background to move focus to a subtree.<br>
540
+ </div>
541
+ <div class="thread">Thread: 23686809264560 (100.00% ~ 0.001245676)</div><ul name="thread"><li class="color9" style="display:block"><img class="toggle" src="minus.png"> 100.00% (100.00%) <a href="file:///home/rochkind/.rvm/gems/ruby-1.8.7-p357@umlaut3/gems/activesupport-3.2.1/lib/active_support/testing/performance/ruby.rb#36">ActiveSupport::Testing::Performance::Profiler#run</a> [1 calls, 1 total]
542
+ <ul><li class="color01" style="display:block"><img class="toggle" src="plus.png"> 4.68% (4.68%) Kernel#__send__ [1 calls, 1 total]
543
+ <ul style="display:none"><li class="color01" style="display:block"><img class="toggle" src="plus.png"> 4.21% (89.88%) <a href="file:///home/rochkind/umlaut/test/dummy/(eval)#1">ProfilerTest#test_puts_foo</a> [1 calls, 1 total]
544
+ <ul style="display:none"><li class="color01" style="display:block"><img class="toggle" src="plus.png"> 3.50% (83.19%) Kernel#puts [1 calls, 1 total]
545
+ <ul style="display:none"><li class="color01" style="display:block"><img src="empty.png"> 2.61% (74.47%) IO#write [2 calls, 2 total]
546
+ </li></ul></li></ul></li></ul></li></ul></li></ul><div id="sentinel"></div></body></html>
@@ -0,0 +1,38 @@
1
+ events: process_time
2
+
3
+ fl=/home/rochkind/umlaut/test/dummy/ruby_runtime
4
+ fn=Kernel#__send__
5
+ 0 6
6
+ cfl=/home/rochkind/umlaut/test/dummy/(eval)
7
+ cfn=ProfilerTest#test_puts_foo
8
+ calls=1 105
9
+ 105 52
10
+
11
+ fl=/home/rochkind/umlaut/test/dummy/ruby_runtime
12
+ fn=IO#write
13
+ 0 32
14
+
15
+ fl=/home/rochkind/umlaut/test/dummy/ruby_runtime
16
+ fn=Kernel#puts
17
+ 0 11
18
+ cfl=/home/rochkind/umlaut/test/dummy/ruby_runtime
19
+ cfn=IO#write
20
+ calls=2 2
21
+ 2 32
22
+
23
+ fl=/home/rochkind/umlaut/test/dummy/(eval)
24
+ fn=ProfilerTest#test_puts_foo
25
+ 1 9
26
+ cfl=/home/rochkind/umlaut/test/dummy/ruby_runtime
27
+ cfn=Kernel#puts
28
+ calls=1 2
29
+ 2 44
30
+
31
+ fl=/home/rochkind/.rvm/gems/ruby-1.8.7-p357@umlaut3/gems/activesupport-3.2.1/lib/active_support/testing/performance/ruby.rb
32
+ fn=ActiveSupport::Testing::Performance::Profiler#run
33
+ 36 1187
34
+ cfl=/home/rochkind/umlaut/test/dummy/ruby_runtime
35
+ cfn=Kernel#__send__
36
+ calls=1 105
37
+ 105 58
38
+
Binary file
data/test/test_helper.rb CHANGED
@@ -4,7 +4,43 @@ ENV["RAILS_ENV"] = "test"
4
4
  require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
5
  require "rails/test_help"
6
6
 
7
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
8
+
7
9
  Rails.backtrace_cleaner.remove_silencers!
8
10
 
9
11
  # Load support files
10
12
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
13
+
14
+ # Custom method for NYU-only tests. We still have a bunch of tests for aleph/
15
+ # primo that work against live nyu services and can only succeed if you are
16
+ # nyu. Oops. We provide this convenience function to wrap test_* class
17
+ # method bodies for nyu only tests, so they'll only be run if
18
+ # ENV variable NYU_TEST is set, otherwise you'll get a little message
19
+ # and a fake test.
20
+
21
+
22
+ # 'skip' only works in ruby 1.9.x, plus outputs a bunch of annoying stuff.
23
+ #, plus doesn't give NYU any good way to run em without editing 'skip' out
24
+ # of a buncha places.
25
+
26
+ # nyu_only_test("AlephTests") do
27
+ # def test_something
28
+ # assert_something
29
+ # end
30
+ # def test_something_else
31
+ # assert_else
32
+ # end
33
+ # end
34
+ def nyu_only_tests(test_name="Some")
35
+
36
+ run_tests = ENV['NYU_TEST'] || false
37
+
38
+ unless run_tests
39
+ warn("#{test_name} tests can't be run outside of NYU, skipping.")
40
+ def test_nothing
41
+ # avoid "no tests were specified" error.
42
+ end
43
+ else
44
+ yield
45
+ end
46
+ end