test/feitest.rb in openwferu-0.9.1 vs test/feitest.rb in openwferu-0.9.2

- old
+ new

@@ -1,17 +1,18 @@ # -# Testing OpenWFEru +# Testing OpenWFE # # John Mettraux at openwfe.org # # Mon Oct 9 22:19:44 JST 2006 # require 'test/unit' -require 'workitem' -require 'ru/rudefinitions' +require 'openwfe/workitem' +require 'openwfe/flowexpressionid' +require 'openwfe/rudefinitions' class FeiTest < Test::Unit::TestCase #def setup @@ -42,11 +43,11 @@ def test_inequality fei1 = new_fei() fei2 = new_fei() - fei2.expressionName = OpenWFEru::EN_ENVIRONMENT + fei2.expression_name = OpenWFE::EN_ENVIRONMENT assert \ fei1.object_id != fei2.object_id, \ "feis are not two distinct feis" assert \ @@ -93,29 +94,56 @@ assert \ fei0 == fei1, "feis should be equal" - fei1.expressionName = OpenWFEru::EN_ENVIRONMENT + fei1.expression_name = OpenWFE::EN_ENVIRONMENT assert \ fei0 != fei1, "feis should not be equal" end + def test_parse_unparse + fei0 = new_fei() + s = fei0.to_s + fei1 = OpenWFE::FlowExpressionId.to_fei(s) + + puts "\n#{s}\n#{fei1.to_s}" if fei0 != fei1 + + assert \ + fei0 == fei1, + "fei .to_s() and .str_to_fei(s) are not working" + end + + def test_parent_wfid + + fei = new_fei + + assert \ + fei.parent_workflow_instance_id == "123456", + "failure 0" + + fei.workflow_instance_id = "123456.0.0" + + assert \ + fei.parent_workflow_instance_id == "123456", + "failure 1" + end + protected def new_fei () fei = OpenWFE::FlowExpressionId.new() - fei.owfeVersion = OpenWFEru::OPENWFE_VERSION - fei.engineId = 'this' - fei.initialEngineId = 'that' - fei.workflowDefinitionUrl = 'http://test/test.xml' - fei.workflowDefinitionName = 'test' - fei.workflowDefinitionRevision = '1.0' - fei.workflowInstanceId = '123456' - fei.expressionName = 'do-test' - fei.expressionId = '0.0' + fei.owfe_version = OpenWFE::OPENWFE_VERSION + fei.engine_id = 'this' + fei.initial_engine_id = 'that' + fei.workflow_definition_url = 'http://test/test.xml' + fei.workflow_definition_name = 'test' + fei.workflow_definition_revision = '1.0' + fei.workflow_instance_id = '123456' + fei.expression_name = 'do-test' + fei.expression_id = '0.0' return fei end def puts_hash (h) puts