unageanu-jiji 1.1.4 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (233) hide show
  1. data/ChangeLog +24 -1
  2. data/README +0 -0
  3. data/base/shared_lib/moving_average.rb +34 -33
  4. data/base/shared_lib/system/cross.rb +76 -0
  5. data/base/shared_lib/system/position_manager.rb +160 -0
  6. data/base/shared_lib/system/signal.rb +347 -0
  7. data/html/css/datatable.css +4 -4
  8. data/html/css/default.css +57 -5
  9. data/html/css/treeview.css +205 -0
  10. data/html/img/bin_closed.png +0 -0
  11. data/html/img/bin_empty.png +0 -0
  12. data/html/img/button_add_small.gif +0 -0
  13. data/html/img/button_add_small_gray.gif +0 -0
  14. data/html/img/button_add_small_over.gif +0 -0
  15. data/html/img/button_mkcol.gif +0 -0
  16. data/html/img/button_mkcol_gray.gif +0 -0
  17. data/html/img/button_mkcol_over.gif +0 -0
  18. data/html/img/button_remove_small.gif +0 -0
  19. data/html/img/button_remove_small_gray.gif +0 -0
  20. data/html/img/button_remove_small_over.gif +0 -0
  21. data/html/img/button_rename.gif +0 -0
  22. data/html/img/button_rename_gray.gif +0 -0
  23. data/html/img/button_rename_over.gif +0 -0
  24. data/html/img/control_play.png +0 -0
  25. data/html/img/control_play_blue.png +0 -0
  26. data/html/img/folder.png +0 -0
  27. data/html/img/folder_brick.png +0 -0
  28. data/html/img/folder_user.png +0 -0
  29. data/html/{js/codepress/images → img}/line-numbers.png +0 -0
  30. data/html/img/page_white_ruby.png +0 -0
  31. data/html/img/sidebar_agent_edit.png +0 -0
  32. data/html/img/sidebar_agent_edit_over.png +0 -0
  33. data/html/img/sidebar_agent_edit_s.png +0 -0
  34. data/html/img/yui/treeview-sprite.gif +0 -0
  35. data/html/index.html +34 -18
  36. data/html/js/agent-editor/agent-editor-page.js +324 -0
  37. data/html/js/agent-editor/agent-editor.js +363 -0
  38. data/html/js/agent-editor/agent-list-tree.js +251 -0
  39. data/html/js/agent-selector.js +23 -28
  40. data/html/js/app.js +63 -91
  41. data/html/js/bt-create-page.js +25 -19
  42. data/html/js/container-min.js +1 -1
  43. data/html/js/container.js +944 -0
  44. data/html/js/edit_area/autocompletion.js +11 -13
  45. data/html/js/edit_area/edit_area.css +79 -40
  46. data/html/js/edit_area/edit_area.js +255 -226
  47. data/html/js/edit_area/edit_area_compressor.php +4 -4
  48. data/html/js/edit_area/edit_area_full.gz +0 -0
  49. data/html/js/edit_area/edit_area_full.js +31 -31
  50. data/html/js/edit_area/edit_area_full_with_plugins.gz +0 -0
  51. data/html/js/edit_area/edit_area_full_with_plugins.js +31 -31
  52. data/html/js/edit_area/edit_area_functions.js +448 -341
  53. data/html/js/edit_area/edit_area_loader.js +409 -397
  54. data/html/js/edit_area/elements_functions.js +120 -123
  55. data/html/js/edit_area/highlight.js +305 -197
  56. data/html/js/edit_area/images/goto.png +0 -0
  57. data/html/js/edit_area/images/help.png +0 -0
  58. data/html/js/edit_area/images/redo.png +0 -0
  59. data/html/js/edit_area/images/save.png +0 -0
  60. data/html/js/edit_area/images/search.png +0 -0
  61. data/html/js/edit_area/images/undo.png +0 -0
  62. data/html/js/edit_area/images/word_wrap.gif +0 -0
  63. data/html/js/edit_area/keyboard.js +5 -5
  64. data/html/js/edit_area/langs/bg.js +73 -0
  65. data/html/js/edit_area/langs/cs.js +2 -0
  66. data/html/js/edit_area/langs/de.js +2 -0
  67. data/html/js/edit_area/langs/dk.js +2 -0
  68. data/html/js/edit_area/langs/en.js +2 -0
  69. data/html/js/edit_area/langs/eo.js +2 -0
  70. data/html/js/edit_area/langs/es.js +2 -0
  71. data/html/js/edit_area/langs/fi.js +67 -0
  72. data/html/js/edit_area/langs/fr.js +2 -0
  73. data/html/js/edit_area/langs/hr.js +2 -0
  74. data/html/js/edit_area/langs/it.js +2 -0
  75. data/html/js/edit_area/langs/ja.js +2 -0
  76. data/html/js/edit_area/langs/mk.js +2 -0
  77. data/html/js/edit_area/langs/nl.js +2 -0
  78. data/html/js/edit_area/langs/pl.js +2 -0
  79. data/html/js/edit_area/langs/pt.js +2 -0
  80. data/html/js/edit_area/langs/ru.js +2 -0
  81. data/html/js/edit_area/langs/sk.js +2 -0
  82. data/html/js/edit_area/langs/zh.js +67 -0
  83. data/html/js/edit_area/manage_area.js +362 -205
  84. data/html/js/edit_area/plugins/charmap/langs/bg.js +12 -0
  85. data/html/js/edit_area/plugins/charmap/langs/zh.js +6 -0
  86. data/html/js/edit_area/plugins/test/langs/bg.js +10 -0
  87. data/html/js/edit_area/plugins/test/langs/zh.js +4 -0
  88. data/html/js/edit_area/reg_syntax/java.js +56 -0
  89. data/html/js/edit_area/reg_syntax/ruby.js +9 -9
  90. data/html/js/edit_area/reg_syntax.js +15 -13
  91. data/html/js/edit_area/regexp.js +36 -32
  92. data/html/js/edit_area/resize_area.js +43 -47
  93. data/html/js/edit_area/search_replace.js +29 -29
  94. data/html/js/edit_area/template.html +6 -4
  95. data/html/js/json-broker-client.js +23 -17
  96. data/html/js/result-page.js +107 -57
  97. data/html/js/rt-setting-page.js +38 -15
  98. data/html/js/sidebar.js +41 -27
  99. data/html/js/templates.js +167 -32
  100. data/html/js/utils.js +143 -7
  101. data/html/js/yui/treeview.js +3671 -0
  102. data/html/swf/chart.swf +0 -0
  103. data/html/test/agent_editor_spec.js +815 -0
  104. data/html/test/index.html +40 -0
  105. data/html/test/jsspec/JSSpec.css +224 -0
  106. data/html/test/jsspec/JSSpec.js +1549 -0
  107. data/html/test/jsspec/diff_match_patch.js +1 -0
  108. data/html/test/utils_spec.js +111 -0
  109. data/lib/jiji/agent/agent.rb +69 -12
  110. data/lib/jiji/agent/agent_manager.rb +18 -12
  111. data/lib/jiji/agent/agent_registry.rb +35 -121
  112. data/lib/jiji/collector.rb +16 -6
  113. data/lib/jiji/command.rb +46 -5
  114. data/lib/jiji/dao/file_system_dao.rb +158 -0
  115. data/lib/jiji/dao/timed_data_dao.rb +2 -0
  116. data/lib/jiji/dao/trade_result_dao.rb +1 -1
  117. data/lib/jiji/error.rb +24 -8
  118. data/lib/jiji/migration/migrator1_2_0.rb +67 -0
  119. data/lib/jiji/models.rb +82 -24
  120. data/lib/jiji/operator.rb +55 -51
  121. data/lib/jiji/output.rb +85 -29
  122. data/lib/jiji/output_manager.rb +84 -0
  123. data/lib/jiji/plugin/embedded/single_click_client.rb +2 -2
  124. data/lib/jiji/plugin/securities_plugin.rb +0 -1
  125. data/lib/jiji/process.rb +229 -208
  126. data/lib/jiji/process_manager.rb +190 -96
  127. data/lib/jiji/registry.rb +87 -19
  128. data/lib/jiji/server.rb +1 -0
  129. data/lib/jiji/service/agent_service.rb +147 -48
  130. data/lib/jiji/service/output_service.rb +37 -17
  131. data/lib/jiji/service/process_service.rb +3 -5
  132. data/lib/jiji/service/trade_result_service.rb +4 -5
  133. data/lib/jiji/util/file_lock.rb +4 -4
  134. data/lib/jiji/util/include_proxy.rb +17 -0
  135. data/lib/jiji/util/json_broker.rb +6 -4
  136. data/lib/jiji/util/util.rb +1 -1
  137. data/swf/chart/fx/chart/Chart.as +7 -0
  138. data/swf/chart/fx/chart/ui/graph/GraphManager.as +15 -2
  139. data/test/ProcessTest/agents/foo.rb +10 -0
  140. data/test/ProcessTest/conf/configuration.yaml +3 -0
  141. data/test/agent/agent_tests.rb +10 -0
  142. data/test/agent/test_AgentManager.rb +28 -12
  143. data/test/agent/test_AgentRegistry.rb +194 -99
  144. data/test/agent/test_PeriodicallyAgent.rb +1 -2
  145. data/test/agent/test_Permitter.rb +1 -2
  146. data/test/all_tests.rb +7 -19
  147. data/test/dao/dao_tests.rb +9 -0
  148. data/test/dao/test_FileSystemDao.rb +431 -0
  149. data/test/dao/test_RateDao.rb +5 -7
  150. data/test/dao/test_TradeResultDao.rb +1 -2
  151. data/test/migration/migration_tests.rb +10 -0
  152. data/test/migration/migrator1_2_0test_data/basic/out/M2NlOTA2ODEtZDdlNi00NWU1LWIwNDQtMjBmODY2ZGNkNzBj/56e75YuV5bmz5Z2H57ea/meta.yaml +8 -0
  153. data/test/migration/migrator1_2_0test_data/basic/out/MDVhYzcxMjYtMGFlMS00Mzk0LWEyNmUtYjVjZjgwNDA0ZmE2/56e75YuV5bmz5Z2H57ea/meta.yaml +8 -0
  154. data/test/migration/migrator1_2_0test_data/basic/out/MzA1YTk0NDgtNzhjNi00NDk3LTk2NTktYzE1ZjBhNzdiYjNj/56e75YuV5bmz5Z2H57ea/meta.yaml +8 -0
  155. data/test/migration/migrator1_2_0test_data/basic/out/YjRkOTI1MzEtZTM4MS00YjQwLTg1ZTQtMWFmZDRlNDUwMzBm/56e75YuV5bmz5Z2H57ea/meta.yaml +9 -0
  156. data/test/migration/migrator1_2_0test_data/basic/props.yaml +85 -0
  157. data/test/migration/migrator1_2_0test_data/illegal_props/out/M2NlOTA2ODEtZDdlNi00NWU1LWIwNDQtMjBmODY2ZGNkNzBj/56e75YuV5bmz5Z2H57ea/meta.yaml +8 -0
  158. data/test/migration/migrator1_2_0test_data/illegal_props/out/MDVhYzcxMjYtMGFlMS00Mzk0LWEyNmUtYjVjZjgwNDA0ZmE2/56e75YuV5bmz5Z2H57ea/meta.yaml +8 -0
  159. data/test/migration/migrator1_2_0test_data/illegal_props/out/MzA1YTk0NDgtNzhjNi00NDk3LTk2NTktYzE1ZjBhNzdiYjNj/56e75YuV5bmz5Z2H57ea/meta.yaml +8 -0
  160. data/test/migration/migrator1_2_0test_data/illegal_props/out/YjRkOTI1MzEtZTM4MS00YjQwLTg1ZTQtMWFmZDRlNDUwMzBm/56e75YuV5bmz5Z2H57ea/meta.yaml +9 -0
  161. data/test/migration/migrator1_2_0test_data/illegal_props/props.yaml +1 -0
  162. data/test/migration/migrator1_2_0test_data/no_outs/props.yaml +85 -0
  163. data/test/migration/migrator1_2_0test_data/no_props/out/M2NlOTA2ODEtZDdlNi00NWU1LWIwNDQtMjBmODY2ZGNkNzBj/56e75YuV5bmz5Z2H57ea/meta.yaml +8 -0
  164. data/test/migration/migrator1_2_0test_data/no_props/out/MDVhYzcxMjYtMGFlMS00Mzk0LWEyNmUtYjVjZjgwNDA0ZmE2/56e75YuV5bmz5Z2H57ea/meta.yaml +8 -0
  165. data/test/migration/migrator1_2_0test_data/no_props/out/MzA1YTk0NDgtNzhjNi00NDk3LTk2NTktYzE1ZjBhNzdiYjNj/56e75YuV5bmz5Z2H57ea/meta.yaml +8 -0
  166. data/test/migration/migrator1_2_0test_data/no_props/out/YjRkOTI1MzEtZTM4MS00YjQwLTg1ZTQtMWFmZDRlNDUwMzBm/56e75YuV5bmz5Z2H57ea/meta.yaml +9 -0
  167. data/test/migration/test_Migrator.rb +1 -1
  168. data/test/migration/test_Migrator1_0_3.rb +1 -1
  169. data/test/migration/test_Migrator1_1_0.rb +1 -1
  170. data/test/migration/test_Migrator1_2_0.rb +94 -0
  171. data/test/plugin/embedded/test_SingleClickClient.rb +1 -2
  172. data/test/plugin/plugin_tests.rb +8 -0
  173. data/test/plugin/test_Loader.rb +1 -1
  174. data/test/shared/rate.csv +144 -0
  175. data/test/shared/shared_tests.rb +9 -0
  176. data/test/shared/test_Cross.rb +144 -0
  177. data/test/shared/test_PositionManager.rb +285 -0
  178. data/test/shared/test_Signal.rb +65 -0
  179. data/test/test_Output.rb +28 -21
  180. data/test/test_OutputManager.rb +162 -0
  181. data/test/test_Output_registry.rb +6 -17
  182. data/test/test_Process.rb +434 -222
  183. data/test/test_ProcessManager.rb +458 -101
  184. data/test/test_utils.rb +71 -8
  185. data/test/util/test_BlockToSession.rb +1 -2
  186. data/test/util/test_CSV.rb +1 -2
  187. data/test/util/test_SynchronizeInterceptor.rb +1 -2
  188. data/test/util/util_tests.rb +9 -0
  189. metadata +127 -47
  190. data/html/js/agent-editor-page.js +0 -440
  191. data/html/js/codepress/codepress.css +0 -21
  192. data/html/js/codepress/codepress.html +0 -35
  193. data/html/js/codepress/codepress.js +0 -138
  194. data/html/js/codepress/engines/gecko.js +0 -293
  195. data/html/js/codepress/engines/khtml.js +0 -0
  196. data/html/js/codepress/engines/msie.js +0 -304
  197. data/html/js/codepress/engines/older.js +0 -0
  198. data/html/js/codepress/engines/opera.js +0 -260
  199. data/html/js/codepress/images/line-numbers.gif +0 -0
  200. data/html/js/codepress/index.html +0 -443
  201. data/html/js/codepress/languages/asp.css +0 -71
  202. data/html/js/codepress/languages/asp.js +0 -117
  203. data/html/js/codepress/languages/autoit.css +0 -13
  204. data/html/js/codepress/languages/autoit.js +0 -32
  205. data/html/js/codepress/languages/csharp.css +0 -9
  206. data/html/js/codepress/languages/csharp.js +0 -25
  207. data/html/js/codepress/languages/css.css +0 -10
  208. data/html/js/codepress/languages/css.js +0 -23
  209. data/html/js/codepress/languages/generic.css +0 -9
  210. data/html/js/codepress/languages/generic.js +0 -25
  211. data/html/js/codepress/languages/html.css +0 -13
  212. data/html/js/codepress/languages/html.js +0 -59
  213. data/html/js/codepress/languages/java.css +0 -7
  214. data/html/js/codepress/languages/java.js +0 -24
  215. data/html/js/codepress/languages/javascript.css +0 -8
  216. data/html/js/codepress/languages/javascript.js +0 -30
  217. data/html/js/codepress/languages/perl.css +0 -11
  218. data/html/js/codepress/languages/perl.js +0 -27
  219. data/html/js/codepress/languages/php.css +0 -12
  220. data/html/js/codepress/languages/php.js +0 -61
  221. data/html/js/codepress/languages/ruby.css +0 -10
  222. data/html/js/codepress/languages/ruby.js +0 -26
  223. data/html/js/codepress/languages/sql.css +0 -10
  224. data/html/js/codepress/languages/sql.js +0 -30
  225. data/html/js/codepress/languages/text.css +0 -5
  226. data/html/js/codepress/languages/text.js +0 -9
  227. data/html/js/codepress/languages/vbscript.css +0 -71
  228. data/html/js/codepress/languages/vbscript.js +0 -117
  229. data/html/js/codepress/languages/xsl.css +0 -15
  230. data/html/js/codepress/languages/xsl.js +0 -103
  231. data/html/js/codepress/license.txt +0 -458
  232. data/html/js/edit_area/images/Thumbs.db +0 -0
  233. data/test/plugin/test_gem/a/lib/jiji_plugin_test.rb +0 -6
