Browse Source
* Use H2 in UT * change scope * Change profile name to h2 * Add datasource-h2.properties, datasource-postgresql.properties * Fix UT * Resolve conflict * Remove startDatabase3.0.0/version-upgrade
Wenjun Ruan
3 years ago
committed by
GitHub
65 changed files with 886 additions and 884 deletions
@ -0,0 +1,22 @@
|
||||
# |
||||
# Licensed to the Apache Software Foundation (ASF) under one or more |
||||
# contributor license agreements. See the NOTICE file distributed with |
||||
# this work for additional information regarding copyright ownership. |
||||
# The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
# (the "License"); you may not use this file except in compliance with |
||||
# the License. You may obtain a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, |
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
# See the License for the specific language governing permissions and |
||||
# limitations under the License. |
||||
# |
||||
|
||||
# datasource configuration |
||||
spring.datasource.driver-class-name=org.h2.Driver |
||||
spring.datasource.url=jdbc:h2:mem:dolphinscheduler;MODE=MySQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=true |
||||
spring.datasource.username=sa |
||||
spring.datasource.password= |
@ -0,0 +1,63 @@
|
||||
# |
||||
# Licensed to the Apache Software Foundation (ASF) under one or more |
||||
# contributor license agreements. See the NOTICE file distributed with |
||||
# this work for additional information regarding copyright ownership. |
||||
# The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
# (the "License"); you may not use this file except in compliance with |
||||
# the License. You may obtain a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, |
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
# See the License for the specific language governing permissions and |
||||
# limitations under the License. |
||||
# |
||||
|
||||
# datasource configuration |
||||
spring.datasource.driver-class-name=org.postgresql.Driver |
||||
spring.datasource.url=jdbc:postgresql://127.0.0.1:5432/dolphinscheduler |
||||
spring.datasource.username=root |
||||
spring.datasource.password=root |
||||
|
||||
# connection configuration |
||||
#spring.datasource.initialSize=5 |
||||
# min connection number |
||||
#spring.datasource.minIdle=5 |
||||
# max connection number |
||||
#spring.datasource.maxActive=50 |
||||
|
||||
# max wait time for get a connection in milliseconds. if configuring maxWait, fair locks are enabled by default and concurrency efficiency decreases. |
||||
# If necessary, unfair locks can be used by configuring the useUnfairLock attribute to true. |
||||
#spring.datasource.maxWait=60000 |
||||
|
||||
# milliseconds for check to close free connections |
||||
#spring.datasource.timeBetweenEvictionRunsMillis=60000 |
||||
|
||||
# the Destroy thread detects the connection interval and closes the physical connection in milliseconds if the connection idle time is greater than or equal to minEvictableIdleTimeMillis. |
||||
#spring.datasource.timeBetweenConnectErrorMillis=60000 |
||||
|
||||
# the longest time a connection remains idle without being evicted, in milliseconds |
||||
#spring.datasource.minEvictableIdleTimeMillis=300000 |
||||
|
||||
#the SQL used to check whether the connection is valid requires a query statement. If validation Query is null, testOnBorrow, testOnReturn, and testWhileIdle will not work. |
||||
#spring.datasource.validationQuery=SELECT 1 |
||||
|
||||
#check whether the connection is valid for timeout, in seconds |
||||
#spring.datasource.validationQueryTimeout=3 |
||||
|
||||
# when applying for a connection, if it is detected that the connection is idle longer than time Between Eviction Runs Millis, |
||||
# validation Query is performed to check whether the connection is valid |
||||
#spring.datasource.testWhileIdle=true |
||||
|
||||
#execute validation to check if the connection is valid when applying for a connection |
||||
#spring.datasource.testOnBorrow=true |
||||
#execute validation to check if the connection is valid when the connection is returned |
||||
#spring.datasource.testOnReturn=false |
||||
#spring.datasource.defaultAutoCommit=true |
||||
#spring.datasource.keepAlive=true |
||||
|
||||
# open PSCache, specify count PSCache for every connection |
||||
#spring.datasource.poolPreparedStatements=true |
||||
#spring.datasource.maxPoolPreparedStatementPerConnectionSize=20 |
@ -0,0 +1,38 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.apache.dolphinscheduler.dao; |
||||
|
||||
import org.apache.dolphinscheduler.common.enums.ProfileType; |
||||
import org.apache.dolphinscheduler.dao.datasource.SpringConnectionFactory; |
||||
|
||||
import org.junit.runner.RunWith; |
||||
import org.springframework.boot.test.context.SpringBootTest; |
||||
import org.springframework.test.annotation.Rollback; |
||||
import org.springframework.test.context.ActiveProfiles; |
||||
import org.springframework.test.context.ContextConfiguration; |
||||
import org.springframework.test.context.junit4.SpringRunner; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
|
||||
@RunWith(SpringRunner.class) |
||||
@SpringBootTest |
||||
@ActiveProfiles(value = ProfileType.H2) |
||||
@ContextConfiguration(classes = SpringConnectionFactory.class) |
||||
@Transactional |
||||
@Rollback |
||||
public abstract class BaseDaoTest { |
||||
} |
Loading…
Reference in new issue