diff --git a/linkis-public-enhancements/linkis-cs-server/src/test/resources/application.properties b/linkis-public-enhancements/linkis-cs-server/src/test/resources/application.properties index 037eca4fb9..b9ed613e62 100644 --- a/linkis-public-enhancements/linkis-cs-server/src/test/resources/application.properties +++ b/linkis-public-enhancements/linkis-cs-server/src/test/resources/application.properties @@ -30,16 +30,20 @@ wds.linkis.gateway.conf.publicservice.list=query,jobhistory,application,configur #logging.file=./test.log #debug=true -#h2 database config spring.datasource.driver-class-name=org.h2.Driver -#init -spring.datasource.url=jdbc:h2:mem:test;MODE=MySQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=true +spring.datasource.url=jdbc:h2:mem:test;MODE=MySQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=true;INIT=runscript from 'classpath:create.sql' spring.datasource.username=sa spring.datasource.password= -spring.sql.init.schema-locations=classpath:create.sql -springfox.documentation.enabled=false -springfox.documentation.auto-startup=false -springfox.documentation.swagger-ui.enabled=false +spring.datasource.hikari.connection-test-query=select 1 +spring.datasource.hikari.minimum-idle=5 +spring.datasource.hikari.auto-commit=true +spring.datasource.hikari.validation-timeout=3000 +spring.datasource.hikari.pool-name=linkis-test +spring.datasource.hikari.maximum-pool-size=50 +spring.datasource.hikari.connection-timeout=30000 +spring.datasource.hikari.idle-timeout=600000 +spring.datasource.hikari.leak-detection-threshold=0 +spring.datasource.hikari.initialization-fail-timeout=1 spring.main.web-application-type=servlet server.port=1234 diff --git a/linkis-public-enhancements/linkis-cs-server/src/test/resources/create.sql b/linkis-public-enhancements/linkis-cs-server/src/test/resources/create.sql index 33956b3fb5..f6bf76e496 100644 --- a/linkis-public-enhancements/linkis-cs-server/src/test/resources/create.sql +++ b/linkis-public-enhancements/linkis-cs-server/src/test/resources/create.sql @@ -47,7 +47,7 @@ CREATE TABLE linkis_ps_cs_context_listener ( DROP TABLE IF EXISTS linkis_ps_cs_context_id CASCADE; CREATE TABLE linkis_ps_cs_context_id ( id int(11) AUTO_INCREMENT, - user varchar(32) DEFAULT NULL, + `user` varchar(32) DEFAULT NULL, application varchar(32) DEFAULT NULL, source varchar(255) DEFAULT NULL, expire_type varchar(32) DEFAULT NULL, @@ -69,4 +69,20 @@ CREATE TABLE linkis_ps_cs_context_map_listener ( create_time datetime DEFAULT CURRENT_TIMESTAMP, access_time datetime DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id) +) ; + +DROP TABLE IF EXISTS linkis_ps_cs_context_map CASCADE; +CREATE TABLE linkis_ps_cs_context_map ( + id int(11) AUTO_INCREMENT, + `key` varchar(128) DEFAULT NULL, + context_scope varchar(32) DEFAULT NULL, + context_type varchar(32) DEFAULT NULL, + props varchar(255), + `value` varchar(255), + context_id int(11) DEFAULT NULL, + keywords varchar(255) DEFAULT NULL, + update_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + create_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + access_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (id) ) ; \ No newline at end of file