unageanu-jiji 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +5 -2
- data/lib/jiji/migration/migrator.rb +50 -0
- data/lib/jiji/migration/migrator1_0_3.rb +26 -0
- data/lib/jiji/output.rb +5 -5
- data/lib/jiji/registry.rb +20 -0
- data/lib/jiji/server.rb +5 -0
- data/test/all_tests.rb +3 -0
- data/test/migration/migrator1_0_3test_data/rmt/out/M2NlOTA2ODEtZDdlNi00NWU1LWIwNDQtMjBmODY2ZGNkNzBj/56e75YuV5bmz5Z2H57ea/meta.yaml +8 -0
- data/test/migration/migrator1_0_3test_data/rmt/out/NjM5YWFhZmQtNDFjNy00NjUxLWIwYmItNTc3ZjAyZTg5ODA5/56e75YuV5bmz5Z2H57ea/meta.yaml +12 -0
- data/test/migration/migrator1_0_3test_data/rmt/out/NjM5YWFhZmQtNDFjNy00NjUxLWIwYmItNTc3ZjAyZTg5ODA5/56e75Yuasdwqdd/meta.yaml +12 -0
- data/test/migration/test_Migrator.rb +117 -0
- data/test/migration/test_Migrator1_0_3.rb +118 -0
- data/test/test_Output.rb +11 -11
- metadata +13 -1
data/ChangeLog
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
|
2
|
-
2009-4-
|
2
|
+
2009-4-19 1.0.3
|
3
|
+
* グラフの色を変更してもリロードすると元に戻る不具合を修正。
|
4
|
+
|
5
|
+
2009-4-14 1.0.2
|
3
6
|
* 以下の不具合を修正。
|
4
7
|
- システムを再起動すると、動作中のエージェントが全て停止状態となる。
|
5
8
|
- リアルトレードで建玉にエージェント名が設定されない場合がある。
|
6
9
|
- リアルトレードで追加したエージェントのグラフ設定ができない。
|
7
10
|
- 月の初めに、取引一覧の範囲絞込みの初期値が不正な値になる。
|
8
11
|
|
9
|
-
2009-3-29
|
12
|
+
2009-3-29 1.0.0
|
10
13
|
* 初版リリース
|
@@ -0,0 +1,50 @@
|
|
1
|
+
|
2
|
+
require 'rubygems'
|
3
|
+
require 'fileutils'
|
4
|
+
require 'logger'
|
5
|
+
require 'jiji/util/file_lock'
|
6
|
+
|
7
|
+
module JIJI
|
8
|
+
module Migration
|
9
|
+
|
10
|
+
#==サーバー起動時にデータ移行を行うクラス。
|
11
|
+
class Migrator
|
12
|
+
|
13
|
+
#データを移行する。
|
14
|
+
def migrate
|
15
|
+
logger = server_logger
|
16
|
+
begin
|
17
|
+
data_version = version
|
18
|
+
new_version = data_version
|
19
|
+
tmp = nil
|
20
|
+
@migrators.sort_by {|item| item[:version] }.each {|d|
|
21
|
+
tmp = d[:version]
|
22
|
+
if ( data_version < d[:version] )
|
23
|
+
d[:migrator].migrate(registry)
|
24
|
+
new_version = d[:version]
|
25
|
+
logger.info "data migration succesful! new_version=#{new_version.to_s}."
|
26
|
+
end
|
27
|
+
}
|
28
|
+
rescue Exception
|
29
|
+
logger.error "data migration failed. current=#{data_version.to_s} new_version=#{tmp.to_s}"
|
30
|
+
logger.error $!
|
31
|
+
ensure
|
32
|
+
FileLock.new( version_file ).writelock {|f| f << new_version.to_s }
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
# 現在のデータバージョンを取得する。
|
37
|
+
def version
|
38
|
+
version_str = File.exist?(version_file) ?
|
39
|
+
FileLock.new( version_file ).readlock {|f| f.read } : "1.0.0"
|
40
|
+
return Gem::Version.new( version_str )
|
41
|
+
end
|
42
|
+
|
43
|
+
attr :migrators, true
|
44
|
+
attr :server_logger, true
|
45
|
+
attr :version_file, true
|
46
|
+
attr :registry, true
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
|
2
|
+
require 'fileutils'
|
3
|
+
require 'yaml'
|
4
|
+
require 'jiji/util/fix_yaml_bug'
|
5
|
+
require 'jiji/util/file_lock'
|
6
|
+
|
7
|
+
module JIJI
|
8
|
+
module Migration
|
9
|
+
|
10
|
+
#===1.0.0 → 1.0.3
|
11
|
+
class Migrator1_0_3
|
12
|
+
def migrate( registry )
|
13
|
+
# outputのプロパティキーを変換
|
14
|
+
Dir.glob( "#{registry.process_dir}/*/out/**/meta.yaml").each {|meta|
|
15
|
+
props = YAML.load_file meta
|
16
|
+
props = props.inject({}) {|r,p| r[p[0].to_sym] = p[1]; r }
|
17
|
+
FileLock.new( meta ).writelock { |f|
|
18
|
+
f.write( YAML.dump( props ) )
|
19
|
+
}
|
20
|
+
}
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
data/lib/jiji/output.rb
CHANGED
@@ -26,8 +26,8 @@ module JIJI
|
|
26
26
|
next unless File.directory? d
|
27
27
|
next unless File.exist? "#{d}/meta.yaml"
|
28
28
|
props = YAML.load_file "#{d}/meta.yaml"
|
29
|
-
@outs[props[
|
30
|
-
create_output( d, props[
|
29
|
+
@outs[props[:name]] =
|
30
|
+
create_output( d, props[:name], props[:type].to_sym, props )
|
31
31
|
}
|
32
32
|
}
|
33
33
|
end
|
@@ -52,8 +52,8 @@ module JIJI
|
|
52
52
|
DirLock.new( @dir ).writelock {
|
53
53
|
sub_dir = "#{@dir}/#{JIJI::Util.encode(name).gsub(/\//, "_")}"
|
54
54
|
FileUtils.mkdir_p sub_dir
|
55
|
-
options[
|
56
|
-
options[
|
55
|
+
options[:type] = type.to_s
|
56
|
+
options[:name] = name
|
57
57
|
@outs[name] = create_output( sub_dir, name, type, options )
|
58
58
|
@outs[name].time = time
|
59
59
|
@outs[name].save
|
@@ -114,7 +114,7 @@ module JIJI
|
|
114
114
|
#props:: プロパティ
|
115
115
|
def set_properties( props )
|
116
116
|
props.each_pair {|k,v|
|
117
|
-
@options[k] = v
|
117
|
+
@options[k.to_sym] = v
|
118
118
|
}
|
119
119
|
save
|
120
120
|
end
|
data/lib/jiji/registry.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
|
2
2
|
require 'rubygems'
|
3
3
|
require 'yaml'
|
4
|
+
require 'jiji/util/fix_yaml_bug'
|
4
5
|
require 'needle'
|
5
6
|
require 'jiji/collector'
|
6
7
|
require 'jiji/configuration'
|
@@ -29,6 +30,9 @@ require 'jiji/service/output_service'
|
|
29
30
|
require 'jiji/service/process_service'
|
30
31
|
require 'jiji/service/system_service'
|
31
32
|
|
33
|
+
require 'jiji/migration/migrator'
|
34
|
+
require 'jiji/migration/migrator1_0_3'
|
35
|
+
|
32
36
|
module JIJI
|
33
37
|
|
34
38
|
#
|
@@ -69,6 +73,10 @@ module JIJI
|
|
69
73
|
FileUtils.mkdir_p process_dir
|
70
74
|
process_dir
|
71
75
|
}
|
76
|
+
# バージョンファイル
|
77
|
+
r.register( :version_file ) {
|
78
|
+
r.base_dir + "/data_version"
|
79
|
+
}
|
72
80
|
|
73
81
|
# ロガー
|
74
82
|
r.register( :server_logger ) {
|
@@ -240,6 +248,18 @@ module JIJI
|
|
240
248
|
c.server = r.server
|
241
249
|
c
|
242
250
|
}
|
251
|
+
|
252
|
+
# データ移行
|
253
|
+
r.register( :migrator ) {
|
254
|
+
c = JIJI::Migration::Migrator.new
|
255
|
+
c.registry = r
|
256
|
+
c.server_logger = r.server_logger
|
257
|
+
c.version_file = r.version_file
|
258
|
+
c.migrators = [
|
259
|
+
{ :version=>Gem::Version.new( "1.0.3" ), :migrator=>JIJI::Migration::Migrator1_0_3.new}
|
260
|
+
]
|
261
|
+
c
|
262
|
+
}
|
243
263
|
}
|
244
264
|
end
|
245
265
|
|
data/lib/jiji/server.rb
CHANGED
@@ -12,6 +12,11 @@ module JIJI
|
|
12
12
|
registry = JIJI::Registry.new(base, self)
|
13
13
|
registry.server_logger.info "base dir : #{base}"
|
14
14
|
|
15
|
+
# データ移行
|
16
|
+
JIJI::Util.log_if_error_and_throw(registry.server_logger) {
|
17
|
+
registry.migrator.migrate
|
18
|
+
}
|
19
|
+
|
15
20
|
conf = registry[:conf]
|
16
21
|
param[:Port] = conf.get([:server,:port], 7000).to_i
|
17
22
|
begin
|
data/test/all_tests.rb
CHANGED
@@ -0,0 +1,117 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
3
|
+
$: << "../../lib"
|
4
|
+
|
5
|
+
require 'rubygems'
|
6
|
+
require 'runit/testcase'
|
7
|
+
require 'runit/cui/testrunner'
|
8
|
+
require 'jiji/migration/migrator'
|
9
|
+
|
10
|
+
# Migrator のテスト
|
11
|
+
class MigratorTest < RUNIT::TestCase
|
12
|
+
|
13
|
+
def setup
|
14
|
+
@dir = File.dirname(__FILE__) + "/migrator_test"
|
15
|
+
FileUtils.mkdir_p @dir
|
16
|
+
|
17
|
+
@registry = {}
|
18
|
+
end
|
19
|
+
|
20
|
+
def teardown
|
21
|
+
FileUtils.rm_rf @dir
|
22
|
+
end
|
23
|
+
|
24
|
+
# 基本動作のテスト
|
25
|
+
def test_basic
|
26
|
+
|
27
|
+
log = []
|
28
|
+
|
29
|
+
# バージョンファイルはないので、1.0.0と判定される。
|
30
|
+
# 同じバージョンのものは実行されない
|
31
|
+
# 下位バージョンのものは実行されない。
|
32
|
+
m = JIJI::Migration::Migrator.new
|
33
|
+
m.registry = @registry
|
34
|
+
m.version_file = "#{@dir}/version"
|
35
|
+
m.server_logger = Logger.new(STDOUT)
|
36
|
+
m.migrators = [
|
37
|
+
{:version=>Gem::Version.new("1.1.0"), :migrator=>TestMigrator.new( "1.1.0", log )},
|
38
|
+
{:version=>Gem::Version.new("1.0.0"), :migrator=>TestMigrator.new( "1.0.0", log )}, # 実行されない
|
39
|
+
{:version=>Gem::Version.new("2.0.1"), :migrator=>TestMigrator.new( "2.0.1", log )},
|
40
|
+
{:version=>Gem::Version.new("1.0.2"), :migrator=>TestMigrator.new( "1.0.2", log )},
|
41
|
+
{:version=>Gem::Version.new("0.9.99"), :migrator=>TestMigrator.new( "0.9.99", log )} # 実行されない
|
42
|
+
]
|
43
|
+
assert_equals( m.version.to_s, "1.0.0" )
|
44
|
+
|
45
|
+
# データ移行を実行
|
46
|
+
m.migrate
|
47
|
+
assert_equals( log, ["1.0.2","1.1.0","2.0.1"] )
|
48
|
+
assert_equals( m.version.to_s, "2.0.1" )
|
49
|
+
|
50
|
+
# 再実行→すでに最新バージョンなので何も実行されない
|
51
|
+
log.clear
|
52
|
+
m.migrate
|
53
|
+
assert_equals( log, [] )
|
54
|
+
assert_equals( m.version.to_s, "2.0.1" )
|
55
|
+
|
56
|
+
# 新しいデータ移行処理を追加。
|
57
|
+
# 現在のバージョンより上位のもののみ実行される。
|
58
|
+
m = JIJI::Migration::Migrator.new
|
59
|
+
m.registry = @registry
|
60
|
+
m.version_file = "#{@dir}/version"
|
61
|
+
m.server_logger = Logger.new(STDOUT)
|
62
|
+
m.migrators = [
|
63
|
+
{:version=>Gem::Version.new("1.0.0"), :migrator=>TestMigrator.new( "1.0.0", log )}, # 実行されない
|
64
|
+
{:version=>Gem::Version.new("2.0.1"), :migrator=>TestMigrator.new( "2.0.1", log )}, # 実行されない
|
65
|
+
{:version=>Gem::Version.new("2.1.5"), :migrator=>TestMigrator.new( "2.1.5", log )}, # 実行される
|
66
|
+
]
|
67
|
+
assert_equals( m.version.to_s, "2.0.1" )
|
68
|
+
m.migrate
|
69
|
+
assert_equals( log, ["2.1.5"] )
|
70
|
+
assert_equals( m.version.to_s, "2.1.5" )
|
71
|
+
end
|
72
|
+
|
73
|
+
# データ移行の途中でエラーになる場合のテスト
|
74
|
+
def test_error
|
75
|
+
log = []
|
76
|
+
|
77
|
+
# バージョンファイルはないので、1.0.0と判定される。
|
78
|
+
# エラーになったバージョンまで移行できる。
|
79
|
+
m = JIJI::Migration::Migrator.new
|
80
|
+
m.registry = @registry
|
81
|
+
m.version_file = "#{@dir}/version"
|
82
|
+
m.server_logger = Logger.new(STDOUT)
|
83
|
+
m.migrators = [
|
84
|
+
{:version=>Gem::Version.new("1.1.0"), :migrator=>TestMigrator.new( "1.1.0", log )}, # 実行される
|
85
|
+
{:version=>Gem::Version.new("1.0.0"), :migrator=>TestMigrator.new( "1.0.0", log )}, # 実行されない
|
86
|
+
{:version=>Gem::Version.new("2.0.1"), :migrator=>TestMigrator.new( "2.0.1", log )}, # エラーのため実行されない
|
87
|
+
{:version=>Gem::Version.new("1.1.2"), :migrator=>ErrorMigrator.new}, # エラー
|
88
|
+
{:version=>Gem::Version.new("0.9.99"), :migrator=>TestMigrator.new( "0.9.99", log )} # 実行されない
|
89
|
+
]
|
90
|
+
assert_equals( m.version.to_s, "1.0.0" )
|
91
|
+
m.migrate
|
92
|
+
assert_equals( log, ["1.1.0"] )
|
93
|
+
assert_equals( m.version.to_s, "1.1.0" )
|
94
|
+
|
95
|
+
log.clear
|
96
|
+
m.migrate
|
97
|
+
assert_equals( log, [] )
|
98
|
+
assert_equals( m.version.to_s, "1.1.0" )
|
99
|
+
end
|
100
|
+
|
101
|
+
class TestMigrator
|
102
|
+
def initialize(id,log)
|
103
|
+
super()
|
104
|
+
@id = id
|
105
|
+
@log = log
|
106
|
+
end
|
107
|
+
def migrate( registry )
|
108
|
+
@log << @id
|
109
|
+
end
|
110
|
+
end
|
111
|
+
class ErrorMigrator
|
112
|
+
def migrate( registry )
|
113
|
+
raise "test"
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
@@ -0,0 +1,118 @@
|
|
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 'jiji/migration/migrator1_0_3'
|
10
|
+
|
11
|
+
# Migrator1_0_3 のテスト
|
12
|
+
class Migrator1_0_3Test < RUNIT::TestCase
|
13
|
+
|
14
|
+
def setup
|
15
|
+
@dir = File.dirname(__FILE__) + "/migrator1_0_3_test"
|
16
|
+
FileUtils.rm_rf @dir
|
17
|
+
FileUtils.mkdir_p @dir
|
18
|
+
|
19
|
+
@registry = {}
|
20
|
+
end
|
21
|
+
|
22
|
+
def teardown
|
23
|
+
FileUtils.rm_rf @dir
|
24
|
+
end
|
25
|
+
|
26
|
+
# 基本動作のテスト
|
27
|
+
def test_basic
|
28
|
+
|
29
|
+
FileUtils.mkdir_p "#{@dir}/rmt/out/a/b"
|
30
|
+
FileUtils.mkdir_p "#{@dir}/rmt/out/a/c"
|
31
|
+
FileUtils.mkdir_p "#{@dir}/rmt/out/x/"
|
32
|
+
FileUtils.mkdir_p "#{@dir}/rmt/outa/a/"
|
33
|
+
FileUtils.mkdir_p "#{@dir}/foo/out/a/b"
|
34
|
+
FileUtils.mkdir_p "#{@dir}/foo/var"
|
35
|
+
|
36
|
+
# 更新されるファイル
|
37
|
+
files = [
|
38
|
+
"#{@dir}/rmt/out/a/b/meta.yaml",
|
39
|
+
"#{@dir}/rmt/out/a/c/meta.yaml",
|
40
|
+
"#{@dir}/rmt/out/x/meta.yaml",
|
41
|
+
"#{@dir}/rmt/out/a/meta.yaml",
|
42
|
+
"#{@dir}/rmt/out/meta.yaml",
|
43
|
+
"#{@dir}/foo/out/a/b/meta.yaml",
|
44
|
+
"#{@dir}/foo/out/a/meta.yaml"
|
45
|
+
]
|
46
|
+
# 更新されないファイル
|
47
|
+
ignore_files = [
|
48
|
+
"#{@dir}/rmt/out/a/b/foo.yaml",
|
49
|
+
"#{@dir}/rmt/outa/a/meta.yaml",
|
50
|
+
"#{@dir}/rmt/meta.yaml",
|
51
|
+
"#{@dir}/meta.yaml",
|
52
|
+
"#{@dir}/foo/var/meta.yaml"
|
53
|
+
]
|
54
|
+
props = {
|
55
|
+
"name"=>"名前",
|
56
|
+
:column_count=>2,
|
57
|
+
"type"=>"graph",
|
58
|
+
:graph_type=> :rate,
|
59
|
+
"colors"=> ["#ff33bb","#557777"],
|
60
|
+
"visible"=> true,
|
61
|
+
:colors => ["#ff33bb","#557777"]
|
62
|
+
}
|
63
|
+
(files + ignore_files).each {|file|
|
64
|
+
open( file, "w" ) { |f| f.write( YAML.dump( props )) }
|
65
|
+
assert_equals( YAML.load_file(file), props)
|
66
|
+
}
|
67
|
+
|
68
|
+
# データ移行
|
69
|
+
m = JIJI::Migration::Migrator1_0_3.new
|
70
|
+
m.migrate( Struct.new( :process_dir ).new( @dir ) )
|
71
|
+
|
72
|
+
converted_props = {
|
73
|
+
:name=>"名前",
|
74
|
+
:column_count=>2,
|
75
|
+
:type=>"graph",
|
76
|
+
:graph_type=> :rate,
|
77
|
+
:visible=> true,
|
78
|
+
:colors => ["#ff33bb","#557777"]
|
79
|
+
}
|
80
|
+
files.each {|file|assert_equals( YAML.load_file(file), converted_props)}
|
81
|
+
ignore_files.each {|file|assert_equals( YAML.load_file(file), props)}
|
82
|
+
end
|
83
|
+
|
84
|
+
# 実際のデータを変更するテスト
|
85
|
+
def test_real_data
|
86
|
+
FileUtils.cp_r File.dirname(__FILE__) + "/migrator1_0_3test_data/rmt", @dir
|
87
|
+
|
88
|
+
# データ移行
|
89
|
+
m = JIJI::Migration::Migrator1_0_3.new
|
90
|
+
m.migrate( Struct.new( :process_dir ).new( @dir ) )
|
91
|
+
|
92
|
+
assert_equals( YAML.load_file("#{@dir}/rmt/out/M2NlOTA2ODEtZDdlNi00NWU1LWIwNDQtMjBmODY2ZGNkNzBj/56e75YuV5bmz5Z2H57ea/meta.yaml"), {
|
93
|
+
:name=>"移動平均線",
|
94
|
+
:column_count=> 2,
|
95
|
+
:graph_type=> :rate,
|
96
|
+
:type=> "graph",
|
97
|
+
:colors=>["#779999","#557777"]
|
98
|
+
})
|
99
|
+
assert_equals( YAML.load_file("#{@dir}/rmt/out/NjM5YWFhZmQtNDFjNy00NjUxLWIwYmItNTc3ZjAyZTg5ODA5/56e75Yuasdwqdd/meta.yaml"), {
|
100
|
+
:name=>"移動平均線",
|
101
|
+
:column_count=> 2,
|
102
|
+
:graph_type=> :rate,
|
103
|
+
:visible=>true,
|
104
|
+
:type=> "graph",
|
105
|
+
:colors=>["#ff33bb","#557777"]
|
106
|
+
})
|
107
|
+
assert_equals( YAML.load_file("#{@dir}/rmt/out/NjM5YWFhZmQtNDFjNy00NjUxLWIwYmItNTc3ZjAyZTg5ODA5/56e75YuV5bmz5Z2H57ea/meta.yaml"), {
|
108
|
+
:name=>"移動平均線",
|
109
|
+
:column_count=> 2,
|
110
|
+
:graph_type=> :rate,
|
111
|
+
:visible=>true,
|
112
|
+
:type=> "graph",
|
113
|
+
:colors=>["#ff33bb","#557777"]
|
114
|
+
})
|
115
|
+
end
|
116
|
+
|
117
|
+
end
|
118
|
+
|
data/test/test_Output.rb
CHANGED
@@ -25,11 +25,11 @@ class OutputTest < RUNIT::TestCase
|
|
25
25
|
def test_basic
|
26
26
|
|
27
27
|
# 書き込み
|
28
|
-
out = @o.get( "テスト", :event, {
|
28
|
+
out = @o.get( "テスト", :event, { :a=>"aaa", :b=>"bbb" } )
|
29
29
|
out2 = @o.get( "テスト2", :graph )
|
30
30
|
|
31
|
-
assert_equals out.options, {
|
32
|
-
assert_equals out2.options, {
|
31
|
+
assert_equals out.options, { :a=>"aaa", :b=>"bbb", :name=>"テスト", :type=>"event" }
|
32
|
+
assert_equals out2.options, { :name=>"テスト2", :type=>"graph" }
|
33
33
|
|
34
34
|
@o.time = Time.local(2008, 8, 1, 10, 0, 0)
|
35
35
|
out.put( "type", "データ\nデータ" )
|
@@ -123,14 +123,14 @@ class OutputTest < RUNIT::TestCase
|
|
123
123
|
assert_equals out2.object_id, @o.get( "テスト2", :event ).object_id
|
124
124
|
|
125
125
|
#プロパティの更新
|
126
|
-
assert_equals out.options, {
|
127
|
-
assert_equals out2.options, {
|
126
|
+
assert_equals out.options, { :a=>"aaa", :b=>"bbb", :name=>"テスト", :type=>"event" }
|
127
|
+
assert_equals out2.options, { :name=>"テスト2", :type=>"graph" }
|
128
128
|
|
129
|
-
out.set_properties( {
|
130
|
-
out2.set_properties( {
|
129
|
+
out.set_properties( {:x=>"xxx", "a"=>"abc"} ) # 文字列をキーにしてもto_symされたものがキーにされる。
|
130
|
+
out2.set_properties( {:y=>"yyy", :a=>"ab"} )
|
131
131
|
|
132
|
-
assert_equals out.options, {
|
133
|
-
assert_equals out2.options, {
|
132
|
+
assert_equals out.options, {:x=>"xxx", :a=>"abc", :b=>"bbb", :name=>"テスト", :type=>"event" }
|
133
|
+
assert_equals out2.options, { :y=>"yyy", :a=>"ab", :name=>"テスト2", :type=>"graph" }
|
134
134
|
|
135
135
|
# 再作成 # 既存のデータがロードされる
|
136
136
|
@o = JIJI::Output.new( "テストエージェント", @dir )
|
@@ -147,8 +147,8 @@ class OutputTest < RUNIT::TestCase
|
|
147
147
|
["200", "220", Time.local(2008, 8, 1, 12, 10, 20).to_i.to_s],
|
148
148
|
["10" , "20", Time.local(2008, 8, 3, 10, 0, 0).to_i.to_s]
|
149
149
|
]
|
150
|
-
assert_equals @o.get("テスト").options, {
|
151
|
-
assert_equals @o.get("テスト2").options, {
|
150
|
+
assert_equals @o.get("テスト").options, {:x=>"xxx", :a=>"abc", :b=>"bbb", :name=>"テスト", :type=>"event" }
|
151
|
+
assert_equals @o.get("テスト2").options, { :y=>"yyy", :a=>"ab", :name=>"テスト2", :type=>"graph" }
|
152
152
|
@o.each {|k, v|
|
153
153
|
case k
|
154
154
|
when "テスト"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unageanu-jiji
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masaya Yamauchi
|
@@ -438,6 +438,8 @@ files:
|
|
438
438
|
- lib/jiji/dao/timed_data_dao.rb
|
439
439
|
- lib/jiji/dao/trade_result_dao.rb
|
440
440
|
- lib/jiji/error.rb
|
441
|
+
- lib/jiji/migration/migrator.rb
|
442
|
+
- lib/jiji/migration/migrator1_0_3.rb
|
441
443
|
- lib/jiji/models.rb
|
442
444
|
- lib/jiji/observer.rb
|
443
445
|
- lib/jiji/operator.rb
|
@@ -610,6 +612,11 @@ files:
|
|
610
612
|
- test/BackCollectorTest/lack/ZARJPY/raw/2008-08-04.csv
|
611
613
|
- test/BackCollectorTest/lack/ZARJPY/raw/2008-08-06.csv
|
612
614
|
- test/BackCollectorTest/lack/ZARJPY/raw/2008-08-07.csv
|
615
|
+
- test/migration/migrator1_0_3test_data/rmt/out/M2NlOTA2ODEtZDdlNi00NWU1LWIwNDQtMjBmODY2ZGNkNzBj/56e75YuV5bmz5Z2H57ea/meta.yaml
|
616
|
+
- test/migration/migrator1_0_3test_data/rmt/out/NjM5YWFhZmQtNDFjNy00NjUxLWIwYmItNTc3ZjAyZTg5ODA5/56e75Yuasdwqdd/meta.yaml
|
617
|
+
- test/migration/migrator1_0_3test_data/rmt/out/NjM5YWFhZmQtNDFjNy00NjUxLWIwYmItNTc3ZjAyZTg5ODA5/56e75YuV5bmz5Z2H57ea/meta.yaml
|
618
|
+
- test/migration/test_Migrator.rb
|
619
|
+
- test/migration/test_Migrator1_0_3.rb
|
613
620
|
- test/ProcessManagerTest/agents/moving_average.rb
|
614
621
|
- test/ProcessManagerTest/conf/configuration.yaml
|
615
622
|
- test/ProcessManagerTest/rate_datas/EURJPY/raw/2008-08-21.csv
|
@@ -717,6 +724,11 @@ test_files:
|
|
717
724
|
- test/BackCollectorTest/lack/ZARJPY/raw/2008-08-04.csv
|
718
725
|
- test/BackCollectorTest/lack/ZARJPY/raw/2008-08-06.csv
|
719
726
|
- test/BackCollectorTest/lack/ZARJPY/raw/2008-08-07.csv
|
727
|
+
- test/migration/migrator1_0_3test_data/rmt/out/M2NlOTA2ODEtZDdlNi00NWU1LWIwNDQtMjBmODY2ZGNkNzBj/56e75YuV5bmz5Z2H57ea/meta.yaml
|
728
|
+
- test/migration/migrator1_0_3test_data/rmt/out/NjM5YWFhZmQtNDFjNy00NjUxLWIwYmItNTc3ZjAyZTg5ODA5/56e75Yuasdwqdd/meta.yaml
|
729
|
+
- test/migration/migrator1_0_3test_data/rmt/out/NjM5YWFhZmQtNDFjNy00NjUxLWIwYmItNTc3ZjAyZTg5ODA5/56e75YuV5bmz5Z2H57ea/meta.yaml
|
730
|
+
- test/migration/test_Migrator.rb
|
731
|
+
- test/migration/test_Migrator1_0_3.rb
|
720
732
|
- test/ProcessManagerTest/agents/moving_average.rb
|
721
733
|
- test/ProcessManagerTest/conf/configuration.yaml
|
722
734
|
- test/ProcessManagerTest/rate_datas/EURJPY/raw/2008-08-21.csv
|