This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 4b10757667b Add YamlShardingSphereDataSourceFactoryTest (#37233)
4b10757667b is described below
commit 4b10757667b99e7184926b909176476d43b62571
Author: Liang Zhang <[email protected]>
AuthorDate: Sun Nov 30 22:25:58 2025 +0800
Add YamlShardingSphereDataSourceFactoryTest (#37233)
* Add YamlShardingSphereDataSourceFactoryTest
* Add YamlShardingSphereDataSourceFactoryTest
---
.../api/yaml/YamlShardingSphereDataSourceFactoryTest.java | 10 +++++-----
src/resources/idea/inspections.xml | 6 ++++++
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git
a/jdbc/src/test/java/org/apache/shardingsphere/driver/api/yaml/YamlShardingSphereDataSourceFactoryTest.java
b/jdbc/src/test/java/org/apache/shardingsphere/driver/api/yaml/YamlShardingSphereDataSourceFactoryTest.java
index 3d5e194cb30..00aa601672e 100644
---
a/jdbc/src/test/java/org/apache/shardingsphere/driver/api/yaml/YamlShardingSphereDataSourceFactoryTest.java
+++
b/jdbc/src/test/java/org/apache/shardingsphere/driver/api/yaml/YamlShardingSphereDataSourceFactoryTest.java
@@ -38,7 +38,7 @@ class YamlShardingSphereDataSourceFactoryTest {
private static final String YAML_FILE =
"config/factory/database-for-factory-test.yaml";
@Test
- void assertCreateDataSourceWithFile() throws Exception {
+ void assertCreateDataSourceWithFile() throws SQLException, IOException {
assertDataSource(YamlShardingSphereDataSourceFactory.createDataSource(SystemResourceFileUtils.getPath(YAML_FILE).toFile()));
}
@@ -48,7 +48,7 @@ class YamlShardingSphereDataSourceFactoryTest {
}
@Test
- void assertCreateDataSourceWithFileForExternalDataSources() throws
Exception {
+ void assertCreateDataSourceWithFileForExternalDataSources() throws
SQLException, IOException {
Map<String, DataSource> dataSourceMap = new HashMap<>(2, 1F);
dataSourceMap.put("ds_0", new MockedDataSource());
dataSourceMap.put("ds_1", new MockedDataSource());
@@ -56,12 +56,12 @@ class YamlShardingSphereDataSourceFactoryTest {
}
@Test
- void assertCreateDataSourceWithFileForExternalSingleDataSource() throws
Exception {
+ void assertCreateDataSourceWithFileForExternalSingleDataSource() throws
SQLException, IOException {
assertDataSource(YamlShardingSphereDataSourceFactory.createDataSource(new
MockedDataSource(), SystemResourceFileUtils.getPath(YAML_FILE).toFile()));
}
@Test
- void assertCreateDataSourceWithBytesForExternalDataSources() throws
Exception {
+ void assertCreateDataSourceWithBytesForExternalDataSources() throws
SQLException, IOException {
Map<String, DataSource> dataSourceMap = new HashMap<>(2, 1F);
dataSourceMap.put("ds_0", new MockedDataSource());
dataSourceMap.put("ds_1", new MockedDataSource());
@@ -69,7 +69,7 @@ class YamlShardingSphereDataSourceFactoryTest {
}
@Test
- void assertCreateDataSourceWithBytesForExternalSingleDataSource() throws
Exception {
+ void assertCreateDataSourceWithBytesForExternalSingleDataSource() throws
SQLException, IOException {
assertDataSource(YamlShardingSphereDataSourceFactory.createDataSource(new
MockedDataSource(), SystemResourceFileUtils.readFile(YAML_FILE).getBytes()));
}
diff --git a/src/resources/idea/inspections.xml
b/src/resources/idea/inspections.xml
index b9ef8f2ea0a..43970315cbc 100644
--- a/src/resources/idea/inspections.xml
+++ b/src/resources/idea/inspections.xml
@@ -28,6 +28,7 @@
</list>
</option>
<inspection_tool class="AbstractBeanReferencesInspection" enabled="false"
level="ERROR" enabled_by_default="false" />
+ <inspection_tool class="AbstractClassExtendsConcreteClass" enabled="true"
level="WARNING" enabled_by_default="true" />
<inspection_tool class="AbstractClassNeverImplemented" enabled="true"
level="WARNING" enabled_by_default="true" />
<inspection_tool class="AbstractMethodOverridesAbstractMethod"
enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AddOperatorModifier" enabled="false"
level="INFORMATION" enabled_by_default="false" />
@@ -487,6 +488,7 @@
<inspection_tool class="SelfReferenceConstructorParameter" enabled="false"
level="WARNING" enabled_by_default="false" />
<inspection_tool class="SequencedCollectionMethodCanBeUsed" enabled="false"
level="WARNING" enabled_by_default="false" />
<inspection_tool class="SerialAnnotationUsedOnWrongMember" enabled="false"
level="WARNING" enabled_by_default="false" />
+ <inspection_tool class="SerializableHasSerialVersionUIDField" enabled="true"
level="WARNING" enabled_by_default="true" />
<inspection_tool class="ServletWithoutMappingInspection" enabled="false"
level="ERROR" enabled_by_default="false" />
<inspection_tool class="SetReplaceableByEnumSet" enabled="true"
level="WARNING" enabled_by_default="true" />
<inspection_tool class="SetterBackingFieldAssignment" enabled="false"
level="WARNING" enabled_by_default="false" />
@@ -617,6 +619,10 @@
<inspection_tool class="UpperCaseFieldNameNotConstant" enabled="true"
level="WARNING" enabled_by_default="true" />
<inspection_tool class="UseExpressionBody" enabled="false"
level="INFORMATION" enabled_by_default="false" />
<inspection_tool class="UseOfAWTPeerClass" enabled="true" level="WARNING"
enabled_by_default="true" />
+ <inspection_tool class="UseOfAnotherObjectsPrivateField" enabled="true"
level="WARNING" enabled_by_default="true">
+ <option name="ignoreSameClass" value="false" />
+ <option name="ignoreEquals" value="false" />
+ </inspection_tool>
<inspection_tool class="UseOfJDBCDriverClass" enabled="true" level="WARNING"
enabled_by_default="true" />
<inspection_tool class="UseOfObsoleteAssert" enabled="true" level="WARNING"
enabled_by_default="true" />
<inspection_tool class="UseOfProcessBuilder" enabled="true" level="WARNING"
enabled_by_default="true" />