| | |
| | | "parse_stax_result", |
| | | "dn2list", |
| | | "list2dn", |
| | | "dn2rfcmailaddr" ] |
| | | "dn2rfcmailaddr", |
| | | "java_properties" ] |
| | | |
| | | class format_testcase: |
| | | 'Format the Test name objects' |
| | |
| | | return Boolean.FALSE |
| | | |
| | | def create_property_table(output, separator): |
| | | 'Create a table from an output' |
| | | |
| | | table = {} |
| | | |
| | | for line in output.splitlines(): |
| | |
| | | return table |
| | | |
| | | def compare_property_table(refTable, newTable): |
| | | 'Compare two tables' |
| | | |
| | | import re |
| | | |
| | | result = '' |
| | | |
| | | refKeys=newTable.keys() |
| | | refKeys = newTable.keys() |
| | | for refKey in refKeys: |
| | | if not refTable.has_key(refKey): |
| | | result = result + 'ERROR: Entry ' + refKey + ' does not exists' |
| | | result = result + ' in the reference table.\n' |
| | | |
| | | refKeys=refTable.keys() |
| | | refKeys = refTable.keys() |
| | | for refKey in refKeys: |
| | | if not newTable.has_key(refKey): |
| | | result = result + 'ERROR: Entry ' + refKey + ' does not exists' |
| | |
| | | __addr.append(__rhside) |
| | | return ".".join(__addr).lower() |
| | | |
| | | def java_properties(propFile, toolsName, optionList): |
| | | 'Update java.properties file' |
| | | |
| | | import fileinput |
| | | import string |
| | | import sys |
| | | |
| | | try: |
| | | file = open(propFile, "r") |
| | | content = file.read() |
| | | file.close() |
| | | |
| | | newfile = open(propFile, "w") |
| | | for line in content.splitlines(): |
| | | if line.startswith(toolsName): |
| | | newline = line.split("=")[0] + "=" |
| | | for item in optionList: |
| | | newline = newline + item + " " |
| | | newfile.write("%s\n" % newline) |
| | | else: |
| | | newfile.write("%s\n" % line) |
| | | newfile.close() |
| | | |
| | | return 0 |
| | | except: |
| | | print "Exception:", sys.exc_info()[0] |
| | | |
| | | return 1 |