Exemple #1
0
def test_get_package_entry_null_if_not_found(fs):
    source=full_path("processExamples/MainProcess/ValidationProcess/SubValidationProcess.xml")
    fs.add_real_file(source)
    fs.add_real_file(full_path("processExamples/MainProcess/ValidationProcess.xml"))
    #we do not add main

    validation_process_def= SourceObjectParser().parse(source)
    package_entry = validation_process_def.get_main_process()

    assert None == package_entry
Exemple #2
0
def test_get_package_entry_from_process_definition(fs):
    source=full_path("processExamples/MainProcess/ValidationProcess.xml")
    fs.add_real_file(source)
    outer_filepath=full_path("processExamples/MainProcess.xml")
    fs.add_real_file(outer_filepath)

    validation_process_def= SourceObjectParser().parse(source)
    package_entry = validation_process_def.get_main_process()

    assert outer_filepath == package_entry.filepath
Exemple #3
0
def test_get_package_entry_from_process_definition_recursive(fs):
    source=full_path("processExamples/MainProcess/ValidationProcess/SubValidationProcess.xml")
    fs.add_real_file(source)
    fs.add_real_file(full_path("processExamples/MainProcess/ValidationProcess.xml"))
    main_process=full_path("processExamples/MainProcess.xml")
    fs.add_real_file(main_process)

    validation_process_def= SourceObjectParser().parse(source)
    package_entry = validation_process_def.get_main_process()

    assert main_process == package_entry.filepath
Exemple #4
0
def test_replace_inner_formProcess_popup():
    logger = FakeLogger()
    source = full_path("processExamples/MainProcess/ValidationFormProcess.xml")
    main = full_path("processExamples/MainProcess.xml")

    form_process = SourceObjectParser().parse(source)
    popupquestion = form_process.process_definition.find("PopupQuestionNode")
    assert "Error" == popupquestion.get("question")

    replace(logger, os.path.dirname(source))

    package_entry = SourceObjectParser().parse(source)
    assert ["FrameworkCommon.API.PopUpQuestion.MessageDialog"
            ] == package_entry.get_main_process().imports()
    data_flow = package_entry.process_definition.find("DataFlow")
    assert "fieldStore0" == data_flow.find("FromNode").get("name")
    assert "invalidPassword" == data_flow.find("ToNode").get("name")
    data_flow_entries = data_flow.findall("DataFlowEntry")
    line1_from = data_flow_entries[0].find("FromField")
    parameter_assigment = line1_from.find("ParameterAssignment")
    assert "0" == parameter_assigment.get("exceptionStrategy")
    assert "EcmaScript" == parameter_assigment.get("language")
    assert "" == parameter_assigment.get("name")
    assert "" == parameter_assigment.get("version")
    verbatim = parameter_assigment.find("Verbatim")
    assert "text" == verbatim.get("fieldName")
    assert '"Please make sure you password is correct"' ==\
            verbatim.text.strip()
    message_type = data_flow_entries[1].find("FromField")
    parameter_assigment = message_type.find("ParameterAssignment")
    assert "0" == parameter_assigment.get("exceptionStrategy")
    assert "EcmaScript" == parameter_assigment.get("language")
    assert "" == parameter_assigment.get("name")
    assert "" == parameter_assigment.get("version")
    verbatim = parameter_assigment.find("Verbatim")
    assert "text" == verbatim.get("fieldName")
    assert 'MessageDialog.ERROR_TYPE' ==\
            verbatim.text.strip()