#!/usr/bin/python # -*- coding: utf-8 -*- # --------------------------------------------------------------------------------------------------------- # Author : Ulrich Carmesin # Source : gitea.ucarmesin.de # --------------------------------------------------------------------------------------------------------- """ The constants desribes the keywords of the main datastructures, these are * the configurations of * program-configuration for general technical variables in xtools - stored in internal conf-folder it represents the general knowledge of this test-automatism * xbasic-configuration for global variables in job - stored in external conf-folder it represents the knowledge of your test-topic * comp-configuration for component-attributes - stored in internal component-folder in + ddl-configuration of an entity of the component as attributes - stored in internal component-folder + environment-config for connection-attributes of the component - stored in external environment-folder it represents the application-knowledge and the knowledge of the application-installation * test-specification with testdata - stored in external testdata-folder * the internal datastructure """ # ------------------------------------------------------------- # values and keywords BASIS_FILE = "basis" SVAL_YES = "y" SVAL_NO = "n" SVAL_NULL = "null" # ------------------------------------------------------------- # parameter with arguments PAR_PROJ = 'project' """ definition of the project which will be tested """ PAR_APP = 'application' """ definition of the application which will be tested """ PAR_ENV = 'environment' """ definition of the environment where the application runs which will be tested """ PAR_VAR = 'variant' """ definition of a variant dataflow especially the channel """ PAR_REL = 'release' """ definition of the release of the application which will be tested """ PAR_TSDIR = 'tsdir' """ definition of the directory of the testsuite for summaries of the testcases """ PAR_TCDIR = 'tcdir' """ definition of the directory of the testcase for logs and results """ PAR_XPDIR = 'xpdir' """ definition of the directory of expectation for comparing the testcase """ PAR_WSDIR = "wsdir" """ definition of the directory of the workspace """ PAR_TDTYP = 'tdtyp' PAR_TDSRC = 'tdsrc' PAR_TDNAME = 'tdname' PAR_LOG = 'loglevel' PAR_MODUS = 'modus' PAR_COMP = 'component' PAR_FCT = 'function' PAR_TOOL = 'tool' PAR_STEP = 'step' PAR_DESCRIPT = 'desription' """ """ PAR_TESTCASE = "testcase" PAR_TESTCASES = "testcases" PAR_TESTSUITE = "usecase" # todo Trennung testsuite - usecase denn n:1-Zuordnung PAR_TCTIME = "tctime" PAR_TSTIME = "tstime" PAR_TESTINSTANCES = "testinstances" """ name of testcase extracted from PAR_TCDIR """ PAR_DB_WHERE = "dbwhere" """ optional parameter with a where-clause """ PAR_DB_PARTITION = "dbparts" """ optional parameter for partitions of a partitioned tables """ LIST_MAIN_PAR = [PAR_APP, PAR_ENV, PAR_VAR, PAR_REL, PAR_TSDIR, PAR_TSDIR] # ------------------------------------------------------------- # attributes # ------------------------------------------------------------- # structure - nodes # the internal datastructure is a tree with this design: # root { : constant # + option { : constant # + steps # + comp { : variable component-name # + substructure { : variable maybe scheme, table of a database-component # + + _header [ : constant # - fields : variable field-name CONF_NODE_GENERAL = "_general" """ This constant defines a subnode of a table for the column-names """ DATA_NODE_HEADER = "_header" """ This constant defines a subnode of a table for the column-names """ DATA_NODE_DATA = "_data" """ This constant defines a subnode of a table for the data which are set as key-value-pair with the column-names as key """ DATA_NODE_STEPS = "_steps" """ This constant defines the main node in the testdata for the steps to execute """ DATA_NODE_OPTION = "_option" """ This constant defines main node in the testdata for testcase specific parameters """ DATA_NODE_TABLES = "_tables" """ This constant defines the main node in the testdata for the steps to execute """ DATA_NODE_KEYS = "_keys" """ This constant defines the main node in the testdata for the steps to execute """ DATA_NODE_DDL = "ddl" """ This constant defines the node for data scheme (DataDefinitionLanguage) The fields are defined in data_const (D) """ DATA_NODE_COMP = "comp" """ This constant defines """ DATA_NODE_PAR = "par" DATA_NODE_CATALOG = "_catalog" DATA_NODE_ROW = "_row" ATTR_ARTS_TYPE = "type" """ must attribute for the type of the technique """ ATTR_ARTS_NAME = "name" """ optional attribute just for information """ ATTR_ARTS_PATH = "path" """ optional attribute for the xbasic folder if the artifact is stored in the filesystem """ ATTR_ARTS_RESET = "reset" """ optional attribute if the artefact should be reset in the initializing-phase """ ATTR_ARTS_PRESTEP = "prestep" """ optional attribute to define a source-table for this table """ LIST_ARTS_ATTR = [ATTR_ARTS_TYPE, ATTR_ARTS_PATH, ATTR_ARTS_RESET, ATTR_ARTS_PRESTEP, ATTR_ARTS_NAME] TOPIC_NODE_DB = "db" # testexec, db_abstr ATTR_DB_PARTITION = "partitioned" """ optional attribute if table is partitioned - this keyword delimited by "+" will be replaced by partition-names which are parametrized """ ATTR_DB_DATABASE = "database" """ attribute for technical name of the database """ ATTR_DB_SCHEMA = "schema" """ optional attribute for technical name of the schema """ ATTR_DB_TABNAME = "tabname" """ optional attribute in order to use a different technical name for the db-table """ ATTR_DB_USER = "user" """ optional attribute in order to use a different technical name for the db-table """ ATTR_DB_PASSWD = "password" """ optional attribute in order to use a different technical name for the db-table """ ATTR_DB_HOST = "hostname" """ optional attribute in order to use a different technical name for the db-table """ LIST_DB_ATTR = [ATTR_DB_PARTITION, ATTR_DB_DATABASE, ATTR_DB_SCHEMA, ATTR_DB_TABNAME, ATTR_ARTS_PRESTEP, ATTR_DB_USER, ATTR_DB_PASSWD, ATTR_DB_HOST] + LIST_ARTS_ATTR TOPIC_NODE_CLI = "cli" LIST_CLI_ATTR = [] + LIST_ARTS_ATTR TOPIC_NODE_API = "api" LIST_API_ATTR = [] + LIST_ARTS_ATTR TOPIC_NODE_FILE = "file" ATTR_FILE_OLD = "oldfile" ATTR_FILE_ROTATE = "rotate" NODE_ATTRIBUTES = "attributes" LIST_FILE_ATTR = [ATTR_FILE_OLD, ATTR_FILE_ROTATE] + LIST_ARTS_ATTR LIST_ATTR = { TOPIC_NODE_DB: LIST_DB_ATTR, TOPIC_NODE_API: LIST_API_ATTR, TOPIC_NODE_CLI: LIST_CLI_ATTR, TOPIC_NODE_FILE: LIST_FILE_ATTR } ATTR_DB_CONN_JAR = "conn_jar_name" """ optional attribute for connection-jar-file instead of connection by ip, port """ ATTR_CONN_HOST = "hostname" """ optional attribute for connection-jar-file instead of connection by ip, port """ ATTR_CONN_TENANT = "tenant" """ optional attribute for connection-jar-file instead of connection by ip, port """ ATTR_CONN_IP = "ip" ATTR_CONN_PORT = "port" ATTR_CONN_DOMPATH = "dompath" """ directory where the component is stored in the filesystem """ ATTR_CONN_USER = "user" ATTR_CONN_PASSWD = "password" LIST_CONN_ATTR = [ATTR_CONN_HOST, ATTR_CONN_IP, ATTR_CONN_PORT, ATTR_CONN_DOMPATH, ATTR_CONN_USER, ATTR_CONN_PASSWD] # the configuration of a component or tool # entity { : variable name of the group, xbasic, component-name or tool-name # + subject { : variable subject-name - it correspondends to a tool # + + sub-subject { : variable subject-name - it correspondends to a tool # + attributes : constant of the tool in which the attribute ist implemented # the main subjects # prog xbasic envir tool comp testcase main implentation module SUBJECT_PATH = "paths" # | x | | x | | path_tool, config_tool """ This constant defines the subject in order to define paths of filesystem of any testuse """ ATTR_PATH_MODE = "mode" """ This constant defines the home-folder in filesystem of test """ ATTR_PATH_HOME = "home" """ This constant defines the home-folder in testing-filesystem """ ATTR_PATH_DEBUG = "debugs" """ This constant defines the debug-folder in testing-filesystem """ ATTR_PATH_ARCHIV = "archiv" """ This constant defines the folder in testing-filesystem for results and log of execution """ ATTR_PATH_EXPECT = "expect" """ This constant defines the folder in testing-filesystem for test-expectation values """ ATTR_PATH_PROGRAM = "program" """ This constant defines the program-folder in the workspace """ ATTR_PATH_COMPS = "components" """ This constant defines the subfolder in the program-folder in the workspace """ ATTR_PATH_ENV = "environment" """ This constant defines the folder in testing-filesystem, used for configs related to environments """ ATTR_PATH_RELEASE = "release" """ This constant defines the folder in testing-filesystem, used for configs related to release """ ATTR_PATH_TDATA = "testdata" """ This constant defines the folder in testing-filesystem with the testcase-specifications """ ATTR_PATH_PATTN = "pattern" """ This constant defines the debug-folder in testing-filesystem """ SUBJECT_APPS = "applications" # | x | | | | CompHandling ATTR_APPS_PROJECT = "project" # | | | | x | CompHanlding SUBJECT_ENTITY = "entity" SUBJECT_INST = "instance" # | | | | x | CompHanlding ATTR_INST_CNT = "count" # | | | | x | CompHanlding ATTR_INST_SGL = "single" LIST_INST_ATTR = [ATTR_INST_CNT, ATTR_INST_SGL] SUBJECT_COMPS = "components" ATTR_INST_SUBCOMP = SUBJECT_COMPS #SUBJECT_FCT = "function" # | | | | x | main-programs SUBJECT_ARTS = "artifact" # | | | | x | Component """ in this subject-node are each kind of result of any component with the structure: * topic (db, cli, api, ...) * * general attributes - to-know: technical attributes are stored in connection-tree * * partial-component - to-know: the existence of db-tables can be defined in the ddl-tree * * * specific attributes - it overrides the general attributes """ #ATTR_ARTS_DB = "db" ATTR_ARTS_LOG = "log" ATTR_ARTS_LOB = "lob" ATTR_ARTS_FILE = "file" #SUBJECT_DB = "databases" # | | | | # | db*_tools, match_tool SUBJECT_PROJECTS = "projects" SUBJECT_ENV = PAR_ENV SUBJECT_CONN = "conn" # | | x | | | conn_tool, db*_tools, cli*_toold ATTR_TYPE = "type" # | x | x | | x | conn_tool, toolHandling, db*_tools RULE_ACCEPTANCE = "acceptance" # | | | | x | tools_match ATTR_STEP_ARGS = "args" ATTR_EXEC_REF = "_exec" ATTR_DATA_REF = "_nr" ATTR_DATA_COMP = "_comp" SUBJECT_DESCRIPTION = "description" SUBJECT_REFERENCE = "reference" SUBJECT_TOOL = "tool" LIST_SUBJECTS = [SUBJECT_APPS, SUBJECT_ARTS, SUBJECT_CONN, SUBJECT_COMPS, SUBJECT_INST, SUBJECT_TOOL, SUBJECT_PROJECTS] # ------------------------------------------------------------- # exception texts EXP_NO_BASIS_FILE = "basis file cant be found" EXCEPT_NOT_IMPLEMENT = "method is not implemented" EXCEPT_NOT_INITIALIZED = "class is not initialized"