Skip to content

Commit

Permalink
使用nop-autotest重新实现DynCodeGen的单元测试
Browse files Browse the repository at this point in the history
  • Loading branch information
entropy-cloud committed Aug 9, 2024
1 parent e6e1b03 commit d007d15
Show file tree
Hide file tree
Showing 20 changed files with 86 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
CREATE TABLE USER_ENTITY(
SID VARCHAR(32) COMMENT '主键ID' ,
USER_NAME VARCHAR(100) COMMENT '用户名' ,
USER_AGE INTEGER default '1' COMMENT '用户年龄' ,
ROLE_ID VARCHAR(200) COMMENT '角色 ID' ,
STATUS INTEGER default '1' COMMENT '状态' ,
VERSION INTEGER COMMENT '数据版本' ,
CREATED_BY VARCHAR(50) COMMENT '创建人' ,
CREATE_TIME TIMESTAMP COMMENT '创建时间' ,
UPDATED_BY VARCHAR(50) COMMENT '修改人' ,
UPDATE_TIME TIMESTAMP COMMENT '修改时间' ,
constraint PK_USER_ENTITY_ID primary key (sid)
);

INSERT INTO USER_ENTITY (sid, user_name, user_age, role_id, STATUS, VERSION, CREATED_BY, CREATE_TIME, UPDATED_BY, UPDATE_TIME) VALUES ('1', '小明', 1, '123', 1, 1, '小明', '2021-09-01 00:00:00', '小明', '2021-09-01 00:00:00'),('2', '小李', 200, '123', 1, 1, '小李', '2021-09-01 00:00:00', '小李', '2021-09-01 00:00:00');

CREATE TABLE ROLE_ENTITY(
SID VARCHAR(32) COMMENT '主键ID' ,
ROLE_NAME VARCHAR(100) COMMENT '角色名称' ,
ROLE_KEY VARCHAR(100) COMMENT '角色 key' ,
STATUS INTEGER default '1' COMMENT '状态' ,
VERSION INTEGER COMMENT '数据版本' ,
CREATED_BY VARCHAR(50) COMMENT '创建人' ,
CREATE_TIME TIMESTAMP COMMENT '创建时间' ,
UPDATED_BY VARCHAR(50) COMMENT '修改人' ,
UPDATE_TIME TIMESTAMP COMMENT '修改时间' ,
constraint PK_ROLE_ENTITY_ID primary key (sid)
);

INSERT INTO ROLE_ENTITY (sid, role_name, role_key, STATUS, VERSION, CREATED_BY, CREATE_TIME, UPDATED_BY, UPDATE_TIME) VALUES ('123', '开发角色2', '1', 1, 1, 'development', '2021-09-01 00:00:00', 'development', '2021-09-01 00:00:00');

CREATE TABLE USER_MANY_ROLE(
SID VARCHAR(32) COMMENT '主键ID' ,
USER_ID VARCHAR(32) COMMENT '用户 ID' ,
ROLE_ID VARCHAR(32) COMMENT '角色 ID' ,
STATUS INTEGER default '1' COMMENT '状态' ,
VERSION INTEGER COMMENT '数据版本' ,
CREATED_BY VARCHAR(50) COMMENT '创建人' ,
CREATE_TIME TIMESTAMP COMMENT '创建时间' ,
UPDATED_BY VARCHAR(50) COMMENT '修改人' ,
UPDATE_TIME TIMESTAMP COMMENT '修改时间' ,
constraint PK_USER_MANY_ROLE_ID primary key (user_id, role_id)
);

