Ulrich Carmesin
2 years ago
46 changed files with 1341 additions and 0 deletions
@ -0,0 +1,7 @@ |
|||
applications: |
|||
TESTAPP: |
|||
project: TESTAPP |
|||
testcm: comp |
|||
testrest: comp |
|||
testcrm: comp |
|||
|
@ -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 |
@ -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() |
@ -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 |
@ -0,0 +1,7 @@ |
|||
import basic.component |
|||
|
|||
class Testacnt(basic.component.Component): |
|||
def __init__(self): |
|||
print('init Testa1') |
|||
|
|||
|
@ -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 |
@ -0,0 +1,7 @@ |
|||
import basic.component |
|||
|
|||
class Testacnt(basic.component.Component): |
|||
def __init__(self): |
|||
print('init Testa1') |
|||
|
|||
|
@ -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: "<first>.*?<ulr>(.*?)</url>" |
|||
testprd: |
|||
relationtyp: call # call : is called by this comp |
|||
conffile: "{dompath}/config/settings.xml" |
|||
filetyp: xml |
|||
urlpattern: "<first>.*?<ulr>(.*?)</url>" |
|||
testacnt: |
|||
relationtyp: queue # call|called|queue |
|||
conffile: "{dompath}/config/dbconn.xml" |
|||
filetyp: xml |
|||
ippattern: "<second>.*?<ip>(.*?)</ip>" |
|||
hostpattern: "<second>.*?<hostname>(.*?)</hostname>" |
|||
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" |
|||
|
@ -0,0 +1,6 @@ |
|||
import basic.component |
|||
|
|||
class Testcm(basic.component.Component): |
|||
def __init__(self): |
|||
print('init test-contract-management') |
|||
|
@ -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: "<second>.*?<ip>(.*?)</ip>" |
|||
hostpattern: "<second>.*?<hostname>(.*?)</hostname>" |
|||
testpoldb: |
|||
relationtyp: "db" # db : is called by this comp |
|||
conffile: "{dompath}/config/settings.xml" |
|||
filetyp: xml |
|||
urlpattern: "<first>.*?<ulr>(.*?)</url>" |
|||
testprd: |
|||
relationtyp: call # call : is called by this comp |
|||
conffile: "{dompath}/config/settings.xml" |
|||
filetyp: xml |
|||
urlpattern: "<first>.*?<ulr>(.*?)</url>" |
|||
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" |
|||
|
@ -0,0 +1,6 @@ |
|||
import basic.component |
|||
|
|||
class Testcm(basic.component.Component): |
|||
def __init__(self): |
|||
print('init test-contract-management') |
|||
|
@ -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: "<second>.*?<ip>(.*?)</ip>" |
|||
hostpattern: "<second>.*?<hostname>(.*?)</hostname>" |
|||
function: |
|||
check_environment: "todo" |
|||
artifact: |
|||
none: none |
|||
|
@ -0,0 +1,5 @@ |
|||
import basic.component |
|||
|
|||
class Testcrm(basic.component.Component): |
|||
def __init__(self): |
|||
print('init Testb') |
@ -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: "<second>.*?<ip>(.*?)</ip>" |
|||
hostpattern: "<second>.*?<hostname>(.*?)</hostname>" |
|||
function: |
|||
check_environment: "todo" |
|||
artifact: |
|||
none: none |
|||
|
@ -0,0 +1,5 @@ |
|||
import basic.component |
|||
|
|||
class Testcrm(basic.component.Component): |
|||
def __init__(self): |
|||
print('init Testcrm') |
@ -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 |
|||
|
@ -0,0 +1,5 @@ |
|||
import basic.component |
|||
|
|||
class Testcrmdb(basic.component.Component): |
|||
def __init__(self): |
|||
print('init Testcrmdb') |
|
|
@ -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 |
|||
|
@ -0,0 +1,5 @@ |
|||
import basic.component |
|||
|
|||
class Testb1(basic.component.Component): |
|||
def __init__(self): |
|||
print('init Testa1') |
|
|
@ -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 |
|||
|
@ -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 |
|||
|
@ -0,0 +1,7 @@ |
|||
import basic.component |
|||
|
|||
class Testpoldb(basic.component.Component): |
|||
def __init__(self): |
|||
print('init Testa1') |
|||
|
|||
|
@ -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 |
|||
|
@ -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 |
|||
|
@ -0,0 +1,7 @@ |
|||
import basic.component |
|||
|
|||
class Testpoldb(basic.component.Component): |
|||
def __init__(self): |
|||
print('init Testpoldb') |
|||
|
|||
|
@ -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 |
|||
|
@ -0,0 +1,5 @@ |
|||
import basic.component |
|||
|
|||
class Testprd(basic.component.Component): |
|||
def __init__(self): |
|||
print('init Testa1') |
@ -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 |
|||
|
@ -0,0 +1,5 @@ |
|||
import basic.component |
|||
|
|||
class Testprd(basic.component.Component): |
|||
def __init__(self): |
|||
print('init Testa1') |
@ -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 |
|||
|
@ -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 |
|||
|
@ -0,0 +1,7 @@ |
|||
import basic.component |
|||
|
|||
class Testprddb(basic.component.Component): |
|||
def __init__(self): |
|||
print('init Testa1') |
|||
|
|||
|
@ -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 |
|||
|
@ -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 |
|||
|
@ -0,0 +1,7 @@ |
|||
import basic.component |
|||
|
|||
class Testprddb(basic.component.Component): |
|||
def __init__(self): |
|||
print('init Testa1') |
|||
|
|||
|
@ -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 |
@ -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 |
|||
|
@ -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" |
|||
} |
|||
} |
|||
} |
@ -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 |
@ -0,0 +1,7 @@ |
|||
import basic.component |
|||
|
|||
class Testrest(basic.component.Component): |
|||
def __init__(self): |
|||
print('init Testa1') |
|||
|
|||
|
@ -0,0 +1,43 @@ |
|||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
|||
|
|||
<-- datatypes --> |
|||
<xs:simpleType name="sex-type"> |
|||
<xs:restricition base="xs:string> |
|||
<xs:enumeration value="M"/> |
|||
<xs:enumeration value="F"/> |
|||
<xs:enumeration value="W"/> |
|||
<xs:enumeration value="D"/> |
|||
<xs:enumeration value="U"/> |
|||
</xs:restricition> |
|||
</xs:simpleType> |
|||
|
|||
<-- complex types --> |
|||
<xs:complexType name="person-type"> |
|||
<xs:sequnece> |
|||
<xs:element name="famname" type="xs:string"/> |
|||
<xs:element name="name" type="xs:string"/> |
|||
<xs:element name="birthdate" type="xs:date"/> |
|||
<xs:element name="sex" type="xs:sex-type"/> |
|||
</xs:sequnece> |
|||
</xs:complexType> |
|||
<xs:complexType name="person-list"> |
|||
<xs:sequnece> |
|||
<xs:element name="person" type="person-type" maxOccurs="unbounded"/> |
|||
</xs:sequnece> |
|||
</xs:complexType> |
|||
|
|||
<-- document-structure --> |
|||
<xs:complexType name="message"> |
|||
<xs:sequnece> |
|||
<xs:element name="sender-block" type="sender-type" use="required"/> |
|||
<xs:complexType name="message-block"/> |
|||
<xs:sequnece> |
|||
<xs:element name="person-block" type="person-type" use="required"/> |
|||
<xs:element name="adress-block" type="adress-type" use="required"/> |
|||
<xs:element name="product-block" type="product-list" minOccurs="1" maxOccurs="unbounded"/> |
|||
</xs:sequnece> |
|||
</xs:complexType> |
|||
</xs:sequnece> |
|||
</xs:complexType> |
|||
</xs:schema> |
|||
|
@ -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" |
Loading…
Reference in new issue