@@ -0,0 +1,85 @@
1
+ ---
2
+ trade_enable: true
3
+ agents:
4
+ - name: "\xE5\x90\x8D\xE7\xA7\xB0\xE6\x9C\xAA\xE8\xA8\xAD\xE5\xAE\x9A\xE3\x82\xA8\xE3\x83\xBC\xE3\x82\xB8\xE3\x82\xA7\xE3\x83\xB3\xE3\x83\x881"
5
+ class_name: MovingAverageAgent
6
+ class: MovingAverageAgent@moving_average_agent.rb
7
+ id: b4d92531-e381-4b40-85e4-1afd4e45030f
8
+ file_name: moving_average_agent.rb
9
+ description: "\xE7\xA7\xBB\xE5\x8B\x95\xE5\xB9\xB3\xE5\x9D\x87\xE3\x82\x92\xE4\xBD\xBF\xE3\x81\x86\xE3\x82\xA8\xE3\x83\xBC\xE3\x82\xB8\xE3\x82\xA7\xE3\x83\xB3\xE3\x83\x88\xE3\x81\xA7\xE3\x81\x99\xE3\x80\x82\n -\xE3\x82\xB4\xE3\x83\xBC\xE3\x83\xAB\xE3\x83\x87\xE3\x83\xB3\xE3\x82\xAF\xE3\x83\xAD\xE3\x82\xB9\xE3\x81\xA7\xE8\xB2\xB7\xE3\x81\x84&\xE5\xA3\xB2\xE3\x82\x8A\xE5\xBB\xBA\xE3\x81\xA6\xE7\x8E\x89\xE3\x82\x92\xE3\x82\xB3\xE3\x83\x9F\xE3\x83\x83\xE3\x83\x88\xE3\x80\x82\n -\xE3\x83\x87\xE3\x83\x83\xE3\x83\x89\xE3\x82\xAF\xE3\x83\xAD\xE3\x82\xB9\xE3\x81\xA7\xE5\xA3\xB2\xE3\x82\x8A&\xE8\xB2\xB7\xE3\x81\x84\xE5\xBB\xBA\xE3\x81\xA6\xE7\x8E\x89\xE3\x82\x92\xE3\x82\xB3\xE3\x83\x9F\xE3\x83\x83\xE3\x83\x88\xE3\x80\x82\n"
10
+ property_def:
11
+ period:
12
+ name: "\xE3\x83\xAC\xE3\x83\xBC\xE3\x83\x88\xE3\x81\xAE\xE9\x80\x9A\xE7\x9F\xA5\xE3\x82\x92\xE5\x8F\x97\xE3\x81\x91\xE5\x8F\x96\xE3\x82\x8B\xE9\x96\x93\xE9\x9A\x94(\xE5\x88\x86)"
13
+ default: 10
14
+ id: period
15
+ type: number
16
+ short:
17
+ name: "\xE7\x9F\xAD\xE6\x9C\x9F\xE7\xA7\xBB\xE5\x8B\x95\xE5\xB9\xB3\xE5\x9D\x87\xE7\xB7\x9A"
18
+ default: 25
19
+ id: short
20
+ type: number
21
+ long:
22
+ name: "\xE9\x95\xB7\xE6\x9C\x9F\xE7\xA7\xBB\xE5\x8B\x95\xE5\xB9\xB3\xE5\x9D\x87\xE7\xB7\x9A"
23
+ default: 75
24
+ id: long
25
+ type: number
26
+ state: ""
27
+ properties:
28
+ period: 10
29
+ short: 25
30
+ long: 75
31
+ - name: "\xE5\x90\x8D\xE7\xA7\xB0\xE6\x9C\xAA\xE8\xA8\xAD\xE5\xAE\x9A\xE3\x82\xA8\xE3\x83\xBC\xE3\x82\xB8\xE3\x82\xA7\xE3\x83\xB3\xE3\x83\x882"
32
+ class_name: MovingAverageAgent
33
+ class: MovingAverageAgent@moving_average_agent.rb
34
+ id: 305a9448-78c6-4497-9659-c15f0a77bb3c
35
+ file_name: moving_average_agent.rb
36
+ description: "\xE7\xA7\xBB\xE5\x8B\x95\xE5\xB9\xB3\xE5\x9D\x87\xE3\x82\x92\xE4\xBD\xBF\xE3\x81\x86\xE3\x82\xA8\xE3\x83\xBC\xE3\x82\xB8\xE3\x82\xA7\xE3\x83\xB3\xE3\x83\x88\xE3\x81\xA7\xE3\x81\x99\xE3\x80\x82\n -\xE3\x82\xB4\xE3\x83\xBC\xE3\x83\xAB\xE3\x83\x87\xE3\x83\xB3\xE3\x82\xAF\xE3\x83\xAD\xE3\x82\xB9\xE3\x81\xA7\xE8\xB2\xB7\xE3\x81\x84&\xE5\xA3\xB2\xE3\x82\x8A\xE5\xBB\xBA\xE3\x81\xA6\xE7\x8E\x89\xE3\x82\x92\xE3\x82\xB3\xE3\x83\x9F\xE3\x83\x83\xE3\x83\x88\xE3\x80\x82\n -\xE3\x83\x87\xE3\x83\x83\xE3\x83\x89\xE3\x82\xAF\xE3\x83\xAD\xE3\x82\xB9\xE3\x81\xA7\xE5\xA3\xB2\xE3\x82\x8A&\xE8\xB2\xB7\xE3\x81\x84\xE5\xBB\xBA\xE3\x81\xA6\xE7\x8E\x89\xE3\x82\x92\xE3\x82\xB3\xE3\x83\x9F\xE3\x83\x83\xE3\x83\x88\xE3\x80\x82\n"
37
+ property_def:
38
+ period:
39
+ name: "\xE3\x83\xAC\xE3\x83\xBC\xE3\x83\x88\xE3\x81\xAE\xE9\x80\x9A\xE7\x9F\xA5\xE3\x82\x92\xE5\x8F\x97\xE3\x81\x91\xE5\x8F\x96\xE3\x82\x8B\xE9\x96\x93\xE9\x9A\x94(\xE5\x88\x86)"
40
+ default: 10
41
+ id: period
42
+ type: number
43
+ short:
44
+ name: "\xE7\x9F\xAD\xE6\x9C\x9F\xE7\xA7\xBB\xE5\x8B\x95\xE5\xB9\xB3\xE5\x9D\x87\xE7\xB7\x9A"
45
+ default: 25
46
+ id: short
47
+ type: number
48
+ long:
49
+ name: "\xE9\x95\xB7\xE6\x9C\x9F\xE7\xA7\xBB\xE5\x8B\x95\xE5\xB9\xB3\xE5\x9D\x87\xE7\xB7\x9A"
50
+ default: 75
51
+ id: long
52
+ type: number
53
+ state: ""
54
+ properties:
55
+ period: 10
56
+ short: 25
57
+ long: 75
58
+ - name: "\xE5\x90\x8D\xE7\xA7\xB0\xE6\x9C\xAA\xE8\xA8\xAD\xE5\xAE\x9A\xE3\x82\xA8\xE3\x83\xBC\xE3\x82\xB8\xE3\x82\xA7\xE3\x83\xB3\xE3\x83\x882"
59
+ class_name: MovingAverageAgent
60
+ class: MovingAverageAgent@moving_average_agent.rb
61
+ id: 405a9448-78c6-4497-9659-c15f0a77bb3c
62
+ file_name: moving_average_agent.rb
63
+ description: "\xE7\xA7\xBB\xE5\x8B\x95\xE5\xB9\xB3\xE5\x9D\x87\xE3\x82\x92\xE4\xBD\xBF\xE3\x81\x86\xE3\x82\xA8\xE3\x83\xBC\xE3\x82\xB8\xE3\x82\xA7\xE3\x83\xB3\xE3\x83\x88\xE3\x81\xA7\xE3\x81\x99\xE3\x80\x82\n -\xE3\x82\xB4\xE3\x83\xBC\xE3\x83\xAB\xE3\x83\x87\xE3\x83\xB3\xE3\x82\xAF\xE3\x83\xAD\xE3\x82\xB9\xE3\x81\xA7\xE8\xB2\xB7\xE3\x81\x84&\xE5\xA3\xB2\xE3\x82\x8A\xE5\xBB\xBA\xE3\x81\xA6\xE7\x8E\x89\xE3\x82\x92\xE3\x82\xB3\xE3\x83\x9F\xE3\x83\x83\xE3\x83\x88\xE3\x80\x82\n -\xE3\x83\x87\xE3\x83\x83\xE3\x83\x89\xE3\x82\xAF\xE3\x83\xAD\xE3\x82\xB9\xE3\x81\xA7\xE5\xA3\xB2\xE3\x82\x8A&\xE8\xB2\xB7\xE3\x81\x84\xE5\xBB\xBA\xE3\x81\xA6\xE7\x8E\x89\xE3\x82\x92\xE3\x82\xB3\xE3\x83\x9F\xE3\x83\x83\xE3\x83\x88\xE3\x80\x82\n"
64
+ property_def:
65
+ period:
66
+ name: "\xE3\x83\xAC\xE3\x83\xBC\xE3\x83\x88\xE3\x81\xAE\xE9\x80\x9A\xE7\x9F\xA5\xE3\x82\x92\xE5\x8F\x97\xE3\x81\x91\xE5\x8F\x96\xE3\x82\x8B\xE9\x96\x93\xE9\x9A\x94(\xE5\x88\x86)"
67
+ default: 10
68
+ id: period
69
+ type: number
70
+ short:
71
+ name: "\xE7\x9F\xAD\xE6\x9C\x9F\xE7\xA7\xBB\xE5\x8B\x95\xE5\xB9\xB3\xE5\x9D\x87\xE7\xB7\x9A"
72
+ default: 25
73
+ id: short
74
+ type: number
75
+ long:
76
+ name: "\xE9\x95\xB7\xE6\x9C\x9F\xE7\xA7\xBB\xE5\x8B\x95\xE5\xB9\xB3\xE5\x9D\x87\xE7\xB7\x9A"
77
+ default: 75
78
+ id: long
79
+ type: number
80
+ state: ""
81
+ properties:
82
+ period: 10
83
+ short: 25
84
+ long: 75
85
+ state: :RUNNING
@@ -0,0 +1,8 @@
1
+ ---
2
+ :type: graph
3
+ :column_count: 2
4
+ :graph_type: :rate
5
+ :name: "\xE7\xA7\xBB\xE5\x8B\x95\xE5\xB9\xB3\xE5\x9D\x87\xE7\xB7\x9A"
6
+ :colors:
7
+ - "#779999"
8
+ - "#557777"
@@ -0,0 +1,8 @@
1
+ ---
2
+ :type: graph
3
+ :column_count: 2
4
+ :colors:
5
+ - "#779999"
6
+ - "#557777"
7
+ :graph_type: :rate
8
+ :name: "\xE7\xA7\xBB\xE5\x8B\x95\xE5\xB9\xB3\xE5\x9D\x87\xE7\xB7\x9A"
@@ -0,0 +1,8 @@
1
+ ---
2
+ :type: graph
3
+ :column_count: 2
4
+ :colors:
5
+ - "#779999"
6
+ - "#557777"
7
+ :graph_type: :rate
8
+ :name: "\xE7\xA7\xBB\xE5\x8B\x95\xE5\xB9\xB3\xE5\x9D\x87\xE7\xB7\x9A"
@@ -0,0 +1,9 @@
1
+ ---
2
+ :type: graph
3
+ :column_count: 2
4
+ :visible: true
5
+ :colors:
6
+ - "#553399"
7
+ - "#1177dd"
8
+ :graph_type: :rate
9
+ :name: "\xE7\xA7\xBB\xE5\x8B\x95\xE5\xB9\xB3\xE5\x9D\x87\xE7\xB7\x9A"
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/ruby
2
2
 
