Browse Source

init content

master
Ulrich Carmesin 2 years ago
parent
commit
8294a7eb3c
  1. 7
      applications.yml
  2. 52
      readme.txt
  3. 137
      test/test_31db.py
  4. 26
      testacnt/CONFIG.yml
  5. 7
      testacnt/Testacnt.py
  6. 26
      testacnt/testacnt/CONFIG.yml
  7. 7
      testacnt/testacnt/Testacnt.py
  8. 47
      testcm/CONFIG.yml
  9. 6
      testcm/Testcm.py
  10. 47
      testcm/testcm/CONFIG.yml
  11. 6
      testcm/testcm/Testcm.py
  12. 22
      testcrm/CONFIG.yml
  13. 5
      testcrm/Testcrm.py
  14. 22
      testcrm/testcrm/CONFIG.yml
  15. 5
      testcrm/testcrm/Testb.py
  16. 26
      testcrmdb/CONFIG.yml
  17. 5
      testcrmdb/Testcrmdb.py
  18. 8
      testcrmdb/adress.csv
  19. 6
      testcrmdb/person.csv
  20. 26
      testcrmdb/testcrmdb/CONFIG.yml
  21. 5
      testcrmdb/testcrmdb/Testcrmdb.py
  22. 8
      testcrmdb/testcrmdb/adress.csv
  23. 6
      testcrmdb/testcrmdb/person.csv
  24. 27
      testpoldb/CONFIG.yml
  25. 123
      testpoldb/DATASTRUCTURE.yml
  26. 7
      testpoldb/Testpoldb.py
  27. 28
      testpoldb/testpoldb/CONFIG.yml
  28. 120
      testpoldb/testpoldb/DATASTRUCTURE.yml
  29. 7
      testpoldb/testpoldb/Testpoldb.py
  30. 28
      testprd/CONFIG.yml
  31. 5
      testprd/Testprd.py
  32. 28
      testprd/testprd/CONFIG.yml
  33. 5
      testprd/testprd/Testprd.py
  34. 23
      testprddb/CONFIG.yml
  35. 31
      testprddb/DATASTRUCTURE.yml
  36. 7
      testprddb/Testprddb.py
  37. 23
      testprddb/testprddb/CONFIG.yml
  38. 31
      testprddb/testprddb/DATASTRUCTURE.yml
  39. 7
      testprddb/testprddb/Testprddb.py
  40. 26
      testrest/CONFIG.yml
  41. 22
      testrest/Testrest.py
  42. 153
      testrest/config-schema.json
  43. 29
      testrest/testrest/CONFIG.yml
  44. 7
      testrest/testrest/Testrest.py
  45. 43
      testrest/testrest/mesage.xsd
  46. 49
      tool_i18n.yml

7
applications.yml

@ -0,0 +1,7 @@
applications:
TESTAPP:
project: TESTAPP
testcm: comp
testrest: comp
testcrm: comp

52
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

137
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()

26
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

7
testacnt/Testacnt.py

@ -0,0 +1,7 @@
import basic.component
class Testacnt(basic.component.Component):
def __init__(self):
print('init Testa1')

26
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

7
testacnt/testacnt/Testacnt.py

@ -0,0 +1,7 @@
import basic.component
class Testacnt(basic.component.Component):
def __init__(self):
print('init Testa1')

47
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: "<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"

6
testcm/Testcm.py

@ -0,0 +1,6 @@
import basic.component
class Testcm(basic.component.Component):
def __init__(self):
print('init test-contract-management')

47
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: "<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"

6
testcm/testcm/Testcm.py

@ -0,0 +1,6 @@
import basic.component
class Testcm(basic.component.Component):
def __init__(self):
print('init test-contract-management')

22
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: "<second>.*?<ip>(.*?)</ip>"
hostpattern: "<second>.*?<hostname>(.*?)</hostname>"
function:
check_environment: "todo"
artifact:
none: none

5
testcrm/Testcrm.py

@ -0,0 +1,5 @@
import basic.component
class Testcrm(basic.component.Component):
def __init__(self):
print('init Testb')

22
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: "<second>.*?<ip>(.*?)</ip>"
hostpattern: "<second>.*?<hostname>(.*?)</hostname>"
function:
check_environment: "todo"
artifact:
none: none

5
testcrm/testcrm/Testb.py

@ -0,0 +1,5 @@
import basic.component
class Testcrm(basic.component.Component):
def __init__(self):
print('init Testcrm')

26
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

5
testcrmdb/Testcrmdb.py

@ -0,0 +1,5 @@
import basic.component
class Testcrmdb(basic.component.Component):
def __init__(self):
print('init Testcrmdb')

8
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;;
1 table:adress _field field type acceptance key
2 adrid a int T:1
3 persid b int
4 street a str F:1
5 city b str F:2
6 zip c int F:3
7 state d de
8 sqft g float

6
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;;
1 table:person field description type acceptance key
2 persid a int T:1
3 famname b str F:1
4 name c str F:2
5 birth d date F:3
6 sex e str

26
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

5
testcrmdb/testcrmdb/Testcrmdb.py

@ -0,0 +1,5 @@
import basic.component
class Testb1(basic.component.Component):
def __init__(self):
print('init Testa1')

8
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;;
1 table:adress _field field type acceptance key
2 adress adrid a int T:1
3 adress persid b int
4 adress street a str F:1
5 adress city b str F:2
6 adress zip c int F:3
7 adress state d de
8 adress sqft g float

6
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;;
1 table:person field description type acceptance key
2 persid a int T:1
3 famname b string F:1
4 name c string F:2
5 birth d date F:3
6 sex e string

27
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

123
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

7
testpoldb/Testpoldb.py

@ -0,0 +1,7 @@
import basic.component
class Testpoldb(basic.component.Component):
def __init__(self):
print('init Testa1')

28
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

120
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

7
testpoldb/testpoldb/Testpoldb.py

@ -0,0 +1,7 @@
import basic.component
class Testpoldb(basic.component.Component):
def __init__(self):
print('init Testpoldb')

28
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

5
testprd/Testprd.py

@ -0,0 +1,5 @@
import basic.component
class Testprd(basic.component.Component):
def __init__(self):
print('init Testa1')

28
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

5
testprd/testprd/Testprd.py

@ -0,0 +1,5 @@
import basic.component
class Testprd(basic.component.Component):
def __init__(self):
print('init Testa1')

23
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

31
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

7
testprddb/Testprddb.py

@ -0,0 +1,7 @@
import basic.component
class Testprddb(basic.component.Component):
def __init__(self):
print('init Testa1')

23
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

31
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

7
testprddb/testprddb/Testprddb.py

@ -0,0 +1,7 @@
import basic.component
class Testprddb(basic.component.Component):
def __init__(self):
print('init Testa1')

26
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

22
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

153
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"
}
}
}

29
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

7
testrest/testrest/Testrest.py

@ -0,0 +1,7 @@
import basic.component
class Testrest(basic.component.Component):
def __init__(self):
print('init Testa1')

43
testrest/testrest/mesage.xsd

@ -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>

49
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"
Loading…
Cancel
Save