INSERT INTO USER_MANY_ROLE (sid, user_id, role_id, STATUS, VERSION, CREATED_BY, CREATE_TIME, UPDATED_BY, UPDATE_TIME) VALUES ('1233123', '1', '123', 1, 1, '小明', '2021-09-01 00:00:00', '小明', '2021-09-01 00:00:00'),('1412414', '255', '123', 1, 1, '小明', '2021-09-01 00:00:00', '小明', '2021-09-01 00:00:00');

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@include: ../../init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@include: ../../init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
_chgType,ENTITY_META_ID,MODULE_ID,ENTITY_NAME,DISPLAY_NAME,TABLE_NAME,QUERY_SPACE,STORE_TYPE,TAGS_TEXT,IS_EXTERNAL,STATUS,EXT_CONFIG,VERSION,CREATED_BY,CREATE_TIME,UPDATED_BY,UPDATE_TIME,REMARK
A,@var:NopDynEntityMeta@entityMetaId_1,@var:NopDynModule@moduleId,RoleEntity,Role Entity,,,10,,false,1,,0,autotest-ref,*,autotest-ref,*,
A,@var:NopDynEntityMeta@entityMetaId,@var:NopDynModule@moduleId,UserEntity,User Entity,,,10,,false,1,,0,autotest-ref,*,autotest-ref,*,
A,@var:NopDynEntityMeta@entityMetaId_2,@var:NopDynModule@moduleId,UserManyRole,User Many Role,,,10,,false,1,,0,autotest-ref,*,autotest-ref,*,
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
_chgType,REL_META_ID,ENTITY_META_ID,REF_ENTITY_META_ID,RELATION_NAME,RELATION_DISPLAY_NAME,RELATION_TYPE,MIDDLE_TABLE_NAME,MIDDLE_ENTITY_NAME,LEFT_PROP_NAME,RIGHT_PROP_NAME,REF_SET_KEY_PROP,REF_SET_SORT,STATUS,TAGS_TEXT,EXT_CONFIG,VERSION,CREATED_BY,CREATE_TIME,UPDATED_BY,UPDATE_TIME,REMARK
A,@var:NopDynEntityRelationMeta@relMetaId,@var:NopDynEntityMeta@entityMetaId,@var:NopDynEntityMeta@entityMetaId_1,userRole,测试m2o关联,m2o,,,roleId,sid,,,1,pub,,0,autotest-ref,*,autotest-ref,*,
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
_chgType,MODULE_ID,MODULE_NAME,MODULE_VERSION,DISPLAY_NAME,BASE_MODULE_ID,BASE_PACKAGE_NAME,ENTITY_PACKAGE_NAME,MAVEN_GROUP_ID,STATUS,VERSION,CREATED_BY,CREATE_TIME,UPDATED_BY,UPDATE_TIME
A,@var:NopDynModule@moduleId,relation-demo,1,Demo Module,,,,,10,0,autotest-ref,*,autotest-ref,*
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
_chgType,PROP_META_ID,ENTITY_META_ID,IS_MANDATORY,PROP_NAME,DISPLAY_NAME,STD_SQL_TYPE,PRECISION,SCALE,PROP_ID,UI_SHOW,UI_CONTROL,DOMAIN_ID,STD_DOMAIN_NAME,DICT_NAME,DYN_PROP_MAPPING,TAGS_TEXT,DEFAULT_VALUE,EXT_CONFIG,STATUS,VERSION,CREATED_BY,CREATE_TIME,UPDATED_BY,UPDATE_TIME,REMARK
A,@var:NopDynPropMeta@propMetaId_5,@var:NopDynEntityMeta@entityMetaId_2,true,userId,userId Display,VARCHAR,32,0,1,,,,,,,,,,1,0,autotest-ref,*,autotest-ref,*,
A,@var:NopDynPropMeta@propMetaId_4,@var:NopDynEntityMeta@entityMetaId_1,true,roleKey,roleKey Display,VARCHAR,100,0,1,,,,,,,,,,1,0,autotest-ref,*,autotest-ref,*,
A,@var:NopDynPropMeta@propMetaId_1,@var:NopDynEntityMeta@entityMetaId,true,userAge,userAge Display,INTEGER,0,0,1,,,,,,,,,,1,0,autotest-ref,*,autotest-ref,*,
A,@var:NopDynPropMeta@propMetaId_6,@var:NopDynEntityMeta@entityMetaId_2,true,roleId,roleId Display,VARCHAR,32,0,1,,,,,,,,,,1,0,autotest-ref,*,autotest-ref,*,
A,@var:NopDynPropMeta@propMetaId_2,@var:NopDynEntityMeta@entityMetaId,true,roleId,roleId Display,VARCHAR,100,0,1,,,,,,,,,,1,0,autotest-ref,*,autotest-ref,*,
A,@var:NopDynPropMeta@propMetaId_3,@var:NopDynEntityMeta@entityMetaId_1,true,roleName,roleName Display,VARCHAR,100,0,1,,,,,,,,,,1,0,autotest-ref,*,autotest-ref,*,
A,@var:NopDynPropMeta@propMetaId,@var:NopDynEntityMeta@entityMetaId,true,userName,userName Display,VARCHAR,100,0,1,,,,,,,,,,1,0,autotest-ref,*,autotest-ref,*,
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
_chgType,SEQ_NAME,SEQ_TYPE,IS_UUID,NEXT_VALUE,STEP_SIZE,CACHE_SIZE,MAX_VALUE,RESET_TYPE,DEL_FLAG,VERSION,CREATED_BY,CREATE_TIME,UPDATED_BY,UPDATE_TIME,REMARK
A,default,seq,0,1,1,100,,,0,0,autotest-ref,*,autotest-ref,*,
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@include: ../../init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
_chgType,ENTITY_META_ID,MODULE_ID,ENTITY_NAME,DISPLAY_NAME,TABLE_NAME,QUERY_SPACE,STORE_TYPE,TAGS_TEXT,IS_EXTERNAL,STATUS,EXT_CONFIG,VERSION,CREATED_BY,CREATE_TIME,UPDATED_BY,UPDATE_TIME,REMARK
A,@var:NopDynEntityMeta@entityMetaId_2,@var:NopDynModule@moduleId,UserManyRole,User Many Role,,,10,,false,1,,0,autotest-ref,*,autotest-ref,*,
A,@var:NopDynEntityMeta@entityMetaId,@var:NopDynModule@moduleId,UserEntity,User Entity,,,10,,false,1,,0,autotest-ref,*,autotest-ref,*,
A,@var:NopDynEntityMeta@entityMetaId_1,@var:NopDynModule@moduleId,RoleEntity,Role Entity,,,10,,false,1,,0,autotest-ref,*,autotest-ref,*,
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
_chgType,REL_META_ID,ENTITY_META_ID,REF_ENTITY_META_ID,RELATION_NAME,RELATION_DISPLAY_NAME,RELATION_TYPE,MIDDLE_TABLE_NAME,MIDDLE_ENTITY_NAME,LEFT_PROP_NAME,RIGHT_PROP_NAME,REF_SET_KEY_PROP,REF_SET_SORT,STATUS,TAGS_TEXT,EXT_CONFIG,VERSION,CREATED_BY,CREATE_TIME,UPDATED_BY,UPDATE_TIME,REMARK
A,@var:NopDynEntityRelationMeta@relMetaId,@var:NopDynEntityMeta@entityMetaId_1,@var:NopDynEntityMeta@entityMetaId,roleUsers,测试一对多关联,o2m,,,sid,roleId,,,1,pub,,0,autotest-ref,*,autotest-ref,*,
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
_chgType,MODULE_ID,MODULE_NAME,MODULE_VERSION,DISPLAY_NAME,BASE_MODULE_ID,BASE_PACKAGE_NAME,ENTITY_PACKAGE_NAME,MAVEN_GROUP_ID,STATUS,VERSION,CREATED_BY,CREATE_TIME,UPDATED_BY,UPDATE_TIME
A,@var:NopDynModule@moduleId,relation-demo,1,Demo Module,,,,,10,0,autotest-ref,*,autotest-ref,*
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
_chgType,PROP_META_ID,ENTITY_META_ID,IS_MANDATORY,PROP_NAME,DISPLAY_NAME,STD_SQL_TYPE,PRECISION,SCALE,PROP_ID,UI_SHOW,UI_CONTROL,DOMAIN_ID,STD_DOMAIN_NAME,DICT_NAME,DYN_PROP_MAPPING,TAGS_TEXT,DEFAULT_VALUE,EXT_CONFIG,STATUS,VERSION,CREATED_BY,CREATE_TIME,UPDATED_BY,UPDATE_TIME,REMARK
A,@var:NopDynPropMeta@propMetaId_4,@var:NopDynEntityMeta@entityMetaId_1,true,roleKey,roleKey Display,VARCHAR,100,0,1,,,,,,,,,,1,0,autotest-ref,*,autotest-ref,*,
A,@var:NopDynPropMeta@propMetaId_3,@var:NopDynEntityMeta@entityMetaId_1,true,roleName,roleName Display,VARCHAR,100,0,1,,,,,,,,,,1,0,autotest-ref,*,autotest-ref,*,
A,@var:NopDynPropMeta@propMetaId_6,@var:NopDynEntityMeta@entityMetaId_2,true,roleId,roleId Display,VARCHAR,32,0,1,,,,,,,,,,1,0,autotest-ref,*,autotest-ref,*,
A,@var:NopDynPropMeta@propMetaId_5,@var:NopDynEntityMeta@entityMetaId_2,true,userId,userId Display,VARCHAR,32,0,1,,,,,,,,,,1,0,autotest-ref,*,autotest-ref,*,
A,@var:NopDynPropMeta@propMetaId,@var:NopDynEntityMeta@entityMetaId,true,userName,userName Display,VARCHAR,100,0,1,,,,,,,,,,1,0,autotest-ref,*,autotest-ref,*,
A,@var:NopDynPropMeta@propMetaId_2,@var:NopDynEntityMeta@entityMetaId,true,roleId,roleId Display,VARCHAR,100,0,1,,,,,,,,,,1,0,autotest-ref,*,autotest-ref,*,
A,@var:NopDynPropMeta@propMetaId_1,@var:NopDynEntityMeta@entityMetaId,true,userAge,userAge Display,INTEGER,0,0,1,,,,,,,,,,1,0,autotest-ref,*,autotest-ref,*,
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
_chgType,SEQ_NAME,SEQ_TYPE,IS_UUID,NEXT_VALUE,STEP_SIZE,CACHE_SIZE,MAX_VALUE,RESET_TYPE,DEL_FLAG,VERSION,CREATED_BY,CREATE_TIME,UPDATED_BY,UPDATE_TIME,REMARK
A,default,seq,0,1,1,100,,,0,0,autotest-ref,*,autotest-ref,*,
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@include: ../../init.sql
Empty file.

0 comments on commit d007d15

Please sign in to comment.