3
- $: << "../../lib"
3
+ $: << "../lib"
4
4
 
5
5
  require 'rubygems'
6
6
  require 'runit/testcase'
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/ruby
2
2
 
3
- $: << "../../lib"
3
+ $: << "../lib"
4
4
 
5
5
  require 'rubygems'
6
6
  require 'runit/testcase'
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/ruby
2
2
 
3
- $: << "../../lib"
3
+ $: << "../lib"
4
4
 
5
5
  require 'rubygems'
6
6
  require 'runit/testcase'
@@ -0,0 +1,94 @@
1
+ #!/usr/bin/ruby
2
+
3
+ $: << "../lib"
4
+
5
+ require 'rubygems'
6
+ require 'runit/testcase'
7
+ require 'runit/cui/testrunner'
8
+ require 'fileutils'
9
+ require 'logger'
10
+ require 'jiji/configuration'
11
+ require 'jiji/migration/migrator1_2_0'
12
+ require 'kconv'
13
+
14
+ # Migrator1_2_0 のテスト
15
+ class Migrator1_2_0Test < RUNIT::TestCase
16
+
17
+ def setup
18
+ @dir = File.dirname(__FILE__) + "/migrator1_2_0_test"
19
+ FileUtils.rm_rf @dir
20
+
21
+ @registry = {}
22
+ end
23
+
24
+ def teardown
25
+ FileUtils.rm_rf @dir
26
+ end
27
+
28
+ # 実際のデータを変更するテスト
29
+ def test_real_data
30
+ FileUtils.cp_r File.dirname(__FILE__) + "/migrator1_2_0test_data", @dir
31
+
32
+ # データ移行
33
+ m = JIJI::Migration::Migrator1_2_0.new
34
+ m.migrate( Struct.new( :process_dir, :server_logger ).new(
35
+ @dir, Logger.new(STDOUT) ) )
36
+
37
+ # 結果の確認
38
+ dir = "#{@dir}/basic/out"
39
+ out = JIJI::Output.new( "b4d92531-e381-4b40-85e4-1afd4e45030f", dir );
40
+ assert_equals out.agent_name, "名称未設定エージェント1"
41
+ assert_equals out.map{|o| o[1].options[:name]}, ["移動平均線"]
42
+
43
+ out = JIJI::Output.new( "305a9448-78c6-4497-9659-c15f0a77bb3c", dir );
44
+ assert_equals out.agent_name, "名称未設定エージェント2"
45
+ assert_equals out.map{|o| o[1].options[:name]}, ["移動平均線"]
46
+
47
+ out = JIJI::Output.new( "3ce90681-d7e6-45e5-b044-20f866dcd70c", dir );
48
+ assert_equals out.agent_name, "不明"
49
+ assert_equals out.map{|o| o[1].options[:name]}, ["移動平均線"]
50
+
51
+ out = JIJI::Output.new( "05ac7126-0ae1-4394-a26e-b5cf80404fa6", dir );
52
+ assert_equals out.agent_name, "不明"
53
+ assert_equals out.map{|o| o[1].options[:name]}, ["移動平均線"]
54
+
55
+
56
+ dir = "#{@dir}/illegal_props/out"
57
+ out = JIJI::Output.new( "b4d92531-e381-4b40-85e4-1afd4e45030f", dir );
58
+ assert_equals out.agent_name, "不明"
59
+ assert_equals out.map{|o| o[1].options[:name]}, ["移動平均線"]
60
+
61
+ out = JIJI::Output.new( "305a9448-78c6-4497-9659-c15f0a77bb3c", dir );
62
+ assert_equals out.agent_name, "不明"
63
+ assert_equals out.map{|o| o[1].options[:name]}, ["移動平均線"]
64
+
65
+ out = JIJI::Output.new( "3ce90681-d7e6-45e5-b044-20f866dcd70c", dir );
66
+ assert_equals out.agent_name, "不明"
67
+ assert_equals out.map{|o| o[1].options[:name]}, ["移動平均線"]
68
+
69
+ out = JIJI::Output.new( "05ac7126-0ae1-4394-a26e-b5cf80404fa6", dir );
70
+ assert_equals out.agent_name, "不明"
71
+ assert_equals out.map{|o| o[1].options[:name]}, ["移動平均線"]
72
+
73
+
74
+ dir = "#{@dir}/no_props/out"
75
+ out = JIJI::Output.new( "b4d92531-e381-4b40-85e4-1afd4e45030f", dir );
76
+ assert_equals out.agent_name, "不明"
77
+ assert_equals out.map{|o| o[1].options[:name]}, ["移動平均線"]
78
+
79
+ out = JIJI::Output.new( "305a9448-78c6-4497-9659-c15f0a77bb3c", dir );
80
+ assert_equals out.agent_name, "不明"
81
+ assert_equals out.map{|o| o[1].options[:name]}, ["移動平均線"]
82
+
83
+ out = JIJI::Output.new( "3ce90681-d7e6-45e5-b044-20f866dcd70c", dir );
84
+ assert_equals out.agent_name, "不明"
85
+ assert_equals out.map{|o| o[1].options[:name]}, ["移動平均線"]
86
+
87
+ out = JIJI::Output.new( "05ac7126-0ae1-4394-a26e-b5cf80404fa6", dir );
88
+ assert_equals out.agent_name, "不明"
89
+ assert_equals out.map{|o| o[1].options[:name]}, ["移動平均線"]
90
+
91
+ end
92
+
93
+ end
94
+
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/ruby
2
2
 
