test/file_persistence_test.rb in openwferu-0.9.6 vs test/file_persistence_test.rb in openwferu-0.9.7

- old
+ new

@@ -1,52 +1,52 @@ require 'test/unit' -require 'openwfe/expressions/expressionmap' +require 'openwfe/engine/engine' +#require 'openwfe/flowexpressionid' +#require 'openwfe/expressions/expressionmap' require 'openwfe/expool/expstorage' require 'openwfe/expool/yamlexpstorage' -require 'openwfe/flowexpressionid' include OpenWFE class FilePersistenceTest < Test::Unit::TestCase def setup - require 'openwfe/engine/engine' @engine = Engine.new end def ac return @engine.application_context end # # test persistence using yaml def test_yaml_persistence - fes = YamlFileExpressionStorage.new("yaml", ac()) + fes = YamlFileExpressionStorage.new("yaml", ac) test_persistence(fes) end # # flow expression check def test_flow_expression fei = new_fei() - fes = YamlFileExpressionStorage.new("yaml", ac()) + fes = YamlFileExpressionStorage.new("yaml", ac) fe = SequenceExpression.new(fei, nil, nil, nil, nil) test_persistence(fes,fe) end # # test UTF-8 data persistence def test_utf8_with_file workflow_definition_name = "みんなにARIGATOU★☆に関する最新の情報公開" fei = new_fei(workflow_definition_name) - fes = YamlFileExpressionStorage.new("yaml", ac()) + fes = YamlFileExpressionStorage.new("yaml", ac) fe = SequenceExpression.new(fei, nil, nil, nil, nil) - loaded = test_persistence(fes,fe) + loaded = test_persistence(fes, fe) #puts loaded.fei.workflow_definition_name assert loaded.fei.workflow_definition_name == fei.workflow_definition_name end @@ -77,11 +77,11 @@ fes.delete(fei) assert !(fes.has_key?(fei)) return loaded end - def new_fei (definition_name = nil) + def new_fei (definition_name=nil) fei = FlowExpressionId.new() fei.owfe_version = OPENWFERU_VERSION fei.engine_id = 'this' fei.initial_engine_id = 'that' @@ -90,10 +90,10 @@ 'test' else definition_name end fei.workflow_definition_revision = '1.0' - fei.workflow_instance_id = '1234568' + fei.workflow_instance_id = @engine.get_wfid_generator.generate fei.expression_name = 'do-test' fei.expression_id = '0.0' return fei end