# ----------------------------------------------------------------------------------------------------------
#
# ----------------------------------------------------------------------------------------------------------
def set2trace4xi():
global t2xi
global trace_object_count
global PickleKB4Xi
# print("(Step 0A/33) OF SET2TRACE4XI - STARTING SETTING TRACE BASED ON TRACE SETTINGS IN MODULES PICKLE2x4XI.PY (x=a,b...) ", time4xi())
# print("(Step 0B/33) OF SET2TRACE4XI - USING T2XI: ", t2xi)
#
# ---------------------------------------------------------------------------------------------
# A, B .... _
# ---------------------------------------------------------------------------------------------
keys2pickledb = sorted(PickleKB4Xi.keys())
for key2pickledb in keys2pickledb:
# -----------------------------------------------------------------------------------------
# LETTERS
# -----------------------------------------------------------------------------------------
# print('=' *33)
# print("STARTING LETTER : ", key2pickledb)
# print('=' *33)
dictionary2pickle = PickleKB4Xi[key2pickledb]
# print("STARTING DICTIONARY: ", dictionary2pickle)
# print('~' *33)
#
keys2dictionary = sorted(dictionary2pickle.keys())
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
for key2dictionary in keys2dictionary:
# -------------------------------------------------------------------------------------
# DICTIONARY
# -------------------------------------------------------------------------------------
# print('~' *33)
object2pickle = key2dictionary
# print("STARTING OBJECT: ", object2pickle)
# print('~' *33)
# pickle4xi(object2pickle)
# print('~' *33)
# print("PICKLED object: ", object2pickle)
# PICKLED object: _C4Xi,
# ---------------------------------------------------------------------------------
# Mark those with NACK4XI to be traced !
# ---------------------------------------------------------------------------------
if dictionary2pickle[key2dictionary] == 'NACK4XI':
set_param2xi = True
key_param = object2pickle
t2xi.set_print_permission(key_param, set_param2xi)
# print("(Step 2A/33) OF SET2TRACE4XI - MARKED TO BE TRACED OBJECT: ", object2pickle)
#
else:
pass
# ---------------------------------------------------------------------------------
# END OF DICTIONARY
# ---------------------------------------------------------------------------------
# -----------------------------------------------------------------------------------------
# END OF LETTERS
# -----------------------------------------------------------------------------------------
# print('~' *33)
# print("COMPLETED DICTIONARY: ", dictionary2pickle)
# print('~' *33)
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
# print('=' *33)
# print("COMPLETED LETTER : ", key2pickledb)
# print('=' *33)
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
print('=' *33)
print("(Step 33/33) OF SET2TRACE4XI - COMPLETED SETTING TRACE BASED ON NACK4XI/ACK4XI SETTINGS IN MODULES PICKLE2x4XI.PY (x=a,b...) ", time4xi())
print('=' *33)
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def deny2trace4xi():
global t2xi
global trace_object_count
global PickleKB4Xi
print("(Step 01A/33) of DENY2TRACE4XI: STARTING DENYING TRACE IN MODULES PICKLE2x4XI.PY (x=a,b...) ", time4xi())
print("(Step 01B/33) OF DENY2TRACE4XI - USING T2XI: ", t2xi)
#
# ---------------------------------------------------------------------------------------------
# A, B .... _
# ---------------------------------------------------------------------------------------------
keys2pickledb = sorted(PickleKB4Xi.keys())
for key2pickledb in keys2pickledb:
# -----------------------------------------------------------------------------------------
# LETTERS
# -----------------------------------------------------------------------------------------
# print("(Step 02A/33) OF DENY2TRACE4XI - STARTING LETTER : ", key2pickledb)
dictionary2pickle = PickleKB4Xi[key2pickledb]
# print("(Step 02B/33) OF DENY2TRACE4XI - STARTING DICTIONARY: ", dictionary2pickle)
keys2dictionary = sorted(dictionary2pickle.keys())
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
for key2dictionary in keys2dictionary:
# -------------------------------------------------------------------------------------
# DICTIONARY
object2pickle = key2dictionary
# print("(Step 02C/33) OF DENY2TRACE4XI - STARTING OBJECT: ", object2pickle)
# pickle4xi(object2pickle)
# print("STEP: PICKLED object: ", object2pickle)
# PICKLED object: _C4Xi,
# ---------------------------------------------------------------------------------
# ACK4XI = tested .i.e. NOT to be traced!
# ---------------------------------------------------------------------------------
set_param2xi = 'ACK4XI'
key_param = object2pickle
t2xi.set_print_permission(key_param, set_param2xi)
# print("(Step 02D/33) OF DENY2TRACE4XI - MARKED TESTED AND NOT to be traced: ", object2pickle)
dictionary2pickle[key2dictionary] = 'ACK4XI'
# ---------------------------------------------------------------------------------
# END OF DICTIONARY
# ---------------------------------------------------------------------------------
# print('~' *33)
# print("(Step 02Z/33) OF DENY2TRACE4XI *** FAILED - ERROR IN PICKLING OBJECT - NOT TO BE TRACED: ", object2pickle)
# print('~' *33)
# -----------------------------------------------------------------------------------------
# END OF LETTERS
# -----------------------------------------------------------------------------------------
# print("(Step 02E/33) OF DENY2TRACE4XI - COMPLETED DICTIONARY: ", dictionary2pickle)
#
# -----------------------------------------------------------------------------------------
#
# -----------------------------------------------------------------------------------------
# print("(Step 02F/33) OF DENY2TRACE4XI - COMPLETED LETTER : ", key2pickledb)
# _, a ... z
print("(Step 033/33) OF SET2TRACE4XI - COMPLETED DENYING TRACE IN MODULES PICKLE2x4XI.PY (x=a,b...) ", time4xi())
#
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
def tailor2trace4xi():
global trace_object_count
global PickleKB4Xi
global t2xi
print("(Step 001A/33) OF TAILOR2TRACE4XI - USING T2XI: ", t2xi)
#
# ---------------------------------------------------------------------------------------------
# Settings to tailor trace
# ---------------------------------------------------------------------------------------------
#
# ---------------------------------------------------------------------------------------------
# PROCESS KB4Tailoring
# ---------------------------------------------------------------------------------------------
keys2tailor = sorted(KB4Tailoring.keys())
for key2tailor in keys2tailor:
# ---------------------------------------------------------------------------------
# NACK4XI = NOT TESTED .I.E. TO BE TRACED!
# ---------------------------------------------------------------------------------
set_param2xi = 'NACK4XI'
key_param = key2tailor
t2xi.set_print_permission(key_param, set_param2xi)
print("(Step 002A/33) OF TAILOR_TRACE4XI - MARKED TO BE TESTED: ", key2tailor)
#
# -----------------------------------------------------------------------------------------
# EOF KEYS
# -----------------------------------------------------------------------------------------
print("(Step 0033/33) OF TAILOR_TRACE4XI - COMPLETED TAILORING: ", time4xi())
#
#
# -------------------------------------------------------------------------------------------------
#
#
# -------------------------------------------------------------------------------------------------
def print_trace4xi(t2xi):
# -------------------------------------------------------------------------------------------------
# SENSE
# -------------------------------------------------------------------------------------------------
context2sense = {
'file_path4xi': '..\\..\\xml\\sense-test-xxxxxxxx4xi.xml',
'name_space4xi': ' xmlns="http://www.dragonxi2.com/sense/sw4xi/python32/owl/multiprocessing4xi.owl#"\n',
'xml_base4xi': ' xml:base="http://www.yourdragonxi.org/web/lib/owl/multiprocessing4xi.owl">\n',
'ontology_about4xi': ' \n',
'ontology_comment4xi': ' Classes, methods and messages with context.\n',
'class0_id4xi': ' \n',
'class0_comment4xi': ' Sensing XXXXXXXX in system.\n',
'object_property_rdf4xi': ' \n',
'object_property_comment4xi': ' Y-Skeleton sensed in system.\n',
'debug4xi': True}
xml_trace_sense4xi(t2xi, context2sense)
# -------------------------------------------------------------------------------------------------
# REASON
# -------------------------------------------------------------------------------------------------
context2reason = {
'file_path4xi': '..\\..\\xml\\reason-test-xxxxxxxx4xi.xml',
'name_space4xi': ' xmlns="http://www.dragonxi4.com/reason/sw4xi/python32/owl/multiprocessing4xi.owl#"\n',
'xml_base4xi': ' xml:base="http://www.dragonxi4.com/reason/sw4xi/python32/owl/multiprocessing4xi.owl">\n',
'ontology_about4xi': ' \n',
'ontology_comment4xi': ' Operations\n',
'operation_comment4xi': ' Operations for XXXXXXXX in system.\n',
'class0_id4xi': ' \n',
'class0_comment4xi': ' Operations with context.\n',
'object_property_rdf4xi': ' \n',
'object_property_comment4xi': ' reason\n',
'debug4xi': True}
xml_trace_reason4xi(t2xi, context2reason)
# -------------------------------------------------------------------------------------------------
# ACE
# -------------------------------------------------------------------------------------------------
context2ace = {
'file_path4xi': '..\\..\\xml\\ace-test-xxxxxxxx4xi.xml',
'name_space4xi': ' xmlns="http://www.dragonxi8.com/ace/sw4xi/python32/owl/multiprocessing4xi.owl#"\n',
'xml_base4xi': ' xml:base="http://www.dragonxi8.com/ace/sw4xi/python32/owl/multiprocessing4xi.owl">\n',
'ontology_about4xi': ' \n',
'ontology_comment4xi': ' Objects and values for XXXXXXXX in system.\n',
'class0_id4xi': ' \n',
'class0_comment4xi': ' Objects and values of XXXXXXXX.\n',
'object_property_rdf4xi': ' \n',
'object_property_comment4xi': ' 000000\n',
'debug4xi': True}
xml_trace_ace4xi(t2xi, context2ace)
# -------------------------------------------------------------------------------------------------
# end of print_trace4xi
# -------------------------------------------------------------------------------------------------
#
# -------------------------------------------------------------------------------------------------
#
#
# -------------------------------------------------------------------------------------------------
def test_skeleton_print4xi():
global t2xi
global trace_object_count
# ---------------------------------------------------------------------------------------------
# INITIALIZE TRACE
# ---------------------------------------------------------------------------------------------
t2xi = Print4Xi()
print("(Step 1/33) OF TEST_XXXXXXXX4XI - SET T2XI TO: ", t2xi)
#
set2trace4xi() # trace all classes and functions in the system
deny2trace4xi() # deny trace for all classes and functions in the system
tailor2trace4xi() # tailor trace for this test
try:
# ---------------------------------------------------------------------------------------------
# START
# ---------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------
# DONE
# ---------------------------------------------------------------------------------------------
print('=' *33)
print("(Step 7/33) OF TEST_XXXXXXXX4Xi - DONE! ", time4xi())
#
print('=' *33)
except:
print("(Step 8/33z1) OF TEST_XXXXXXXX4Xi - *** FAILED *** ", time4xi())
#
finally:
# ---------------------------------------------------------------------------------------------
# PRINT TRACE
# ---------------------------------------------------------------------------------------------
print("(Step 9/33) OF TEST_XXXXXXXX4Xi - PRINT TRACE! ", time4xi())
#
print_trace4xi(t2xi)
#