#
# Testing OpenWFE
#
# John Mettraux at openwfe.org
#
# Mon Oct 9 22:19:44 JST 2006
#
require 'flowtestbase'
class FlowTest4 < FlowTestBase
#def setup
#end
#def teardown
#end
def test_print_0
dotest(\
'''
${f:xxx}
''', "${f:xxx}")
end
def test_reval_0
dotest(\
'''
${f:from_ruby}
''', "ok")
end
def test_reval_1
dotest(\
'''
workitem.attributes["${field-name}"] = "ok"
${f:${field-name}}
''', "ok")
end
def test_reval_2
dotest(\
'''
workitem.attributes["from_ruby"] = "${field-value}"
${f:from_ruby}
''', "ok")
end
def test_reval_3
dotest(\
'''
${v}
''', "false")
end
def test_dru_0
dotest(\
'''
${r:1+2}
''', "3")
end
def test_dru_1
dotest(\
'''
${r:"x"*3}
''', "xxx")
end
def test_dru_2
dotest(\
'''
${v}
''', "10")
end
def test_dru_3
dotest(\
'''
lookup_variable("w") * 3
${v}
''', "WWW")
end
def test_dru_4
dotest(\
'''
@fei.workflow_definition_name
${v}
${r:@fei.workflow_definition_name}
''', """dru_4
dru_4""")
end
end