test/file_persistence_test.rb in openwferu-0.9.4 vs test/file_persistence_test.rb in openwferu-0.9.5
- old
+ new
@@ -8,41 +8,43 @@
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", nil)
+ fes = YamlFileExpressionStorage.new("yaml", ac())
test_persistence(fes)
end
#
- # test cache persistence
- def test_cache_persistence
- fes = LruCachedExpressionStorage.new("lru", nil)
- test_persistence(fes)
- end
-
- #
# flow expression check
def test_flow_expression
fei = new_fei()
- fes = YamlFileExpressionStorage.new("yaml", nil)
+ 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())
fe = SequenceExpression.new(fei, nil, nil, nil, nil)
- fes = YamlFileExpressionStorage.new("yaml", nil)
loaded = test_persistence(fes,fe)
#puts loaded.fei.workflow_definition_name
assert loaded.fei.workflow_definition_name == fei.workflow_definition_name
end
@@ -65,10 +67,10 @@
assert \
(not fes.has_key?(fei)),
"they key is present in the file system. "+
"Maybe a previous test did not delete the "
- fes[fei]=raw
+ fes[fei] = raw
assert fes.has_key?(fei)
loaded = fes[fei]
fes.delete(fei)