3
- $: << "../../"
4
- $: << "../../../lib"
3
+ $: << "../lib"
5
4
 
6
5
  require "runit/testcase"
7
6
  require "runit/cui/testrunner"
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/ruby
2
+
3
+ require 'rubygems'
4
+ require 'runit/testcase'
5
+ require 'runit/cui/testrunner'
6
+
7
+ require 'plugin/test_Loader'
8
+ #require 'plugin/embedded/test_SingleClickClient'
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/ruby
2
2
 
3
- $: << "../../lib"
3
+ $: << "../lib"
4
4
  $: << File.dirname(__FILE__) + "/test"
5
5
  $: << File.dirname(__FILE__) + "/error_test"
6
6
 
@@ -0,0 +1,144 @@
1
+ 137.94,137.81,137.96,137.74,137.96,137.83,137.98,137.75,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244731800,1244732400,1244732400
2
+ 137.8,137.58,137.81,137.57,137.82,137.6,137.83,137.59,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244732400,1244733000,1244733000
3
+ 137.6,137.8,137.82,137.57,137.62,137.81,137.83,137.59,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244733000,1244733600,1244733600
4
+ 137.78,137.92,137.92,137.78,137.8,137.94,137.94,137.8,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244733600,1244734200,1244734200
5
+ 137.92,137.86,137.95,137.82,137.93,137.87,137.97,137.84,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244734200,1244734800,1244734800
6
+ 137.87,137.87,137.89,137.8,137.89,137.89,137.9,137.82,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244734800,1244735400,1244735400
7
+ 137.88,137.87,137.97,137.85,137.9,137.89,137.98,137.87,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244735400,1244736000,1244736000
8
+ 137.86,137.84,137.87,137.8,137.88,137.85,137.89,137.82,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244736000,1244736600,1244736600
9
+ 137.82,137.85,137.9,137.8,137.84,137.86,137.92,137.82,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244736600,1244737200,1244737200
10
+ 137.82,137.82,137.91,137.79,137.84,137.84,137.93,137.81,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244737200,1244737800,1244737800
11
+ 137.82,137.85,137.87,137.76,137.84,137.87,137.89,137.77,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244737800,1244738400,1244738400
12
+ 137.84,137.82,137.9,137.8,137.86,137.84,137.92,137.81,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244738400,1244739000,1244739000
13
+ 137.84,137.83,137.98,137.78,137.86,137.85,138.0,137.8,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244739000,1244739600,1244739600
14
+ 137.83,137.66,137.91,137.58,137.85,137.68,137.93,137.6,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244739600,1244740200,1244740200
15
+ 137.66,137.64,137.68,137.52,137.68,137.66,137.69,137.54,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244740200,1244740800,1244740800
16
+ 137.68,137.81,137.84,137.64,137.7,137.83,137.86,137.66,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244740800,1244741400,1244741400
17
+ 137.82,137.79,137.93,137.75,137.84,137.81,137.94,137.77,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244741400,1244742000,1244742000
18
+ 137.81,137.81,137.9,137.78,137.83,137.83,137.91,137.79,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244742000,1244742600,1244742600
19
+ 137.81,137.86,137.94,137.81,137.83,137.88,137.95,137.83,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244742600,1244743200,1244743200
20
+ 137.87,137.87,137.9,137.8,137.89,137.89,137.91,137.82,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244743200,1244743800,1244743800
21
+ 137.87,137.88,137.9,137.79,137.89,137.89,137.92,137.81,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244743800,1244744400,1244744400
22
+ 137.87,137.92,137.93,137.84,137.89,137.94,137.95,137.85,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244744400,1244745000,1244745000
23
+ 137.9,137.87,137.96,137.86,137.92,137.89,137.98,137.88,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244745000,1244745600,1244745600
24
+ 137.87,137.79,137.87,137.75,137.89,137.81,137.89,137.77,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244745600,1244746200,1244746200
25
+ 137.78,137.79,137.83,137.73,137.8,137.81,137.85,137.75,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244746200,1244746800,1244746800
26
+ 137.79,137.82,137.83,137.71,137.81,137.83,137.85,137.73,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244746800,1244747400,1244747400
27
+ 137.8,137.83,137.89,137.78,137.82,137.84,137.9,137.8,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244747400,1244748000,1244748000
28
+ 137.82,137.85,137.86,137.78,137.84,137.87,137.88,137.8,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244748000,1244748600,1244748600
29
+ 137.82,137.79,137.82,137.72,137.84,137.81,137.84,137.74,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244748600,1244749200,1244749200
30
+ 137.78,137.79,137.81,137.75,137.8,137.81,137.83,137.76,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244749200,1244749800,1244749800
31
+ 137.79,137.67,137.8,137.63,137.81,137.69,137.81,137.65,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244749800,1244750400,1244750400
32
+ 137.66,137.61,137.66,137.6,137.68,137.62,137.68,137.62,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244750400,1244751000,1244751000
33
+ 137.63,137.68,137.74,137.62,137.64,137.7,137.76,137.63,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244751000,1244751600,1244751600
34
+ 137.65,137.69,137.74,137.64,137.67,137.71,137.75,137.66,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244751600,1244752200,1244752200
35
+ 137.69,137.71,137.73,137.68,137.7,137.73,137.74,137.7,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244752200,1244752800,1244752800
36
+ 137.68,137.71,137.74,137.68,137.73,137.81,137.81,137.73,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244752800,1244753400,1244753400
37
+ 137.72,137.68,137.75,137.66,137.77,137.78,137.83,137.71,-43.0,-43.0,-43.0,-43.0,39.0,39.0,39.0,39.0,1244753400,1244754000,1244754000
38
+ 137.69,137.63,137.76,137.63,137.79,137.65,137.83,137.65,-43.0,-41.0,-41.0,-43.0,39.0,37.0,39.0,37.0,1244754000,1244754600,1244754600
39
+ 137.62,137.62,137.7,137.6,137.64,137.64,137.72,137.62,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244754600,1244755200,1244755200
40
+ 137.63,137.63,137.67,137.62,137.65,137.65,137.68,137.64,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244755200,1244755800,1244755800
41
+ 137.63,137.65,137.69,137.62,137.65,137.66,137.71,137.64,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244755800,1244756400,1244756400
42
+ 137.67,137.69,137.69,137.6,137.69,137.7,137.71,137.61,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244756400,1244757000,1244757000
43
+ 137.69,137.76,137.77,137.67,137.71,137.78,137.79,137.69,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244757000,1244757600,1244757600
44
+ 137.76,137.76,137.78,137.73,137.77,137.78,137.8,137.75,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244757600,1244758200,1244758200
45
+ 137.76,137.81,137.81,137.75,137.78,137.82,137.82,137.77,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244758200,1244758800,1244758800
46
+ 137.77,137.79,137.85,137.77,137.79,137.81,137.87,137.79,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244758800,1244759400,1244759400
47
+ 137.8,137.81,137.82,137.78,137.81,137.83,137.84,137.8,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244759400,1244760000,1244760000
48
+ 137.81,137.76,137.81,137.7,137.83,137.78,137.83,137.72,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244760000,1244760600,1244760600
49
+ 137.76,137.75,137.81,137.74,137.77,137.77,137.83,137.76,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244760600,1244761200,1244761200
50
+ 137.76,137.66,137.79,137.66,137.78,137.67,137.81,137.67,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244761200,1244761800,1244761800
51
+ 137.66,137.68,137.73,137.66,137.68,137.7,137.75,137.67,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244761800,1244762400,1244762400
52
+ 137.69,137.66,137.72,137.65,137.71,137.68,137.74,137.67,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244762400,1244763000,1244763000
53
+ 137.66,137.69,137.72,137.66,137.67,137.71,137.74,137.67,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244763000,1244763600,1244763600
54
+ 137.69,137.75,137.78,137.69,137.71,137.76,137.8,137.71,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244763600,1244764200,1244764200
55
+ 137.75,137.79,137.8,137.71,137.77,137.81,137.82,137.73,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244764200,1244764800,1244764800
56
+ 137.79,137.78,137.84,137.73,137.81,137.8,137.86,137.75,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244764800,1244765400,1244765400
57
+ 137.78,137.84,137.86,137.76,137.8,137.86,137.88,137.77,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244765400,1244766000,1244766000
58
+ 137.87,137.81,137.96,137.77,137.88,137.83,137.98,137.79,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244766000,1244766600,1244766600
59
+ 137.84,137.76,137.87,137.69,137.86,137.78,137.89,137.71,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244766600,1244767200,1244767200
60
+ 137.77,137.84,137.84,137.73,137.79,137.86,137.86,137.75,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244767200,1244767800,1244767800
61
+ 137.86,137.83,137.93,137.83,137.88,137.85,137.94,137.85,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244767800,1244768400,1244768400
62
+ 137.82,137.92,137.93,137.81,137.84,137.94,137.95,137.83,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244768400,1244769000,1244769000
63
+ 137.9,137.95,138.02,137.89,137.92,137.96,138.04,137.91,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244769000,1244769600,1244769600
64
+ 137.96,137.98,138.02,137.9,137.98,138.0,138.04,137.92,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244769600,1244770200,1244770200
65
+ 138.0,137.95,138.01,137.95,138.02,137.96,138.03,137.96,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244770200,1244770800,1244770800
66
+ 137.95,137.86,137.95,137.84,137.96,137.88,137.96,137.86,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244770800,1244771400,1244771400
67
+ 137.87,137.87,137.91,137.79,137.89,137.89,137.93,137.81,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244771400,1244772000,1244772000
68
+ 137.88,137.92,138.06,137.86,137.89,137.93,138.08,137.88,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244772000,1244772600,1244772600
69
+ 137.92,137.94,137.99,137.89,137.94,137.96,138.01,137.9,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244772600,1244773200,1244773200
70
+ 137.95,137.91,137.98,137.9,137.96,137.92,138.0,137.91,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244773200,1244773800,1244773800
71
+ 137.91,137.84,137.91,137.83,137.93,137.86,137.93,137.85,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244773800,1244774400,1244774400
72
+ 137.84,137.86,137.93,137.82,137.86,137.88,137.95,137.84,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244774400,1244775000,1244775000
73
+ 137.86,137.93,137.96,137.85,137.87,137.95,137.98,137.86,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244775000,1244775600,1244775600
74
+ 137.94,137.95,137.97,137.93,137.96,137.97,137.99,137.95,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244775600,1244776200,1244776200
75
+ 137.95,137.87,137.95,137.82,137.97,137.89,137.97,137.84,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244776200,1244776800,1244776800
76
+ 137.86,137.82,137.86,137.79,137.88,137.84,137.88,137.81,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244776800,1244777400,1244777400
77
+ 137.81,137.84,137.87,137.8,137.83,137.85,137.89,137.82,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244777400,1244778000,1244778000
78
+ 137.85,137.81,137.86,137.74,137.87,137.83,137.88,137.76,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244778000,1244778600,1244778600
79
+ 137.81,137.82,137.86,137.74,137.83,137.84,137.87,137.76,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244778600,1244779200,1244779200
80
+ 137.83,137.68,137.83,137.66,137.85,137.7,137.85,137.68,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244779200,1244779800,1244779800
81
+ 137.68,137.7,137.74,137.67,137.7,137.72,137.76,137.69,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244779800,1244780400,1244780400
82
+ 137.72,137.74,137.79,137.69,137.74,137.76,137.8,137.71,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244780400,1244781000,1244781000
83
+ 137.74,137.81,137.82,137.68,137.76,137.83,137.84,137.7,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244781000,1244781600,1244781600
84
+ 137.81,137.8,137.83,137.75,137.82,137.82,137.85,137.76,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244781600,1244782200,1244782200
85
+ 137.8,137.78,137.82,137.74,137.82,137.79,137.83,137.76,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244782200,1244782800,1244782800
86
+ 137.79,137.85,137.91,137.78,137.8,137.87,137.93,137.8,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244782800,1244783400,1244783400
87
+ 137.88,137.9,137.93,137.81,137.89,137.92,137.95,137.82,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244783400,1244784000,1244784000
88
+ 137.91,137.87,137.98,137.87,137.92,137.89,138.0,137.89,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244784000,1244784600,1244784600
89
+ 137.86,137.92,137.93,137.8,137.88,137.94,137.95,137.81,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244784600,1244785200,1244785200
90
+ 137.92,137.83,137.92,137.8,137.93,137.85,137.94,137.82,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244785200,1244785800,1244785800
91
+ 137.84,137.88,137.9,137.83,137.86,137.9,137.92,137.85,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244785800,1244786400,1244786400
92
+ 137.87,137.99,138.01,137.87,137.89,138.01,138.02,137.88,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244786400,1244787000,1244787000
93
+ 137.99,138.12,138.21,137.98,138.01,138.13,138.22,138.0,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244787000,1244787600,1244787600
94
+ 138.15,138.09,138.17,138.08,138.17,138.1,138.19,138.1,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244787600,1244788200,1244788200
95
+ 138.1,138.13,138.24,138.1,138.12,138.15,138.26,138.12,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244788200,1244788800,1244788800
96
+ 138.13,138.17,138.28,138.13,138.14,138.19,138.29,138.14,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244788800,1244789400,1244789400
97
+ 138.17,138.18,138.18,138.04,138.19,138.2,138.2,138.05,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244789400,1244790000,1244790000
98
+ 138.19,137.89,138.21,137.86,138.21,137.91,138.23,137.87,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244790000,1244790600,1244790600
99
+ 137.89,137.76,138.01,137.7,137.91,137.77,138.03,137.72,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244790600,1244791200,1244791200
100
+ 137.75,137.76,137.92,137.75,137.77,137.77,137.94,137.77,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244791200,1244791800,1244791800
101
+ 137.73,137.71,137.79,137.66,137.75,137.72,137.81,137.68,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244791800,1244792400,1244792400
102
+ 137.7,137.83,137.94,137.7,137.72,137.85,137.96,137.72,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244792400,1244793000,1244793000
103
+ 137.81,137.87,137.87,137.71,137.83,137.89,137.89,137.73,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244793000,1244793600,1244793600
104
+ 137.87,137.91,138.01,137.87,137.89,137.93,138.02,137.89,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244793600,1244794200,1244794200
105
+ 137.9,137.88,137.93,137.82,137.92,137.9,137.95,137.84,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244794200,1244794800,1244794800
106
+ 137.87,137.77,137.93,137.77,137.89,137.79,137.95,137.79,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244794800,1244795400,1244795400
107
+ 137.77,137.82,137.85,137.75,137.79,137.84,137.87,137.77,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244795400,1244796000,1244796000
108
+ 137.84,137.86,137.91,137.78,137.85,137.87,137.93,137.8,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244796000,1244796600,1244796600
109
+ 137.86,137.8,137.91,137.8,137.88,137.82,137.93,137.82,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244796600,1244797200,1244797200
110
+ 137.85,137.78,137.91,137.75,137.87,137.8,137.93,137.77,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244797200,1244797800,1244797800
111
+ 137.79,137.83,137.84,137.68,137.8,137.85,137.85,137.7,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244797800,1244798400,1244798400
112
+ 137.84,137.87,137.92,137.81,137.85,137.88,137.94,137.83,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244798400,1244799000,1244799000
113
+ 137.86,137.76,137.89,137.75,137.88,137.78,137.91,137.76,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244799000,1244799600,1244799600
114
+ 137.71,137.7,137.79,137.65,137.73,137.72,137.81,137.67,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244799600,1244800200,1244800200
115
+ 137.71,137.85,137.89,137.71,137.73,137.87,137.91,137.73,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244800200,1244800800,1244800800
116
+ 137.86,137.81,137.86,137.77,137.88,137.83,137.88,137.79,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244800800,1244801400,1244801400
117
+ 137.81,137.91,137.95,137.79,137.83,137.93,137.97,137.81,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244801400,1244802000,1244802000
118
+ 137.92,137.82,137.94,137.76,137.94,137.84,137.96,137.78,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244802000,1244802600,1244802600
119
+ 137.81,137.8,137.88,137.75,137.83,137.82,137.89,137.77,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244802600,1244803200,1244803200
120
+ 137.8,137.75,137.81,137.72,137.82,137.77,137.82,137.74,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244803200,1244803800,1244803800
121
+ 137.75,137.79,137.81,137.73,137.77,137.81,137.83,137.75,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244803800,1244804400,1244804400
122
+ 137.8,137.76,137.8,137.74,137.82,137.78,137.82,137.76,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244804400,1244805000,1244805000
123
+ 137.77,137.51,137.77,137.49,137.79,137.52,137.79,137.51,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244805000,1244805600,1244805600
124
+ 137.52,137.38,137.55,137.38,137.54,137.4,137.57,137.4,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244805600,1244806200,1244806200
125
+ 137.41,137.58,137.58,137.36,137.43,137.6,137.6,137.38,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244806200,1244806800,1244806800
126
+ 137.59,137.41,137.6,137.34,137.6,137.42,137.62,137.36,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244806800,1244807400,1244807400
127
+ 137.42,137.57,137.62,137.42,137.44,137.59,137.64,137.44,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244807400,1244808000,1244808000
128
+ 137.55,137.44,137.66,137.44,137.56,137.46,137.68,137.46,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244808000,1244808600,1244808600
129
+ 137.45,137.62,137.65,137.41,137.47,137.64,137.66,137.42,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244808600,1244809200,1244809200
130
+ 137.63,137.48,137.68,137.28,137.65,137.5,137.69,137.29,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244809200,1244809800,1244809800
131
+ 137.44,137.3,137.46,137.21,137.46,137.31,137.48,137.23,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244809800,1244810400,1244810400
132
+ 137.31,137.06,137.31,137.05,137.33,137.08,137.33,137.06,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244810400,1244811000,1244811000
133
+ 137.06,137.22,137.26,137.01,137.07,137.24,137.28,137.03,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244811000,1244811600,1244811600
134
+ 137.22,137.38,137.42,137.22,137.24,137.4,137.43,137.24,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244811600,1244812200,1244812200
135
+ 137.35,137.39,137.42,137.3,137.37,137.41,137.44,137.32,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244812200,1244812800,1244812800
136
+ 137.38,137.13,137.42,137.13,137.4,137.15,137.44,137.15,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244812800,1244813400,1244813400
137
+ 137.19,137.06,137.21,136.87,137.2,137.08,137.23,136.89,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244813400,1244814000,1244814000
138
+ 137.09,137.08,137.14,137.03,137.11,137.09,137.15,137.05,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244814000,1244814600,1244814600
139
+ 137.08,137.0,137.2,137.0,137.1,137.02,137.22,137.02,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244814600,1244815200,1244815200
140
+ 136.96,137.15,137.18,136.9,136.98,137.17,137.2,136.92,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244815200,1244815800,1244815800
141
+ 137.14,137.26,137.31,137.12,137.16,137.28,137.33,137.14,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244815800,1244816400,1244816400
142
+ 137.27,137.3,137.38,137.2,137.29,137.32,137.39,137.21,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244816400,1244817000,1244817000
143
+ 137.27,137.37,137.42,137.18,137.29,137.39,137.44,137.2,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244817000,1244817600,1244817600
144
+ 137.43,137.44,137.56,137.42,137.45,137.46,137.58,137.44,-41.0,-41.0,-41.0,-41.0,37.0,37.0,37.0,37.0,1244817600,1244818200,1244818200
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/ruby
2
+
3
+ require 'rubygems'
4
+ require 'runit/testcase'
5
+ require 'runit/cui/testrunner'
6
+
7
+ require 'shared/test_Cross'
8
+ require 'shared/test_Signal'
9
+ require 'shared/test_PositionManager'
@@ -0,0 +1,144 @@
1
+ #!/usr/bin/ruby
2
+
3
+ $: << "../lib"
4
+ $: << "../base/shared_lib"
5
+
6
+ require 'rubygems'
7
+ require 'runit/testcase'
8
+ require 'runit/cui/testrunner'
9
+ require 'system/cross'
10
+
11
+ class CrossTest < RUNIT::TestCase
12
+
13
+ def test_cross
14
+ cross = Cross.new
15
+ assert_equals( cross.trend, 0 )
16
+ assert_equals( cross.cross, :none )
17
+ assert_equals( cross.up?, false )
18
+ assert_equals( cross.down?, false )
19
+ assert_equals( cross.cross_up?, false )
20
+ assert_equals( cross.cross_down?, false )
21
+
22
+ result = cross.next_data( 100, 110 )
23
+ assert_equals( result, {:cross=>:none, :trend=>-1} )
24
+ assert_equals( cross.trend, -1 )
25
+ assert_equals( cross.cross, :none )
26
+ assert_equals( cross.up?, false )
27
+ assert_equals( cross.down?, true )
28
+ assert_equals( cross.cross_up?, false )
29
+ assert_equals( cross.cross_down?, false )
30
+
31
+ result = cross.next_data( 95, 105 )
32
+ assert_equals( result, {:cross=>:none, :trend=>-1} )
33
+ assert_equals( cross.trend, -1 )
34
+ assert_equals( cross.cross, :none )
35
+ assert_equals( cross.up?, false )
36
+ assert_equals( cross.down?, true )
37
+ assert_equals( cross.cross_up?, false )
38
+ assert_equals( cross.cross_down?, false )
39
+
40
+ # 反転したらフラグが1度だけ立つ
41
+ result = cross.next_data( 105, 100 )
42
+ assert_equals( result, {:cross=>:up, :trend=>1} )
43
+ assert_equals( cross.trend, 1 )
44
+ assert_equals( cross.cross, :up )
45
+ assert_equals( cross.up?, true )
46
+ assert_equals( cross.down?, false )
47
+ assert_equals( cross.cross_up?, true )
48
+ assert_equals( cross.cross_down?, false )
49
+
50
+ result = cross.next_data( 110, 105 )
51
+ assert_equals( result, {:cross=>:none, :trend=>1} )
52
+ assert_equals( cross.trend, 1 )
53
+ assert_equals( cross.cross, :none )
54
+ assert_equals( cross.up?, true )
55
+ assert_equals( cross.down?, false )
56
+ assert_equals( cross.cross_up?, false )
57
+ assert_equals( cross.cross_down?, false )
58
+
59
+ result = cross.next_data( 115, 110 )
60
+ assert_equals( result, {:cross=>:none, :trend=>1} )
61
+ assert_equals( cross.trend, 1 )
62
+ assert_equals( cross.cross, :none )
63
+ assert_equals( cross.up?, true )
64
+ assert_equals( cross.down?, false )
65
+ assert_equals( cross.cross_up?, false )
66
+ assert_equals( cross.cross_down?, false )
67
+
68
+ # 同じになっただけでは、クロスアップ/ダウンフラグは立たない
69
+ result = cross.next_data( 115, 115 )
70
+ assert_equals( result, {:cross=>:none, :trend=>0} )
71
+ assert_equals( cross.trend, 0 )
72
+ assert_equals( cross.cross, :none )
73
+ assert_equals( cross.up?, false )
74
+ assert_equals( cross.down?, false )
75
+ assert_equals( cross.cross_up?, false )
76
+ assert_equals( cross.cross_down?, false )
77
+
78
+ result = cross.next_data( 115, 115 )
79
+ assert_equals( result, {:cross=>:none, :trend=>0} )
80
+ assert_equals( cross.trend, 0 )
81
+ assert_equals( cross.cross, :none )
82
+ assert_equals( cross.up?, false )
83
+ assert_equals( cross.down?, false )
84
+ assert_equals( cross.cross_up?, false )
85
+ assert_equals( cross.cross_down?, false )
86
+
87
+ # 反転したタイミンクでフラグが立つ
88
+ result = cross.next_data( 115, 120 )
89
+ assert_equals( result, {:cross=>:down, :trend=>-1} )
90
+ assert_equals( cross.trend, -1 )
91
+ assert_equals( cross.cross, :down )
92
+ assert_equals( cross.up?, false )
93
+ assert_equals( cross.down?, true )
94
+ assert_equals( cross.cross_up?, false )
95
+ assert_equals( cross.cross_down?, true )
96
+
97
+ result = cross.next_data( 120, 125 )
98
+ assert_equals( result, {:cross=>:none, :trend=>-1} )
99
+ assert_equals( cross.trend, -1 )
100
+ assert_equals( cross.cross, :none )
101
+ assert_equals( cross.up?, false )
102
+ assert_equals( cross.down?, true )
103
+ assert_equals( cross.cross_up?, false )
104
+ assert_equals( cross.cross_down?, false )
105
+
106
+ # 同じになって元に戻った場合
107
+ # クロスアップフラグは立たない。
108
+ result = cross.next_data( 120, 120 )
109
+ assert_equals( result, {:cross=>:none, :trend=>0} )
110
+ assert_equals( cross.trend, 0 )
111
+ assert_equals( cross.cross, :none )
112
+ assert_equals( cross.up?, false )
113
+ assert_equals( cross.down?, false )
114
+ assert_equals( cross.cross_up?, false )
115
+ assert_equals( cross.cross_down?, false )
116
+
117
+ result = cross.next_data( 115, 115 )
118
+ assert_equals( result, {:cross=>:none, :trend=>0} )
119
+ assert_equals( cross.trend, 0 )
120
+ assert_equals( cross.cross, :none )
121
+ assert_equals( cross.up?, false )
122
+ assert_equals( cross.down?, false )
123
+ assert_equals( cross.cross_up?, false )
124
+ assert_equals( cross.cross_down?, false )
125
+
126
+ result = cross.next_data( 120, 125 )
127
+ assert_equals( result, {:cross=>:down, :trend=>-1} )
128
+ assert_equals( cross.trend, -1 )
129
+ assert_equals( cross.cross, :down )
130
+ assert_equals( cross.up?, false )
131
+ assert_equals( cross.down?, true )
132
+ assert_equals( cross.cross_up?, false )
133
+ assert_equals( cross.cross_down?, true )
134
+
135
+ result = cross.next_data( 120, 125 )
136
+ assert_equals( result, {:cross=>:none, :trend=>-1} )
137
+ assert_equals( cross.trend, -1 )
138
+ assert_equals( cross.cross, :none )
139
+ assert_equals( cross.up?, false )
140
+ assert_equals( cross.down?, true )
141
+ assert_equals( cross.cross_up?, false )
142
+ assert_equals( cross.cross_down?, false )
143
+ end
144
+ end