From 8294a7eb3c4c52edf75e33d6920b53edea243ed7 Mon Sep 17 00:00:00 2001 From: Ulrich Carmesin Date: Mon, 22 Aug 2022 22:50:18 +0200 Subject: [PATCH] init content --- applications.yml | 7 ++ readme.txt | 52 +++++++++ test/test_31db.py | 137 +++++++++++++++++++++++ testacnt/CONFIG.yml | 26 +++++ testacnt/Testacnt.py | 7 ++ testacnt/testacnt/CONFIG.yml | 26 +++++ testacnt/testacnt/Testacnt.py | 7 ++ testcm/CONFIG.yml | 47 ++++++++ testcm/Testcm.py | 6 + testcm/testcm/CONFIG.yml | 47 ++++++++ testcm/testcm/Testcm.py | 6 + testcrm/CONFIG.yml | 22 ++++ testcrm/Testcrm.py | 5 + testcrm/testcrm/CONFIG.yml | 22 ++++ testcrm/testcrm/Testb.py | 5 + testcrmdb/CONFIG.yml | 26 +++++ testcrmdb/Testcrmdb.py | 5 + testcrmdb/adress.csv | 8 ++ testcrmdb/person.csv | 6 + testcrmdb/testcrmdb/CONFIG.yml | 26 +++++ testcrmdb/testcrmdb/Testcrmdb.py | 5 + testcrmdb/testcrmdb/adress.csv | 8 ++ testcrmdb/testcrmdb/person.csv | 6 + testpoldb/CONFIG.yml | 27 +++++ testpoldb/DATASTRUCTURE.yml | 123 +++++++++++++++++++++ testpoldb/Testpoldb.py | 7 ++ testpoldb/testpoldb/CONFIG.yml | 28 +++++ testpoldb/testpoldb/DATASTRUCTURE.yml | 120 ++++++++++++++++++++ testpoldb/testpoldb/Testpoldb.py | 7 ++ testprd/CONFIG.yml | 28 +++++ testprd/Testprd.py | 5 + testprd/testprd/CONFIG.yml | 28 +++++ testprd/testprd/Testprd.py | 5 + testprddb/CONFIG.yml | 23 ++++ testprddb/DATASTRUCTURE.yml | 31 ++++++ testprddb/Testprddb.py | 7 ++ testprddb/testprddb/CONFIG.yml | 23 ++++ testprddb/testprddb/DATASTRUCTURE.yml | 31 ++++++ testprddb/testprddb/Testprddb.py | 7 ++ testrest/CONFIG.yml | 26 +++++ testrest/Testrest.py | 22 ++++ testrest/config-schema.json | 153 ++++++++++++++++++++++++++ testrest/testrest/CONFIG.yml | 29 +++++ testrest/testrest/Testrest.py | 7 ++ testrest/testrest/mesage.xsd | 43 ++++++++ tool_i18n.yml | 49 +++++++++ 46 files changed, 1341 insertions(+) create mode 100644 applications.yml create mode 100644 readme.txt create mode 100644 test/test_31db.py create mode 100644 testacnt/CONFIG.yml create mode 100644 testacnt/Testacnt.py create mode 100644 testacnt/testacnt/CONFIG.yml create mode 100644 testacnt/testacnt/Testacnt.py create mode 100644 testcm/CONFIG.yml create mode 100644 testcm/Testcm.py create mode 100644 testcm/testcm/CONFIG.yml create mode 100644 testcm/testcm/Testcm.py create mode 100644 testcrm/CONFIG.yml create mode 100644 testcrm/Testcrm.py create mode 100644 testcrm/testcrm/CONFIG.yml create mode 100644 testcrm/testcrm/Testb.py create mode 100644 testcrmdb/CONFIG.yml create mode 100644 testcrmdb/Testcrmdb.py create mode 100644 testcrmdb/adress.csv create mode 100644 testcrmdb/person.csv create mode 100644 testcrmdb/testcrmdb/CONFIG.yml create mode 100644 testcrmdb/testcrmdb/Testcrmdb.py create mode 100644 testcrmdb/testcrmdb/adress.csv create mode 100644 testcrmdb/testcrmdb/person.csv create mode 100644 testpoldb/CONFIG.yml create mode 100644 testpoldb/DATASTRUCTURE.yml create mode 100644 testpoldb/Testpoldb.py create mode 100644 testpoldb/testpoldb/CONFIG.yml create mode 100644 testpoldb/testpoldb/DATASTRUCTURE.yml create mode 100644 testpoldb/testpoldb/Testpoldb.py create mode 100644 testprd/CONFIG.yml create mode 100644 testprd/Testprd.py create mode 100644 testprd/testprd/CONFIG.yml create mode 100644 testprd/testprd/Testprd.py create mode 100644 testprddb/CONFIG.yml create mode 100644 testprddb/DATASTRUCTURE.yml create mode 100644 testprddb/Testprddb.py create mode 100644 testprddb/testprddb/CONFIG.yml create mode 100644 testprddb/testprddb/DATASTRUCTURE.yml create mode 100644 testprddb/testprddb/Testprddb.py create mode 100644 testrest/CONFIG.yml create mode 100644 testrest/Testrest.py create mode 100644 testrest/config-schema.json create mode 100644 testrest/testrest/CONFIG.yml create mode 100644 testrest/testrest/Testrest.py create mode 100644 testrest/testrest/mesage.xsd create mode 100644 tool_i18n.yml diff --git a/applications.yml b/applications.yml new file mode 100644 index 0000000..6ecb61b --- /dev/null +++ b/applications.yml @@ -0,0 +1,7 @@ +applications: + TESTAPP: + project: TESTAPP + testcm: comp + testrest: comp + testcrm: comp + diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..e714c2c --- /dev/null +++ b/readme.txt @@ -0,0 +1,52 @@ +# TODO Beschreibung file-tools +* fileXml_tool +* fileJson_tool +* fileYaml_tool +* fileCsv_tool +* fileHtml_tool +... + +# Funktionen +=== init_testcase === +reset_tdata: +# TODO in file_tool +- envpath +- pattern +> rm + +load_tdata: +# TODO in file_tool +- srcpath (tdata) +- envpath +- pattern +> cp + +read_tdata: +- envpath +- pattern +> readfiles + +=== execute_testcase === +create_request: +- tdata +- mapping (befuellung) +- schema (formate) +- archivpath ( ergebnisse/comp/request ) +> create+write + +send_request: +- channel (sync/async) + ... implement +- archivpath ( ergebnisse/comp/request ) +- envpath / envconn + +get_response: +- channel (sync/async) + ... implement +- archivpath ( ergebnisse/comp/response ) +- envpath ( ./log) / envconn ( = in Request empfangen ) + +=== collect_testcase === +- envpath +- pattern +> readfiles diff --git a/test/test_31db.py b/test/test_31db.py new file mode 100644 index 0000000..2afd3cf --- /dev/null +++ b/test/test_31db.py @@ -0,0 +1,137 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# --------------------------------------------------------------------------------------------------------- +# Author : Ulrich Carmesin +# Source : gitea.ucarmesin.de +# --------------------------------------------------------------------------------------------------------- +import unittest +import inspect +import basic.program +import utils.path_tool +import basic.toolHandling +import test.constants +import basic.component +import basic.constants as B +import utils.db_abstract +import test.testtools +import utils.config_tool + +HOME_PATH = test.constants.HOME_PATH + +conf = {} +# here you can select single testfunction for developping the tests +# -> test of components +TEST_FUNCTIONS = ["test_00toolhandling", "test_01getTechnicalIDFields", "test_02parseSql"] +TEST_FUNCTIONS = ["test_02parseSql"] + +class MyTestCase(unittest.TestCase): + mymsg = "--------------------------------------------------------------" + + def test_01getTechnicalIDFields(self): + global mymsg + actfunction = str(inspect.currentframe().f_code.co_name) + cnttest = 0 + if actfunction not in TEST_FUNCTIONS: + return + job = test.testtools.getJob() + comp = basic.component.Component() + comp.name = "testcrmdb" + table = "person" + comp.conf = {} + comp.conf[B.DATA_NODE_DDL] = {} + comp.conf[B.DATA_NODE_DDL][table] = utils.config_tool.getConfig("DATASTRUCTURE", comp.name, table) + res = utils.db_abstract.getTechnicalIDFields(comp.conf[B.DATA_NODE_DDL][table]) + self.assertEqual(res, ["persid"]) + + + def test_00toolhandling(self): + global mymsg + actfunction = str(inspect.currentframe().f_code.co_name) + cnttest = 0 + if actfunction not in TEST_FUNCTIONS: + return + job = test.testtools.getJob() + #t = basic.toolHandling.ToolManager() + comp = basic.component.Component() + comp.name = "testcrmdb" + table = "person" + comp.conf = {} + comp.conf[B.DATA_NODE_DDL] = {} + comp.conf[B.DATA_NODE_DDL][table] = utils.config_tool.getConfig("DATASTRUCTURE", comp.name, table) + comp.conf[B.SUBJECT_ARTS] = {} + comp.conf[B.SUBJECT_ARTS][B.TOPIC_NODE_DB] = {} + comp.conf[B.SUBJECT_CONN] = {} + comp.conf[B.SUBJECT_CONN][B.TOPIC_NODE_DB] = {} + comp.conf[B.SUBJECT_CONN][B.TOPIC_NODE_DB][B.ATTR_TYPE] = "rel" + comp.conf[B.SUBJECT_CONN][B.TOPIC_NODE_DB][B.ATTR_DB_DATABASE] = "crm-db" + tool = basic.toolHandling.getDbTool(comp) + self.assertRegex(str(type(tool)), 'dbrel_tool.DbFcts') + + def test_02parseSql(self): + global mymsg + actfunction = str(inspect.currentframe().f_code.co_name) + cnttest = 0 + if actfunction not in TEST_FUNCTIONS: + return + job = test.testtools.getJob() + comp = basic.component.Component() + comp.name = "testcrmdb" + table = "person" + comp.conf = {} + comp.conf[B.DATA_NODE_DDL] = {} + comp.conf[B.DATA_NODE_DDL][table] = utils.config_tool.getConfig("DATASTRUCTURE", comp.name, table) + comp.conf[B.SUBJECT_ARTS] = {} + comp.conf[B.SUBJECT_ARTS][B.TOPIC_NODE_DB] = {} + comp.conf[B.SUBJECT_CONN] = {} + comp.conf[B.SUBJECT_CONN][B.TOPIC_NODE_DB] = {} + comp.conf[B.SUBJECT_CONN][B.TOPIC_NODE_DB][B.ATTR_TYPE] = "rel" + comp.conf[B.SUBJECT_CONN][B.TOPIC_NODE_DB][B.ATTR_DB_DATABASE] = "crm-db" + tool = basic.toolHandling.getDbTool(comp) + attr = tool.getDbAttributes("xx") + self.assertRegex(attr[B.ATTR_DB_PARTITION], 'n') + comp.conf[B.SUBJECT_CONN][B.TOPIC_NODE_DB][B.ATTR_DB_PARTITION] = "y" + attr = tool.getDbAttributes("xx") + self.assertRegex(attr[B.ATTR_DB_PARTITION], 'y') + comp.conf[B.SUBJECT_ARTS][B.TOPIC_NODE_DB][B.ATTR_DB_PARTITION] = "z" + attr = tool.getDbAttributes("xx") + self.assertRegex(attr[B.ATTR_DB_PARTITION], 'z') + # + sqls = comp.composeSqlClauses("SELECT * FROM person") + print(sqls) + self.assertEqual(sqls["ALL"], "SELECT * FROM crm-db.person ORDER BY persid") + setattr(job.par, B.PAR_DB_WHERE, "famname like !%utz%! and state = !+reg+!") + #comp.conf[B.SUBJECT_ARTS][B.TOPIC_NODE_DB][B.ATTR_DB_PARTITION] = "+reg+" + sqls = comp.composeSqlClauses("SELECT * FROM person") + print(sqls) + self.assertNotIn("street", sqls["ALL"]) #assertEqual(("street" in sqls), True) + self.assertIn("famname", sqls["ALL"]) + setattr(job.par, "sex", "m") + # TODO replace the formula with job-parameter + setattr(job.par, B.PAR_DB_WHERE, "famname like !%utz%! and sex = {job.par.sex}") + #comp.conf[B.SUBJECT_ARTS][B.TOPIC_NODE_DB][B.ATTR_DB_PARTITION] = "+reg+" + sqls = comp.composeSqlClauses("SELECT * FROM person") + print(sqls) + self.assertIn("famname", sqls["ALL"]) + self.assertIn("sex", sqls["ALL"]) + setattr(job.par, B.PAR_DB_PARTITION, "m,w") + sqls = comp.composeSqlClauses("SELECT * FROM person") + print(sqls) + MyTestCase.mymsg += "\n----- "+actfunction+" : "+str(cnttest) + + + def test_formatDbRows(self): + global mymsg + actfunction = str(inspect.currentframe().f_code.co_name) + cnttest = 0 + if actfunction not in TEST_FUNCTIONS: + return + job = test.testtools.getJob() + MyTestCase.mymsg += "\n----- "+actfunction+" : "+str(cnttest) + + + def test_zzz(self): + print(MyTestCase.mymsg) + + +if __name__ == '__main__': + unittest.main() diff --git a/testacnt/CONFIG.yml b/testacnt/CONFIG.yml new file mode 100644 index 0000000..039ba73 --- /dev/null +++ b/testacnt/CONFIG.yml @@ -0,0 +1,26 @@ +# Example af a component like a sub-app with +# # unknown instances -> defined in environment +# # one subcomponents +# # no artifact +# -------------------------------------------------------------------- +# the example-applications is a partner-application +# it manages customers for any application +# no sub-relations is known +# only the messages-interface is known +# - it represents the accounting-staff of the main-application +# -------------------------------------------------------------------- +conf: + instance: + count: 1 + single: n + components: + none: none + function: + check_environment: "todo" + init_testcase: "todo" + finish_testcase: "todo" + artifact: + file: + type: xml + path: "accounts" + reset: testcase diff --git a/testacnt/Testacnt.py b/testacnt/Testacnt.py new file mode 100644 index 0000000..c1b42ca --- /dev/null +++ b/testacnt/Testacnt.py @@ -0,0 +1,7 @@ +import basic.component + +class Testacnt(basic.component.Component): + def __init__(self): + print('init Testa1') + + diff --git a/testacnt/testacnt/CONFIG.yml b/testacnt/testacnt/CONFIG.yml new file mode 100644 index 0000000..039ba73 --- /dev/null +++ b/testacnt/testacnt/CONFIG.yml @@ -0,0 +1,26 @@ +# Example af a component like a sub-app with +# # unknown instances -> defined in environment +# # one subcomponents +# # no artifact +# -------------------------------------------------------------------- +# the example-applications is a partner-application +# it manages customers for any application +# no sub-relations is known +# only the messages-interface is known +# - it represents the accounting-staff of the main-application +# -------------------------------------------------------------------- +conf: + instance: + count: 1 + single: n + components: + none: none + function: + check_environment: "todo" + init_testcase: "todo" + finish_testcase: "todo" + artifact: + file: + type: xml + path: "accounts" + reset: testcase diff --git a/testacnt/testacnt/Testacnt.py b/testacnt/testacnt/Testacnt.py new file mode 100644 index 0000000..c1b42ca --- /dev/null +++ b/testacnt/testacnt/Testacnt.py @@ -0,0 +1,7 @@ +import basic.component + +class Testacnt(basic.component.Component): + def __init__(self): + print('init Testa1') + + diff --git a/testcm/CONFIG.yml b/testcm/CONFIG.yml new file mode 100644 index 0000000..8abfb59 --- /dev/null +++ b/testcm/CONFIG.yml @@ -0,0 +1,47 @@ +# Example of a component with +# # more instance -> connection +# # some subcomponents +# # artifact-type file.log +# -------------------------------------------------------------------- +# the example-applications is the main-application +# it manages contracts of for this doing it has relations to +# # rest-interface as single user-interface +# # crm-system, accounting, product-management +# # own database +# -------------------------------------------------------------------- +conf: + instance: + count: 1 # count of instances + single: n + components: + testpoldb: + relationtyp: "db" # db : is called by this comp + conffile: "{dompath}/config/settings.xml" + filetyp: xml + urlpattern: ".*?(.*?)" + testprd: + relationtyp: call # call : is called by this comp + conffile: "{dompath}/config/settings.xml" + filetyp: xml + urlpattern: ".*?(.*?)" + testacnt: + relationtyp: queue # call|called|queue + conffile: "{dompath}/config/dbconn.xml" + filetyp: xml + ippattern: ".*?(.*?)" + hostpattern: ".*?(.*?)" + function: + check_environment: "todo" + init_testcase: "todo" + finish_testcase: "todo" + system: # look at sysmonitor + script: "{dompath}/bin/sysctl.sh" # for checking + checks: "status,version,start,stop,restart,available" + artifact: # look at testrun + file: + type: log + path: "{dompath}/log/debug.log" + rotate: jmx + reset: testcase + oldfile: "{dompath}/log/debug_{timepattern}.log" + diff --git a/testcm/Testcm.py b/testcm/Testcm.py new file mode 100644 index 0000000..8291740 --- /dev/null +++ b/testcm/Testcm.py @@ -0,0 +1,6 @@ +import basic.component + +class Testcm(basic.component.Component): + def __init__(self): + print('init test-contract-management') + diff --git a/testcm/testcm/CONFIG.yml b/testcm/testcm/CONFIG.yml new file mode 100644 index 0000000..a01e1f0 --- /dev/null +++ b/testcm/testcm/CONFIG.yml @@ -0,0 +1,47 @@ +# Example of a component with +# # more instance -> connection +# # some subcomponents +# # artifact-type file.log +# -------------------------------------------------------------------- +# the example-applications is the main-application +# it manages contracts of for this doing it has relations to +# # rest-interface as single user-interface +# # crm-system, accounting, product-management +# # own database +# -------------------------------------------------------------------- +conf: + instance: + count: 1 # count of instances + single: n + components: + testacnt: + relationtyp: queue # call|called|queue + conffile: "{dompath}/config/dbconn.xml" + filetyp: xml + ippattern: ".*?(.*?)" + hostpattern: ".*?(.*?)" + testpoldb: + relationtyp: "db" # db : is called by this comp + conffile: "{dompath}/config/settings.xml" + filetyp: xml + urlpattern: ".*?(.*?)" + testprd: + relationtyp: call # call : is called by this comp + conffile: "{dompath}/config/settings.xml" + filetyp: xml + urlpattern: ".*?(.*?)" + function: + check_environment: "todo" + init_testcase: "todo" + finish_testcase: "todo" + system: # look at sysmonitor + script: "{dompath}/bin/sysctl.sh" # for checking + checks: "status,version,start,stop,restart,available" + artifact: # look at testrun + file: + type: log + path: "{dompath}/log/debug.log" + rotate: jmx + reset: testcase + oldfile: "{dompath}/log/debug_{timepattern}.log" + diff --git a/testcm/testcm/Testcm.py b/testcm/testcm/Testcm.py new file mode 100644 index 0000000..8291740 --- /dev/null +++ b/testcm/testcm/Testcm.py @@ -0,0 +1,6 @@ +import basic.component + +class Testcm(basic.component.Component): + def __init__(self): + print('init test-contract-management') + diff --git a/testcrm/CONFIG.yml b/testcrm/CONFIG.yml new file mode 100644 index 0000000..84ceaea --- /dev/null +++ b/testcrm/CONFIG.yml @@ -0,0 +1,22 @@ +# Example af a component like a sub-app with +# # unknown instances -> defined in environment +# # one subcomponents +# # no artifact +# -------------------------------------------------------------------- +# the example-applications is a partner-application +# it manages customers for the any application it has sub-relations to +# # own database +# -------------------------------------------------------------------- +conf: + components: + testcrmdb: + relationtyp: db + conffile: "{dompath}/config/dbconn.xml" + filetyp: xml + ippattern: ".*?(.*?)" + hostpattern: ".*?(.*?)" + function: + check_environment: "todo" + artifact: + none: none + diff --git a/testcrm/Testcrm.py b/testcrm/Testcrm.py new file mode 100644 index 0000000..b3542bb --- /dev/null +++ b/testcrm/Testcrm.py @@ -0,0 +1,5 @@ +import basic.component + +class Testcrm(basic.component.Component): + def __init__(self): + print('init Testb') diff --git a/testcrm/testcrm/CONFIG.yml b/testcrm/testcrm/CONFIG.yml new file mode 100644 index 0000000..84ceaea --- /dev/null +++ b/testcrm/testcrm/CONFIG.yml @@ -0,0 +1,22 @@ +# Example af a component like a sub-app with +# # unknown instances -> defined in environment +# # one subcomponents +# # no artifact +# -------------------------------------------------------------------- +# the example-applications is a partner-application +# it manages customers for the any application it has sub-relations to +# # own database +# -------------------------------------------------------------------- +conf: + components: + testcrmdb: + relationtyp: db + conffile: "{dompath}/config/dbconn.xml" + filetyp: xml + ippattern: ".*?(.*?)" + hostpattern: ".*?(.*?)" + function: + check_environment: "todo" + artifact: + none: none + diff --git a/testcrm/testcrm/Testb.py b/testcrm/testcrm/Testb.py new file mode 100644 index 0000000..6eb37e4 --- /dev/null +++ b/testcrm/testcrm/Testb.py @@ -0,0 +1,5 @@ +import basic.component + +class Testcrm(basic.component.Component): + def __init__(self): + print('init Testcrm') diff --git a/testcrmdb/CONFIG.yml b/testcrmdb/CONFIG.yml new file mode 100644 index 0000000..0303550 --- /dev/null +++ b/testcrmdb/CONFIG.yml @@ -0,0 +1,26 @@ +# Example af a component with +# # one instance -> connection +# # no subcomponents +# # artifact-type db -> precondition, load testdata, postcondition +# -------------------------------------------------------------------- +# the example-applications is the database of an application +# -------------------------------------------------------------------- +conf: + instance: + count: 1 + single: y + components: + none: none + function: + check_environment: "todo" + init_testcase: "todo" # -> precondition, load testdata + finish_testcase: "todo" # -> postcondition, check data + artifact: + db: + #reset: testset + type: csv + adress: + tabname: t_adress + person: + tabname: t_person + diff --git a/testcrmdb/Testcrmdb.py b/testcrmdb/Testcrmdb.py new file mode 100644 index 0000000..fc2d88f --- /dev/null +++ b/testcrmdb/Testcrmdb.py @@ -0,0 +1,5 @@ +import basic.component + +class Testcrmdb(basic.component.Component): + def __init__(self): + print('init Testcrmdb') diff --git a/testcrmdb/adress.csv b/testcrmdb/adress.csv new file mode 100644 index 0000000..6c80bb0 --- /dev/null +++ b/testcrmdb/adress.csv @@ -0,0 +1,8 @@ +table:adress;_field;field;type;acceptance;key +;adrid;a;int;;T:1 +;persid;b;int;; +;street;a;str;;F:1 +;city;b;str;;F:2 +;zip;c;int;;F:3 +;state;d;de;; +;sqft;g;float;; diff --git a/testcrmdb/person.csv b/testcrmdb/person.csv new file mode 100644 index 0000000..597d652 --- /dev/null +++ b/testcrmdb/person.csv @@ -0,0 +1,6 @@ +table:person;field;description;type;acceptance;key +;persid;a;int;;T:1 +;famname;b;str;;F:1 +;name;c;str;;F:2 +;birth;d;date;;F:3 +;sex;e;str;; diff --git a/testcrmdb/testcrmdb/CONFIG.yml b/testcrmdb/testcrmdb/CONFIG.yml new file mode 100644 index 0000000..0303550 --- /dev/null +++ b/testcrmdb/testcrmdb/CONFIG.yml @@ -0,0 +1,26 @@ +# Example af a component with +# # one instance -> connection +# # no subcomponents +# # artifact-type db -> precondition, load testdata, postcondition +# -------------------------------------------------------------------- +# the example-applications is the database of an application +# -------------------------------------------------------------------- +conf: + instance: + count: 1 + single: y + components: + none: none + function: + check_environment: "todo" + init_testcase: "todo" # -> precondition, load testdata + finish_testcase: "todo" # -> postcondition, check data + artifact: + db: + #reset: testset + type: csv + adress: + tabname: t_adress + person: + tabname: t_person + diff --git a/testcrmdb/testcrmdb/Testcrmdb.py b/testcrmdb/testcrmdb/Testcrmdb.py new file mode 100644 index 0000000..b4b503f --- /dev/null +++ b/testcrmdb/testcrmdb/Testcrmdb.py @@ -0,0 +1,5 @@ +import basic.component + +class Testb1(basic.component.Component): + def __init__(self): + print('init Testa1') diff --git a/testcrmdb/testcrmdb/adress.csv b/testcrmdb/testcrmdb/adress.csv new file mode 100644 index 0000000..eecedc6 --- /dev/null +++ b/testcrmdb/testcrmdb/adress.csv @@ -0,0 +1,8 @@ +table:adress;_field;field;type;acceptance;key +adress;adrid;a;int;;T:1 +adress;persid;b;int;; +adress;street;a;str;;F:1 +adress;city;b;str;;F:2 +adress;zip;c;int;;F:3 +adress;state;d;de;; +adress;sqft;g;float;; diff --git a/testcrmdb/testcrmdb/person.csv b/testcrmdb/testcrmdb/person.csv new file mode 100644 index 0000000..6bd8837 --- /dev/null +++ b/testcrmdb/testcrmdb/person.csv @@ -0,0 +1,6 @@ +table:person;field;description;type;acceptance;key +;persid;a;int;;T:1 +;famname;b;string;;F:1 +;name;c;string;;F:2 +;birth;d;date;;F:3 +;sex;e;string;; diff --git a/testpoldb/CONFIG.yml b/testpoldb/CONFIG.yml new file mode 100644 index 0000000..629ff52 --- /dev/null +++ b/testpoldb/CONFIG.yml @@ -0,0 +1,27 @@ +# Example af a component with +# # one instance -> connection +# # no subcomponents +# # artifact-type db -> precondition, load testdata, postcondition +# -------------------------------------------------------------------- +# the example-applications is the database of an application +# -------------------------------------------------------------------- +conf: + instance: + count: 1 + single: y + components: + none: none + function: + check_environment: "todo" + init_testcase: "todo" # -> precondition, load testdata + finish_testcase: "todo" # -> postcondition, check data + artifact: + db: + reset: testset + police: + tabname: t_police + object: + tabname: t_object + product: + tabname: t_product + diff --git a/testpoldb/DATASTRUCTURE.yml b/testpoldb/DATASTRUCTURE.yml new file mode 100644 index 0000000..1cbbdda --- /dev/null +++ b/testpoldb/DATASTRUCTURE.yml @@ -0,0 +1,123 @@ +# Example of a data-structure with +# # different count of tables, id-fields +testpol: # database + police: # table + character: inventory + _header: + - polid + - polnr + - polvers + - persid + - objid + - amount + - bonus + - begindate + - enddate + _data: + polid: + id: "t:1" + acceptance: ignore + type: int + nullable: n + polnr: + id: "b:1" + acceptance: norm + type: string + nullable: n + polvers: + id: "b:2" + acceptance: norm + type: int + nullable: n + persid: + id: n + acceptance: norm + type: int + nullable: n + prdid: + id: n + acceptance: norm + type: int + nullable: n + objid: + id: n + acceptance: norm + type: int + nullable: n + amount: + id: n + acceptance: norm + type: double + nullable: y + bonus: + id: n + acceptance: norm + type: float + nullable: y + begindate: + id: n + acceptance: date + type: date + nullable: n + enddate: + id: n + acceptance: date + type: date + nullable: n + object: + character: inventory + _header: + - objid + - descript + - objtype + - value + _data: + objid: + id: "t:1" + acceptance: norm + type: int + nullable: n + descript: + id: "b:1" + acceptance: exist + type: string + nullable: n + objtype: + id: n + acceptance: norm + type: string + nullable: y + value: + id: n + acceptance: norm + type: double + nullable: y + product: + character: inventory + _header: + - objid + - descript + - objtype + - factor + _data: + prdid: + id: "t:1" + acceptance: norm + type: int + nullable: n + descript: + id: "b:1" + acceptance: exist + type: string + nullable: n + objtype: + id: n + acceptance: norm + type: string + nullable: y + factor: + id: n + acceptance: norm + type: float + nullable: y + diff --git a/testpoldb/Testpoldb.py b/testpoldb/Testpoldb.py new file mode 100644 index 0000000..52a8407 --- /dev/null +++ b/testpoldb/Testpoldb.py @@ -0,0 +1,7 @@ +import basic.component + +class Testpoldb(basic.component.Component): + def __init__(self): + print('init Testa1') + + diff --git a/testpoldb/testpoldb/CONFIG.yml b/testpoldb/testpoldb/CONFIG.yml new file mode 100644 index 0000000..b593fe5 --- /dev/null +++ b/testpoldb/testpoldb/CONFIG.yml @@ -0,0 +1,28 @@ +# Example af a component with +# # one instance -> connection +# # no subcomponents +# # artifact-type db -> precondition, load testdata, postcondition +# -------------------------------------------------------------------- +# the example-applications is the database of an application +# -------------------------------------------------------------------- +conf: + instance: + count: 1 + single: y + components: + none: none + function: + check_environment: "todo" + init_testcase: "todo" # -> precondition, load testdata + finish_testcase: "todo" # -> postcondition, check data + artifact: + db: + reset: testset + type: csv + police: + tabname: t_police + object: + tabname: t_object + product: + tabname: t_product + diff --git a/testpoldb/testpoldb/DATASTRUCTURE.yml b/testpoldb/testpoldb/DATASTRUCTURE.yml new file mode 100644 index 0000000..9cd6942 --- /dev/null +++ b/testpoldb/testpoldb/DATASTRUCTURE.yml @@ -0,0 +1,120 @@ +# Example of a data-structure with +# # different count of tables, id-fields +testpoldb: # database + police: # table + _character: inventory + _header: + - polid + - polnr + - polvers + - persid + - objid + - amount + - bonus + - begindate + - enddate + polid: + id: "t:1" + acceptance: ignore + type: int + nullable: n + polnr: + id: "b:1" + acceptance: norm + type: string + nullable: n + polvers: + id: "b:2" + acceptance: norm + type: int + nullable: n + persid: + id: n + acceptance: norm + type: int + nullable: n + prdid: + id: n + acceptance: norm + type: int + nullable: n + objid: + id: n + acceptance: norm + type: int + nullable: n + amount: + id: n + acceptance: norm + type: double + nullable: y + bonus: + id: n + acceptance: norm + type: float + nullable: y + begindate: + id: n + acceptance: date + type: date + nullable: n + enddate: + id: n + acceptance: date + type: date + nullable: n + object: + character: inventory + _header: + - objid + - descript + - objtype + - value + objid: + id: "t:1" + acceptance: norm + type: int + nullable: n + descript: + id: "b:1" + acceptance: exist + type: string + nullable: n + objtype: + id: n + acceptance: norm + type: string + nullable: y + value: + id: n + acceptance: norm + type: double + nullable: y + product: + _character: inventory + _header: + - prdid + - descript + - objtype + - factor + prdid: + id: "t:1" + acceptance: norm + type: int + nullable: n + descript: + id: "b:1" + acceptance: exist + type: string + nullable: n + objtype: + id: n + acceptance: norm + type: string + nullable: y + factor: + id: n + acceptance: norm + type: float + nullable: y + diff --git a/testpoldb/testpoldb/Testpoldb.py b/testpoldb/testpoldb/Testpoldb.py new file mode 100644 index 0000000..350e26a --- /dev/null +++ b/testpoldb/testpoldb/Testpoldb.py @@ -0,0 +1,7 @@ +import basic.component + +class Testpoldb(basic.component.Component): + def __init__(self): + print('init Testpoldb') + + diff --git a/testprd/CONFIG.yml b/testprd/CONFIG.yml new file mode 100644 index 0000000..8132236 --- /dev/null +++ b/testprd/CONFIG.yml @@ -0,0 +1,28 @@ +# Example af a component like a sub-app with +# # single instance +# # one subcomponents +# # artifact-type file.log +# -------------------------------------------------------------------- +# the example-applications is a sub-application +# it manages products for the main-application it has sub-relations to +# # own database +# -------------------------------------------------------------------- +conf: + instance: + count: 1 + single: n + components: + testprddb: + relationtyp: "db" # db : is called by this comp + conffile: "{dompath}/config/settings.xml" + filetyp: xml + function: + check_environment: "todo" + init_testcase: "todo" + finish_testcase: "todo" + artifact: + file: + path: "{dompath}/log/debug.log" + reset: testsuite + type: log + diff --git a/testprd/Testprd.py b/testprd/Testprd.py new file mode 100644 index 0000000..94eb7e8 --- /dev/null +++ b/testprd/Testprd.py @@ -0,0 +1,5 @@ +import basic.component + +class Testprd(basic.component.Component): + def __init__(self): + print('init Testa1') diff --git a/testprd/testprd/CONFIG.yml b/testprd/testprd/CONFIG.yml new file mode 100644 index 0000000..8132236 --- /dev/null +++ b/testprd/testprd/CONFIG.yml @@ -0,0 +1,28 @@ +# Example af a component like a sub-app with +# # single instance +# # one subcomponents +# # artifact-type file.log +# -------------------------------------------------------------------- +# the example-applications is a sub-application +# it manages products for the main-application it has sub-relations to +# # own database +# -------------------------------------------------------------------- +conf: + instance: + count: 1 + single: n + components: + testprddb: + relationtyp: "db" # db : is called by this comp + conffile: "{dompath}/config/settings.xml" + filetyp: xml + function: + check_environment: "todo" + init_testcase: "todo" + finish_testcase: "todo" + artifact: + file: + path: "{dompath}/log/debug.log" + reset: testsuite + type: log + diff --git a/testprd/testprd/Testprd.py b/testprd/testprd/Testprd.py new file mode 100644 index 0000000..94eb7e8 --- /dev/null +++ b/testprd/testprd/Testprd.py @@ -0,0 +1,5 @@ +import basic.component + +class Testprd(basic.component.Component): + def __init__(self): + print('init Testa1') diff --git a/testprddb/CONFIG.yml b/testprddb/CONFIG.yml new file mode 100644 index 0000000..ab27e07 --- /dev/null +++ b/testprddb/CONFIG.yml @@ -0,0 +1,23 @@ +# Example af a component with +# # one instance -> connection +# # no subcomponents +# # artifact-type db -> precondition, load testdata, postcondition +# -------------------------------------------------------------------- +# the example-applications is the database of an application +# -------------------------------------------------------------------- +conf: + instance: + count: 1 + single: y + components: + none: none + function: + check_environment: "todo" + init_testcase: "todo" # -> precondition, load testdata + finish_testcase: "todo" # -> postcondition, check data + artifact: + db: + reset: testset + product: + tabname: t_product + diff --git a/testprddb/DATASTRUCTURE.yml b/testprddb/DATASTRUCTURE.yml new file mode 100644 index 0000000..812f050 --- /dev/null +++ b/testprddb/DATASTRUCTURE.yml @@ -0,0 +1,31 @@ +# Example of a data-structure with +# # different count of tables, id-fields +testprddb: # database + product: + _character: inventory + _header: + - prdid + - descript + - objtype + - factor + prdid: + id: "t:1" + acceptance: norm + type: int + nullable: n + descript: + id: "b:1" + acceptance: exist + type: string + nullable: n + objtype: + id: n + acceptance: norm + type: string + nullable: y + factor: + id: n + acceptance: norm + type: float + nullable: y + diff --git a/testprddb/Testprddb.py b/testprddb/Testprddb.py new file mode 100644 index 0000000..0a0b825 --- /dev/null +++ b/testprddb/Testprddb.py @@ -0,0 +1,7 @@ +import basic.component + +class Testprddb(basic.component.Component): + def __init__(self): + print('init Testa1') + + diff --git a/testprddb/testprddb/CONFIG.yml b/testprddb/testprddb/CONFIG.yml new file mode 100644 index 0000000..ab27e07 --- /dev/null +++ b/testprddb/testprddb/CONFIG.yml @@ -0,0 +1,23 @@ +# Example af a component with +# # one instance -> connection +# # no subcomponents +# # artifact-type db -> precondition, load testdata, postcondition +# -------------------------------------------------------------------- +# the example-applications is the database of an application +# -------------------------------------------------------------------- +conf: + instance: + count: 1 + single: y + components: + none: none + function: + check_environment: "todo" + init_testcase: "todo" # -> precondition, load testdata + finish_testcase: "todo" # -> postcondition, check data + artifact: + db: + reset: testset + product: + tabname: t_product + diff --git a/testprddb/testprddb/DATASTRUCTURE.yml b/testprddb/testprddb/DATASTRUCTURE.yml new file mode 100644 index 0000000..812f050 --- /dev/null +++ b/testprddb/testprddb/DATASTRUCTURE.yml @@ -0,0 +1,31 @@ +# Example of a data-structure with +# # different count of tables, id-fields +testprddb: # database + product: + _character: inventory + _header: + - prdid + - descript + - objtype + - factor + prdid: + id: "t:1" + acceptance: norm + type: int + nullable: n + descript: + id: "b:1" + acceptance: exist + type: string + nullable: n + objtype: + id: n + acceptance: norm + type: string + nullable: y + factor: + id: n + acceptance: norm + type: float + nullable: y + diff --git a/testprddb/testprddb/Testprddb.py b/testprddb/testprddb/Testprddb.py new file mode 100644 index 0000000..0a0b825 --- /dev/null +++ b/testprddb/testprddb/Testprddb.py @@ -0,0 +1,7 @@ +import basic.component + +class Testprddb(basic.component.Component): + def __init__(self): + print('init Testa1') + + diff --git a/testrest/CONFIG.yml b/testrest/CONFIG.yml new file mode 100644 index 0000000..b40e863 --- /dev/null +++ b/testrest/CONFIG.yml @@ -0,0 +1,26 @@ +# Example af a component with +# # one instance -> connection +# # mo subcomponents +# # artifact-tyoe flaskdb -> precondition, load testdata, postcondition +conf: + instance: + count: 1 + single: y + components: + none: none + function: + init_testcase: "todo" + execute_testcase: "todo" + collect_testcase: "todo" # -> postcondition, check data + compare_testcase: "todo" # -> postcondition, check data + artifact: + file: + reset: testcase + jsonrest: + name: json-rest + type: json + path: requests + xmlrest: + name: xml-rest + type: xml + path: requests diff --git a/testrest/Testrest.py b/testrest/Testrest.py new file mode 100644 index 0000000..df4f583 --- /dev/null +++ b/testrest/Testrest.py @@ -0,0 +1,22 @@ +import basic.component +import basic.toolHandling + +class Testrest(basic.component.Component): + def __init__(self): + print('init Testrest') + + def create_Request(self, step, tdata): + """ + + :param step: + :return: + """ + fileClass = basic.toolHandling.getDbTool(self) + + pass + + def send_Request(self, granularity): + pass + def get_Response(self, granularity): + pass + diff --git a/testrest/config-schema.json b/testrest/config-schema.json new file mode 100644 index 0000000..34161b6 --- /dev/null +++ b/testrest/config-schema.json @@ -0,0 +1,153 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$ref": "#/definitions/Welcome8", + "definitions": { + "Welcome8": { + "type": "object", + "additionalProperties": false, + "properties": { + "conf": { + "$ref": "#/definitions/Conf" + } + }, + "required": [ + "conf" + ], + "title": "Welcome8" + }, + "Conf": { + "type": "object", + "additionalProperties": false, + "properties": { + "instance": { + "$ref": "#/definitions/Instance" + }, + "components": { + "$ref": "#/definitions/Components" + }, + "function": { + "$ref": "#/definitions/Function" + }, + "artifact": { + "$ref": "#/definitions/Artifact" + } + }, + "required": [ + "artifact", + "components", + "function", + "instance" + ], + "title": "Conf" + }, + "Artifact": { + "type": "object", + "additionalProperties": false, + "properties": { + "file": { + "$ref": "#/definitions/ArtifactFile" + } + }, + "required": [ + "file" + ], + "title": "Artifact" + }, + "ArtifactFile": { + "type": "object", + "additionalProperties": false, + "properties": { + "reset": { + "type": "string" + }, + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/FileElement" + } + } + }, + "required": [ + "files", + "reset" + ], + "title": "ArtifactFile" + }, + "FileElement": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "path": { + "type": "string" + } + }, + "required": [ + "name", + "path", + "type" + ], + "title": "FileElement" + }, + "Components": { + "type": "object", + "additionalProperties": false, + "properties": { + "none": { + "type": "string" + } + }, + "required": [ + "none" + ], + "title": "Components" + }, + "Function": { + "type": "object", + "additionalProperties": false, + "properties": { + "init_testcase": { + "type": "string" + }, + "execute_testcase": { + "type": "string" + }, + "collect_testcase": { + "type": "string" + }, + "compare_testcase": { + "type": "string" + } + }, + "required": [ + "collect_testcase", + "compare_testcase", + "execute_testcase", + "init_testcase" + ], + "title": "Function" + }, + "Instance": { + "type": "object", + "additionalProperties": false, + "properties": { + "count": { + "type": "integer" + }, + "single": { + "type": "string" + } + }, + "required": [ + "count", + "single" + ], + "title": "Instance" + } + } +} diff --git a/testrest/testrest/CONFIG.yml b/testrest/testrest/CONFIG.yml new file mode 100644 index 0000000..2ad0e9c --- /dev/null +++ b/testrest/testrest/CONFIG.yml @@ -0,0 +1,29 @@ +# Example af a component with +# # one instance -> connection +# # mo subcomponents +# # artifact-tyoe flaskdb -> precondition, load testdata, postcondition +conf: + instance: + count: 1 + single: y + components: + none: none + function: + finish_testcase: "todo" # -> postcondition, check data + init_testcase: "todo" + execute_testcase: "todo" + finish_testcase: "todo" + teststeps: + xml-rest: + s01: + tool: file + type: xml + json-rest: + s01: + tool: file + type: json + artifact: + file: + reset: testcase + type: json + path: requests diff --git a/testrest/testrest/Testrest.py b/testrest/testrest/Testrest.py new file mode 100644 index 0000000..03614dd --- /dev/null +++ b/testrest/testrest/Testrest.py @@ -0,0 +1,7 @@ +import basic.component + +class Testrest(basic.component.Component): + def __init__(self): + print('init Testa1') + + diff --git a/testrest/testrest/mesage.xsd b/testrest/testrest/mesage.xsd new file mode 100644 index 0000000..0620bb2 --- /dev/null +++ b/testrest/testrest/mesage.xsd @@ -0,0 +1,43 @@ + + +<-- datatypes --> + + + + + + + + + +<-- complex types --> + + + + + + + + + + + + + + +<-- document-structure --> + + + + + + + + + + + + + + diff --git a/tool_i18n.yml b/tool_i18n.yml new file mode 100644 index 0000000..e074730 --- /dev/null +++ b/tool_i18n.yml @@ -0,0 +1,49 @@ +en: + # keywords testdata + DFILE_TESTCASE_NAME: "testspec" + DFILE_TESTSUITE_NAME: "testsuite" + DFILE_TABLE_PREFIX: "table_" + CSV_BLOCK_HEAD: "head" + CSV_BLOCK_OPTION: "option" + CSV_BLOCK_STEP: "step" + CSV_BLOCK_TABLES: "table" + CSV_BLOCK_IMPORT: "import" + DATA_ATTR_COUNT: "_count" + DATA_ATTR_DATE: "_date" + DATA_ATTR_CHAR: "_char" + DATA_ATTR_COMP: "_comp" + DATA_ATTR_KEY: "_key" + DATA_NODE_HEADER: "header" + DATA_NODE_DATA: "data" + DATA_NODE_STEPS: "steps" + DATA_NODE_OPTION: "option" + DATA_NODE_TABLES: "table" + DATA_NODE_KEYS: "keys" + STEP_ATTR_COMP: "component" + STEP_ATTR_EXECNR: "exec-step" + STEP_ATTR_REFNR: "reference-nr" + STEP_ATTR_ARGS: "arguments" + EXP_KEY_MISSING: "key is missing {}" + EXP_KEY_DOESNT_EXIST: "key doesnt exist in domain {}" +de: + # Schluesselworte Testdaten + DFILE_TESTCASE_NAME: "Testfallpezifikation" + DFILE_TESTSUITE_NAME: "Testsuite" + DFILE_TABLE_PREFIX: "Daten_" + CSV_BLOCK_HEAD: "Kopfdaten" + CSV_BLOCK_OPTION: "Option" + CSV_BLOCK_STEP: "Schritt" + CSV_BLOCK_TABLES: "Tabelle" + CSV_BLOCK_IMPORT: "import" + EXP_KEY_MISSING: "Schluesselwort fehlt {}" + #EXP_KEY_DOESNT_EXIST: "Schluesselwort fehlt in Domain {}" + DATA_ATTR_COUNT: "Anzahl" + DATA_ATTR_DATE: "Datum" + DATA_ATTR_CHAR: "Charakter" + DATA_ATTR_COMP: "Komponente" + DATA_NODE_HEADER: "header" + DATA_NODE_DATA: "data" + DATA_NODE_STEPS: "Schritte" + DATA_NODE_OPTION: "Option" + DATA_NODE_TABLES: "Tabelle" + DATA_NODE_KEYS: "keys"