This is an automated email from the ASF dual-hosted git repository.
panjuan 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 321eaa4523d Rename ShardingSphereException to
ShardingSphereServerException (#20732)
321eaa4523d is described below
commit 321eaa4523dfa40fe3ac3953581d5db131f6108a
Author: Liang Zhang <[email protected]>
AuthorDate: Fri Sep 2 14:56:54 2022 +0800
Rename ShardingSphereException to ShardingSphereServerException (#20732)
---
....java => UnsupportedShardingAlgorithmTypeServerException.java} | 6 +++---
.../parser/strategy/ShardingStrategyBeanDefinitionParser.java | 4 ++--
...ingSphereException.java => ShardingSphereServerException.java} | 8 ++++----
.../apache/shardingsphere/infra/util/props/TypedProperties.java | 4 ++--
...opertiesException.java => TypedPropertiesServerException.java} | 6 +++---
...Exception.java => ServiceProviderNotFoundServerException.java} | 8 ++++----
.../infra/util/spi/type/required/RequiredSPIRegistry.java | 4 ++--
.../infra/util/spi/type/typed/TypedSPIRegistry.java | 6 +++---
...eExceptionTest.java => ShardingSphereServerExceptionTest.java} | 8 ++++----
...tionFixture.java => ShardingSphereServerExceptionFixture.java} | 8 ++++----
.../shardingsphere/infra/util/props/TypedPropertiesTest.java | 4 ++--
.../infra/util/props/exception/TypedPropertiesExceptionTest.java | 2 +-
.../util/spi/exception/ServiceProviderNotFoundExceptionTest.java | 4 ++--
.../infra/util/spi/type/required/RequiredSPIRegistryTest.java | 4 ++--
.../infra/util/spi/type/typed/TypedSPIRegistryTest.java | 6 +++---
.../spring/boot/datasource/DataSourceMapSetter.java | 8 ++++----
...dException.java => DataSourceJndiNotFoundServerException.java} | 6 +++---
...ception.java => UnsupportedDataSourceTypeServerException.java} | 6 +++---
.../handler/distsql/rdl/resource/AddResourceBackendHandler.java | 4 ++--
.../handler/distsql/rdl/resource/AlterResourceBackendHandler.java | 4 ++--
.../handler/distsql/rdl/resource/DropResourceBackendHandler.java | 4 ++--
.../apache/shardingsphere/proxy/database/DatabaseServerInfo.java | 4 ++--
...ngException.java => DatabaseServerLoadingServerException.java} | 6 +++---
.../shardingsphere/proxy/database/DatabaseServerInfoTest.java | 4 ++--
.../proxy/frontend/exception/ExpectedExceptions.java | 4 ++--
.../proxy/frontend/exception/ExpectedExceptionsTest.java | 4 ++--
.../ReactiveDatabaseProtocolFrontendEngineFactoryTest.java | 4 ++--
27 files changed, 70 insertions(+), 70 deletions(-)
diff --git
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-spring/shardingsphere-sharding-spring-namespace/src/main/java/org/apache/shardingsphere/sharding/spring/namespace/exception/UnsupportedShardingAlgorithmTypeException.java
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-spring/shardingsphere-sharding-spring-namespace/src/main/java/org/apache/shardingsphere/sharding/spring/namespace/exception/UnsupportedShardingAlgorithmTypeServerE
[...]
similarity index 86%
rename from
shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-spring/shardingsphere-sharding-spring-namespace/src/main/java/org/apache/shardingsphere/sharding/spring/namespace/exception/UnsupportedShardingAlgorithmTypeException.java
rename to
shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-spring/shardingsphere-sharding-spring-namespace/src/main/java/org/apache/shardingsphere/sharding/spring/namespace/exception/UnsupportedShardingAlgorithmTypeServerException.java
index 0629c95f028..4e0b40194fb 100644
---
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-spring/shardingsphere-sharding-spring-namespace/src/main/java/org/apache/shardingsphere/sharding/spring/namespace/exception/UnsupportedShardingAlgorithmTypeException.java
+++
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-spring/shardingsphere-sharding-spring-namespace/src/main/java/org/apache/shardingsphere/sharding/spring/namespace/exception/UnsupportedShardingAlgorithmTypeServerException.java
@@ -17,12 +17,12 @@
package org.apache.shardingsphere.sharding.spring.namespace.exception;
-import org.apache.shardingsphere.infra.util.exception.ShardingSphereException;
+import
org.apache.shardingsphere.infra.util.exception.ShardingSphereServerException;
/**
* Unsupported sharding algorithm type exception.
*/
-public final class UnsupportedShardingAlgorithmTypeException extends
ShardingSphereException {
+public final class UnsupportedShardingAlgorithmTypeServerException extends
ShardingSphereServerException {
private static final long serialVersionUID = -9113172467431755471L;
@@ -30,7 +30,7 @@ public final class UnsupportedShardingAlgorithmTypeException
extends ShardingSph
private static final int ERROR_CODE = 1;
- public UnsupportedShardingAlgorithmTypeException(final String type) {
+ public UnsupportedShardingAlgorithmTypeServerException(final String type) {
super(ERROR_CATEGORY, ERROR_CODE, String.format("Can not support type
`%s`", type));
}
}
diff --git
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-spring/shardingsphere-sharding-spring-namespace/src/main/java/org/apache/shardingsphere/sharding/spring/namespace/parser/strategy/ShardingStrategyBeanDefinitionParser.java
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-spring/shardingsphere-sharding-spring-namespace/src/main/java/org/apache/shardingsphere/sharding/spring/namespace/parser/strategy/ShardingStrategyBeanDefinitionPa
[...]
index cd49ba1d242..b717d45338d 100644
---
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-spring/shardingsphere-sharding-spring-namespace/src/main/java/org/apache/shardingsphere/sharding/spring/namespace/parser/strategy/ShardingStrategyBeanDefinitionParser.java
+++
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-spring/shardingsphere-sharding-spring-namespace/src/main/java/org/apache/shardingsphere/sharding/spring/namespace/parser/strategy/ShardingStrategyBeanDefinitionParser.java
@@ -22,7 +22,7 @@ import
org.apache.shardingsphere.sharding.api.config.strategy.sharding.ComplexSh
import
org.apache.shardingsphere.sharding.api.config.strategy.sharding.HintShardingStrategyConfiguration;
import
org.apache.shardingsphere.sharding.api.config.strategy.sharding.NoneShardingStrategyConfiguration;
import
org.apache.shardingsphere.sharding.api.config.strategy.sharding.StandardShardingStrategyConfiguration;
-import
org.apache.shardingsphere.sharding.spring.namespace.exception.UnsupportedShardingAlgorithmTypeException;
+import
org.apache.shardingsphere.sharding.spring.namespace.exception.UnsupportedShardingAlgorithmTypeServerException;
import
org.apache.shardingsphere.sharding.spring.namespace.tag.strategy.ShardingStrategyBeanDefinitionTag;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
@@ -48,7 +48,7 @@ public final class ShardingStrategyBeanDefinitionParser
extends AbstractBeanDefi
case ShardingStrategyBeanDefinitionTag.NONE_STRATEGY_ROOT_TAG:
return getNoneShardingStrategyConfigBeanDefinition();
default:
- throw new UnsupportedShardingAlgorithmTypeException(type);
+ throw new
UnsupportedShardingAlgorithmTypeServerException(type);
}
}
diff --git
a/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/exception/ShardingSphereException.java
b/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/exception/ShardingSphereServerException.java
similarity index 75%
rename from
shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/exception/ShardingSphereException.java
rename to
shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/exception/ShardingSphereServerException.java
index 25667a66611..514d1028c52 100644
---
a/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/exception/ShardingSphereException.java
+++
b/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/exception/ShardingSphereServerException.java
@@ -18,17 +18,17 @@
package org.apache.shardingsphere.infra.util.exception;
/**
- * ShardingSphere exception.
+ * ShardingSphere server exception.
*/
-public abstract class ShardingSphereException extends RuntimeException {
+public abstract class ShardingSphereServerException extends RuntimeException {
private static final long serialVersionUID = 1547233217081261239L;
- public ShardingSphereException(final String errorCategory, final int
errorCode, final String message) {
+ public ShardingSphereServerException(final String errorCategory, final int
errorCode, final String message) {
super(String.format("%s-%05d: %s", errorCategory, errorCode, message));
}
- public ShardingSphereException(final String errorCategory, final int
errorCode, final String message, final Exception cause) {
+ public ShardingSphereServerException(final String errorCategory, final int
errorCode, final String message, final Exception cause) {
super(String.format("%s-%05d: %s", errorCategory, errorCode, message),
cause);
}
}
diff --git
a/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/props/TypedProperties.java
b/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/props/TypedProperties.java
index 7c4ceaed9c7..b11f9317f23 100644
---
a/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/props/TypedProperties.java
+++
b/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/props/TypedProperties.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.util.props;
import lombok.Getter;
-import
org.apache.shardingsphere.infra.util.props.exception.TypedPropertiesException;
+import
org.apache.shardingsphere.infra.util.props.exception.TypedPropertiesServerException;
import
org.apache.shardingsphere.infra.util.props.exception.TypedPropertyValueException;
import java.util.Collection;
@@ -56,7 +56,7 @@ public abstract class TypedProperties<E extends Enum<?> &
TypedPropertyKey> {
result.put(each, value);
}
if (!errorMessages.isEmpty()) {
- throw new TypedPropertiesException(errorMessages);
+ throw new TypedPropertiesServerException(errorMessages);
}
return result;
}
diff --git
a/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertiesException.java
b/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertiesServerException.java
similarity index 86%
rename from
shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertiesException.java
rename to
shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertiesServerException.java
index 93182b1a019..8fcbe60081a 100644
---
a/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertiesException.java
+++
b/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertiesServerException.java
@@ -17,14 +17,14 @@
package org.apache.shardingsphere.infra.util.props.exception;
-import org.apache.shardingsphere.infra.util.exception.ShardingSphereException;
+import
org.apache.shardingsphere.infra.util.exception.ShardingSphereServerException;
import java.util.Collection;
/**
* Typed properties exception.
*/
-public final class TypedPropertiesException extends ShardingSphereException {
+public final class TypedPropertiesServerException extends
ShardingSphereServerException {
private static final long serialVersionUID = -8301410307117564844L;
@@ -32,7 +32,7 @@ public final class TypedPropertiesException extends
ShardingSphereException {
private static final int ERROR_CODE = 1;
- public TypedPropertiesException(final Collection<String> errorMessages) {
+ public TypedPropertiesServerException(final Collection<String>
errorMessages) {
super(ERROR_CATEGORY, ERROR_CODE, String.join(System.lineSeparator(),
errorMessages));
}
}
diff --git
a/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/spi/exception/ServiceProviderNotFoundException.java
b/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/spi/exception/ServiceProviderNotFoundServerException.java
similarity index 83%
rename from
shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/spi/exception/ServiceProviderNotFoundException.java
rename to
shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/spi/exception/ServiceProviderNotFoundServerException.java
index 9ab89ed30a8..3cd87485017 100644
---
a/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/spi/exception/ServiceProviderNotFoundException.java
+++
b/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/spi/exception/ServiceProviderNotFoundServerException.java
@@ -17,12 +17,12 @@
package org.apache.shardingsphere.infra.util.spi.exception;
-import org.apache.shardingsphere.infra.util.exception.ShardingSphereException;
+import
org.apache.shardingsphere.infra.util.exception.ShardingSphereServerException;
/**
* Service provider not found exception.
*/
-public final class ServiceProviderNotFoundException extends
ShardingSphereException {
+public final class ServiceProviderNotFoundServerException extends
ShardingSphereServerException {
private static final long serialVersionUID = -3730257541332863236L;
@@ -30,11 +30,11 @@ public final class ServiceProviderNotFoundException extends
ShardingSphereExcept
private static final int ERROR_CODE = 1;
- public ServiceProviderNotFoundException(final Class<?> clazz) {
+ public ServiceProviderNotFoundServerException(final Class<?> clazz) {
super(ERROR_CATEGORY, ERROR_CODE, String.format("No implementation
class load from SPI `%s`.", clazz.getName()));
}
- public ServiceProviderNotFoundException(final Class<?> clazz, final String
type) {
+ public ServiceProviderNotFoundServerException(final Class<?> clazz, final
String type) {
super(ERROR_CATEGORY, ERROR_CODE, String.format("No implementation
class load from SPI `%s` with type `%s`.", clazz.getName(), type));
}
}
diff --git
a/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/spi/type/required/RequiredSPIRegistry.java
b/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/spi/type/required/RequiredSPIRegistry.java
index dc6eca34bea..74d2d1329cd 100644
---
a/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/spi/type/required/RequiredSPIRegistry.java
+++
b/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/spi/type/required/RequiredSPIRegistry.java
@@ -20,7 +20,7 @@ package
org.apache.shardingsphere.infra.util.spi.type.required;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.shardingsphere.infra.util.spi.ShardingSphereServiceLoader;
-import
org.apache.shardingsphere.infra.util.spi.exception.ServiceProviderNotFoundException;
+import
org.apache.shardingsphere.infra.util.spi.exception.ServiceProviderNotFoundServerException;
import org.apache.shardingsphere.infra.util.spi.lifecycle.SPIPostProcessor;
import java.util.Collection;
@@ -50,7 +50,7 @@ public final class RequiredSPIRegistry {
private static <T extends RequiredSPI> T getRequiredService(final Class<T>
spiClass) {
Collection<T> services =
ShardingSphereServiceLoader.getServiceInstances(spiClass);
if (services.isEmpty()) {
- throw new ServiceProviderNotFoundException(spiClass);
+ throw new ServiceProviderNotFoundServerException(spiClass);
}
if (1 == services.size()) {
return services.iterator().next();
diff --git
a/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/spi/type/typed/TypedSPIRegistry.java
b/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/spi/type/typed/TypedSPIRegistry.java
index 8b760430953..e1df828a2d3 100644
---
a/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/spi/type/typed/TypedSPIRegistry.java
+++
b/shardingsphere-infra/shardingsphere-infra-util/src/main/java/org/apache/shardingsphere/infra/util/spi/type/typed/TypedSPIRegistry.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.infra.util.spi.type.typed;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.shardingsphere.infra.util.spi.ShardingSphereServiceLoader;
-import
org.apache.shardingsphere.infra.util.spi.exception.ServiceProviderNotFoundException;
+import
org.apache.shardingsphere.infra.util.spi.exception.ServiceProviderNotFoundServerException;
import org.apache.shardingsphere.infra.util.spi.lifecycle.SPIPostProcessor;
import java.util.Optional;
@@ -97,7 +97,7 @@ public final class TypedSPIRegistry {
if (result.isPresent()) {
return result.get();
}
- throw new ServiceProviderNotFoundException(spiClass, type);
+ throw new ServiceProviderNotFoundServerException(spiClass, type);
}
/**
@@ -114,6 +114,6 @@ public final class TypedSPIRegistry {
if (result.isPresent()) {
return result.get();
}
- throw new ServiceProviderNotFoundException(spiClass, type);
+ throw new ServiceProviderNotFoundServerException(spiClass, type);
}
}
diff --git
a/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/exception/ShardingSphereExceptionTest.java
b/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/exception/ShardingSphereServerExceptionTest.java
similarity index 80%
rename from
shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/exception/ShardingSphereExceptionTest.java
rename to
shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/exception/ShardingSphereServerExceptionTest.java
index 865c72732ce..2994be60189 100644
---
a/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/exception/ShardingSphereExceptionTest.java
+++
b/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/exception/ShardingSphereServerExceptionTest.java
@@ -17,22 +17,22 @@
package org.apache.shardingsphere.infra.util.exception;
-import
org.apache.shardingsphere.infra.util.exception.fixture.ShardingSphereExceptionFixture;
+import
org.apache.shardingsphere.infra.util.exception.fixture.ShardingSphereServerExceptionFixture;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
-public final class ShardingSphereExceptionTest {
+public final class ShardingSphereServerExceptionTest {
@Test
public void assertGetMessage() {
- assertThat(new ShardingSphereExceptionFixture().getMessage(),
is("FIXTURE-00001: Fixture error message"));
+ assertThat(new ShardingSphereServerExceptionFixture().getMessage(),
is("FIXTURE-00001: Fixture error message"));
}
@Test
public void assertGetCause() {
RuntimeException cause = new RuntimeException("Test");
- assertThat(new ShardingSphereExceptionFixture(cause).getCause(),
is(cause));
+ assertThat(new ShardingSphereServerExceptionFixture(cause).getCause(),
is(cause));
}
}
diff --git
a/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/exception/fixture/ShardingSphereExceptionFixture.java
b/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/exception/fixture/ShardingSphereServerExceptionFixture.java
similarity index 82%
rename from
shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/exception/fixture/ShardingSphereExceptionFixture.java
rename to
shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/exception/fixture/ShardingSphereServerExceptionFixture.java
index 6b0903e4e4c..e74b5724840 100644
---
a/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/exception/fixture/ShardingSphereExceptionFixture.java
+++
b/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/exception/fixture/ShardingSphereServerExceptionFixture.java
@@ -17,17 +17,17 @@
package org.apache.shardingsphere.infra.util.exception.fixture;
-import org.apache.shardingsphere.infra.util.exception.ShardingSphereException;
+import
org.apache.shardingsphere.infra.util.exception.ShardingSphereServerException;
-public final class ShardingSphereExceptionFixture extends
ShardingSphereException {
+public final class ShardingSphereServerExceptionFixture extends
ShardingSphereServerException {
private static final long serialVersionUID = 4263474713534006256L;
- public ShardingSphereExceptionFixture() {
+ public ShardingSphereServerExceptionFixture() {
super("FIXTURE", 1, "Fixture error message");
}
- public ShardingSphereExceptionFixture(final Exception cause) {
+ public ShardingSphereServerExceptionFixture(final Exception cause) {
super("FIXTURE", 1, "Fixture error message", cause);
}
}
diff --git
a/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/props/TypedPropertiesTest.java
b/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/props/TypedPropertiesTest.java
index 1be50fd7b81..e9cdc4ea34c 100644
---
a/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/props/TypedPropertiesTest.java
+++
b/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/props/TypedPropertiesTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.infra.util.props;
-import
org.apache.shardingsphere.infra.util.props.exception.TypedPropertiesException;
+import
org.apache.shardingsphere.infra.util.props.exception.TypedPropertiesServerException;
import
org.apache.shardingsphere.infra.util.props.fixture.TypedPropertiesFixture;
import
org.apache.shardingsphere.infra.util.props.fixture.TypedPropertyKeyFixture;
import org.junit.Test;
@@ -67,7 +67,7 @@ public final class TypedPropertiesTest {
assertThat(actual.getValue(TypedPropertyKeyFixture.STRING_VALUE),
is("value"));
}
- @Test(expected = TypedPropertiesException.class)
+ @Test(expected = TypedPropertiesServerException.class)
public void assertGetInvalidValue() {
Properties props = new Properties();
props.setProperty(TypedPropertyKeyFixture.BOOLEAN_VALUE.getKey(),
"test");
diff --git
a/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertiesExceptionTest.java
b/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertiesExceptionTest.java
index 3342233d5d9..c8e55ae00dc 100644
---
a/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertiesExceptionTest.java
+++
b/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/props/exception/TypedPropertiesExceptionTest.java
@@ -28,6 +28,6 @@ public final class TypedPropertiesExceptionTest {
@Test
public void assertGetMessage() {
- assertThat(new TypedPropertiesException(Arrays.asList("foo_msg",
"bar_msg")).getMessage(), is("PROPS-00001: foo_msg" + System.lineSeparator() +
"bar_msg"));
+ assertThat(new TypedPropertiesServerException(Arrays.asList("foo_msg",
"bar_msg")).getMessage(), is("PROPS-00001: foo_msg" + System.lineSeparator() +
"bar_msg"));
}
}
diff --git
a/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/spi/exception/ServiceProviderNotFoundExceptionTest.java
b/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/spi/exception/ServiceProviderNotFoundExceptionTest.java
index 69d2ec89201..e0029c27b8c 100644
---
a/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/spi/exception/ServiceProviderNotFoundExceptionTest.java
+++
b/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/spi/exception/ServiceProviderNotFoundExceptionTest.java
@@ -26,11 +26,11 @@ public final class ServiceProviderNotFoundExceptionTest {
@Test
public void assertGetMessageWithClassOnly() {
- assertThat(new
ServiceProviderNotFoundException(Object.class).getMessage(), is("SPI-00001: No
implementation class load from SPI `java.lang.Object`."));
+ assertThat(new
ServiceProviderNotFoundServerException(Object.class).getMessage(),
is("SPI-00001: No implementation class load from SPI `java.lang.Object`."));
}
@Test
public void assertGetMessageWithClassAndType() {
- assertThat(new ServiceProviderNotFoundException(Object.class,
"Foo").getMessage(), is("SPI-00001: No implementation class load from SPI
`java.lang.Object` with type `Foo`."));
+ assertThat(new ServiceProviderNotFoundServerException(Object.class,
"Foo").getMessage(), is("SPI-00001: No implementation class load from SPI
`java.lang.Object` with type `Foo`."));
}
}
diff --git
a/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/RequiredSPIRegistryTest.java
b/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/RequiredSPIRegistryTest.java
index 525a6bc3520..ab7f26449c0 100644
---
a/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/RequiredSPIRegistryTest.java
+++
b/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/required/RequiredSPIRegistryTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.util.spi.type.required;
import org.apache.shardingsphere.infra.util.spi.ShardingSphereServiceLoader;
-import
org.apache.shardingsphere.infra.util.spi.exception.ServiceProviderNotFoundException;
+import
org.apache.shardingsphere.infra.util.spi.exception.ServiceProviderNotFoundServerException;
import
org.apache.shardingsphere.infra.util.spi.type.required.fixture.empty.EmptyRequiredSPIFixture;
import
org.apache.shardingsphere.infra.util.spi.type.required.fixture.multiple.DefaultMultipleRequiredSPIFixtureImpl;
import
org.apache.shardingsphere.infra.util.spi.type.required.fixture.multiple.MultipleRequiredSPIFixture;
@@ -37,7 +37,7 @@ public final class RequiredSPIRegistryTest {
ShardingSphereServiceLoader.register(MultipleRequiredSPIFixture.class);
}
- @Test(expected = ServiceProviderNotFoundException.class)
+ @Test(expected = ServiceProviderNotFoundServerException.class)
public void assertRegisteredServiceWithEmptyImplementation() {
RequiredSPIRegistry.getRegisteredService(EmptyRequiredSPIFixture.class);
}
diff --git
a/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/typed/TypedSPIRegistryTest.java
b/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/typed/TypedSPIRegistryTest.java
index 9b5bc4d03e8..842d36985d1 100644
---
a/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/typed/TypedSPIRegistryTest.java
+++
b/shardingsphere-infra/shardingsphere-infra-util/src/test/java/org/apache/shardingsphere/infra/util/spi/type/typed/TypedSPIRegistryTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.util.spi.type.typed;
import org.apache.shardingsphere.infra.util.spi.ShardingSphereServiceLoader;
-import
org.apache.shardingsphere.infra.util.spi.exception.ServiceProviderNotFoundException;
+import
org.apache.shardingsphere.infra.util.spi.exception.ServiceProviderNotFoundServerException;
import
org.apache.shardingsphere.infra.util.spi.type.typed.fixture.TypedSPIFixture;
import
org.apache.shardingsphere.infra.util.spi.type.typed.fixture.TypedSPIFixtureImpl;
import org.junit.Test;
@@ -72,12 +72,12 @@ public final class TypedSPIRegistryTest {
assertNotNull(TypedSPIRegistry.getRegisteredService(TypedSPIFixture.class,
"TYPED.ALIAS", new Properties()));
}
- @Test(expected = ServiceProviderNotFoundException.class)
+ @Test(expected = ServiceProviderNotFoundServerException.class)
public void
assertGetRegisteredServiceWithoutPropertiesWhenTypeIsNotExist() {
TypedSPIRegistry.getRegisteredService(TypedSPIFixture.class,
"NOT_EXISTED");
}
- @Test(expected = ServiceProviderNotFoundException.class)
+ @Test(expected = ServiceProviderNotFoundServerException.class)
public void assertGetRegisteredServiceWithPropertiesWhenTypeIsNotExist() {
TypedSPIRegistry.getRegisteredService(TypedSPIFixture.class,
"NOT_EXISTED", new Properties());
}
diff --git
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-spring-infra/shardingsphere-jdbc-spring-boot-starter-infra/src/main/java/org/apache/shardingsphere/spring/boot/datasource/DataSourceMapSetter.java
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-spring-infra/shardingsphere-jdbc-spring-boot-starter-infra/src/main/java/org/apache/shardingsphere/spring/boot/datasource/DataSourceMapSetter.java
index 84b2384d4e7..ba8f1ea6b3f 100644
---
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-spring-infra/shardingsphere-jdbc-spring-boot-starter-infra/src/main/java/org/apache/shardingsphere/spring/boot/datasource/DataSourceMapSetter.java
+++
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-spring-infra/shardingsphere-jdbc-spring-boot-starter-infra/src/main/java/org/apache/shardingsphere/spring/boot/datasource/DataSourceMapSetter.java
@@ -24,8 +24,8 @@ import lombok.NoArgsConstructor;
import
org.apache.shardingsphere.infra.datasource.pool.creator.DataSourcePoolCreator;
import org.apache.shardingsphere.infra.datasource.props.DataSourceProperties;
import org.apache.shardingsphere.infra.util.expr.InlineExpressionParser;
-import
org.apache.shardingsphere.spring.boot.exception.DataSourceJndiNotFoundException;
-import
org.apache.shardingsphere.spring.boot.exception.UnsupportedDataSourceTypeException;
+import
org.apache.shardingsphere.spring.boot.exception.DataSourceJndiNotFoundServerException;
+import
org.apache.shardingsphere.spring.boot.exception.UnsupportedDataSourceTypeServerException;
import org.apache.shardingsphere.spring.boot.util.PropertyUtil;
import org.springframework.core.env.Environment;
import org.springframework.core.env.StandardEnvironment;
@@ -65,9 +65,9 @@ public final class DataSourceMapSetter {
try {
result.put(each, getDataSource(environment, each));
} catch (final ReflectiveOperationException ex) {
- throw new UnsupportedDataSourceTypeException(ex);
+ throw new UnsupportedDataSourceTypeServerException(ex);
} catch (final NamingException ex) {
- throw new DataSourceJndiNotFoundException(ex);
+ throw new DataSourceJndiNotFoundServerException(ex);
}
}
return result;
diff --git
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-spring-infra/shardingsphere-jdbc-spring-boot-starter-infra/src/main/java/org/apache/shardingsphere/spring/boot/exception/DataSourceJndiNotFoundException.java
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-spring-infra/shardingsphere-jdbc-spring-boot-starter-infra/src/main/java/org/apache/shardingsphere/spring/boot/exception/DataSourceJndiNotFoundServerException.java
similarity index 86%
rename from
shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-spring-infra/shardingsphere-jdbc-spring-boot-starter-infra/src/main/java/org/apache/shardingsphere/spring/boot/exception/DataSourceJndiNotFoundException.java
rename to
shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-spring-infra/shardingsphere-jdbc-spring-boot-starter-infra/src/main/java/org/apache/shardingsphere/spring/boot/exception/DataSourceJndiNotFoundServerException.java
index 0846b95fc8b..710f2632127 100644
---
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-spring-infra/shardingsphere-jdbc-spring-boot-starter-infra/src/main/java/org/apache/shardingsphere/spring/boot/exception/DataSourceJndiNotFoundException.java
+++
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-spring-infra/shardingsphere-jdbc-spring-boot-starter-infra/src/main/java/org/apache/shardingsphere/spring/boot/exception/DataSourceJndiNotFoundServerException.java
@@ -17,12 +17,12 @@
package org.apache.shardingsphere.spring.boot.exception;
-import org.apache.shardingsphere.infra.util.exception.ShardingSphereException;
+import
org.apache.shardingsphere.infra.util.exception.ShardingSphereServerException;
/**
* Data source JNDI not found exception.
*/
-public final class DataSourceJndiNotFoundException extends
ShardingSphereException {
+public final class DataSourceJndiNotFoundServerException extends
ShardingSphereServerException {
private static final long serialVersionUID = -7793679063807601394L;
@@ -30,7 +30,7 @@ public final class DataSourceJndiNotFoundException extends
ShardingSphereExcepti
private static final int ERROR_CODE = 2;
- public DataSourceJndiNotFoundException(final Exception cause) {
+ public DataSourceJndiNotFoundServerException(final Exception cause) {
super(ERROR_CATEGORY, ERROR_CODE, "Can not find JNDI data source",
cause);
}
}
diff --git
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-spring-infra/shardingsphere-jdbc-spring-boot-starter-infra/src/main/java/org/apache/shardingsphere/spring/boot/exception/UnsupportedDataSourceTypeException.java
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-spring-infra/shardingsphere-jdbc-spring-boot-starter-infra/src/main/java/org/apache/shardingsphere/spring/boot/exception/UnsupportedDataSourceTypeServerException.java
similarity index 86%
rename from
shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-spring-infra/shardingsphere-jdbc-spring-boot-starter-infra/src/main/java/org/apache/shardingsphere/spring/boot/exception/UnsupportedDataSourceTypeException.java
rename to
shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-spring-infra/shardingsphere-jdbc-spring-boot-starter-infra/src/main/java/org/apache/shardingsphere/spring/boot/exception/UnsupportedDataSourceTypeServerException.java
index 7b6221aab20..b30e37b85b6 100644
---
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-spring-infra/shardingsphere-jdbc-spring-boot-starter-infra/src/main/java/org/apache/shardingsphere/spring/boot/exception/UnsupportedDataSourceTypeException.java
+++
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-spring-infra/shardingsphere-jdbc-spring-boot-starter-infra/src/main/java/org/apache/shardingsphere/spring/boot/exception/UnsupportedDataSourceTypeServerException.java
@@ -17,12 +17,12 @@
package org.apache.shardingsphere.spring.boot.exception;
-import org.apache.shardingsphere.infra.util.exception.ShardingSphereException;
+import
org.apache.shardingsphere.infra.util.exception.ShardingSphereServerException;
/**
* Unsupported data source type exception.
*/
-public final class UnsupportedDataSourceTypeException extends
ShardingSphereException {
+public final class UnsupportedDataSourceTypeServerException extends
ShardingSphereServerException {
private static final long serialVersionUID = 8264305279431450585L;
@@ -30,7 +30,7 @@ public final class UnsupportedDataSourceTypeException extends
ShardingSphereExce
private static final int ERROR_CODE = 1;
- public UnsupportedDataSourceTypeException(final Exception cause) {
+ public UnsupportedDataSourceTypeServerException(final Exception cause) {
super(ERROR_CATEGORY, ERROR_CODE, "Can not find data source type",
cause);
}
}
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/resource/AddResourceBackendHandler.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/resource/AddResourceBackendHandler.java
index a80b10b13cc..efe5efcd4eb 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/resource/AddResourceBackendHandler.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/resource/AddResourceBackendHandler.java
@@ -26,7 +26,7 @@ import
org.apache.shardingsphere.infra.datasource.props.DataSourcePropertiesVali
import org.apache.shardingsphere.infra.distsql.exception.DistSQLException;
import
org.apache.shardingsphere.infra.distsql.exception.resource.DuplicateResourceException;
import
org.apache.shardingsphere.infra.distsql.exception.resource.InvalidResourcesException;
-import org.apache.shardingsphere.infra.util.exception.ShardingSphereException;
+import
org.apache.shardingsphere.infra.util.exception.ShardingSphereServerException;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
import
org.apache.shardingsphere.proxy.backend.handler.DatabaseRequiredBackendHandler;
import org.apache.shardingsphere.proxy.backend.response.header.ResponseHeader;
@@ -65,7 +65,7 @@ public final class AddResourceBackendHandler extends
DatabaseRequiredBackendHand
validator.validate(dataSourcePropsMap, storeType);
try {
ProxyContext.getInstance().getContextManager().addResources(databaseName,
dataSourcePropsMap);
- } catch (final SQLException | ShardingSphereException ex) {
+ } catch (final SQLException | ShardingSphereServerException ex) {
log.error("Add resource failed", ex);
throw new
InvalidResourcesException(Collections.singleton(ex.getMessage()));
}
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/resource/AlterResourceBackendHandler.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/resource/AlterResourceBackendHandler.java
index bc0f8e96360..01f262324c4 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/resource/AlterResourceBackendHandler.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/resource/AlterResourceBackendHandler.java
@@ -32,7 +32,7 @@ import
org.apache.shardingsphere.infra.distsql.exception.DistSQLException;
import
org.apache.shardingsphere.infra.distsql.exception.resource.DuplicateResourceException;
import
org.apache.shardingsphere.infra.distsql.exception.resource.InvalidResourcesException;
import
org.apache.shardingsphere.infra.distsql.exception.resource.RequiredResourceMissedException;
-import org.apache.shardingsphere.infra.util.exception.ShardingSphereException;
+import
org.apache.shardingsphere.infra.util.exception.ShardingSphereServerException;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
import
org.apache.shardingsphere.proxy.backend.handler.DatabaseRequiredBackendHandler;
import org.apache.shardingsphere.proxy.backend.response.header.ResponseHeader;
@@ -71,7 +71,7 @@ public final class AlterResourceBackendHandler extends
DatabaseRequiredBackendHa
validator.validate(dataSourcePropsMap, databaseType);
try {
ProxyContext.getInstance().getContextManager().updateResources(databaseName,
dataSourcePropsMap);
- } catch (final SQLException | ShardingSphereException ex) {
+ } catch (final SQLException | ShardingSphereServerException ex) {
log.error("Alter resource failed", ex);
throw new
InvalidResourcesException(Collections.singleton(ex.getMessage()));
}
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/resource/DropResourceBackendHandler.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/resource/DropResourceBackendHandler.java
index 7d9990facf1..18d93285c3c 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/resource/DropResourceBackendHandler.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/resource/DropResourceBackendHandler.java
@@ -29,7 +29,7 @@ import
org.apache.shardingsphere.infra.distsql.exception.resource.ResourceInUsed
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import
org.apache.shardingsphere.infra.rule.identifier.type.DataNodeContainedRule;
import
org.apache.shardingsphere.infra.rule.identifier.type.DataSourceContainedRule;
-import org.apache.shardingsphere.infra.util.exception.ShardingSphereException;
+import
org.apache.shardingsphere.infra.util.exception.ShardingSphereServerException;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
import org.apache.shardingsphere.proxy.backend.response.header.ResponseHeader;
import
org.apache.shardingsphere.proxy.backend.response.header.update.UpdateResponseHeader;
@@ -61,7 +61,7 @@ public final class DropResourceBackendHandler extends
DatabaseRequiredBackendHan
check(databaseName, toBeDroppedResourceNames,
sqlStatement.isIgnoreSingleTables(), sqlStatement.isIfExists());
try {
ProxyContext.getInstance().getContextManager().dropResources(databaseName,
toBeDroppedResourceNames);
- } catch (final SQLException | ShardingSphereException ex) {
+ } catch (final SQLException | ShardingSphereServerException ex) {
log.error("Drop resource failed", ex);
throw new
InvalidResourcesException(Collections.singleton(ex.getMessage()));
}
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/java/org/apache/shardingsphere/proxy/database/DatabaseServerInfo.java
b/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/java/org/apache/shardingsphere/proxy/database/DatabaseServerInfo.java
index b6685a222bb..d4f0a913577 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/java/org/apache/shardingsphere/proxy/database/DatabaseServerInfo.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/java/org/apache/shardingsphere/proxy/database/DatabaseServerInfo.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.proxy.database;
import lombok.Getter;
-import
org.apache.shardingsphere.proxy.exception.DatabaseServerLoadingException;
+import
org.apache.shardingsphere.proxy.exception.DatabaseServerLoadingServerException;
import javax.sql.DataSource;
import java.sql.Connection;
@@ -41,7 +41,7 @@ public final class DatabaseServerInfo {
databaseName = databaseMetaData.getDatabaseProductName();
databaseVersion = databaseMetaData.getDatabaseProductVersion();
} catch (final SQLException ex) {
- throw new DatabaseServerLoadingException(ex);
+ throw new DatabaseServerLoadingServerException(ex);
}
}
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/java/org/apache/shardingsphere/proxy/exception/DatabaseServerLoadingException.java
b/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/java/org/apache/shardingsphere/proxy/exception/DatabaseServerLoadingServerException.java
similarity index 86%
rename from
shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/java/org/apache/shardingsphere/proxy/exception/DatabaseServerLoadingException.java
rename to
shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/java/org/apache/shardingsphere/proxy/exception/DatabaseServerLoadingServerException.java
index 19477d78d53..cb0144b2f32 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/java/org/apache/shardingsphere/proxy/exception/DatabaseServerLoadingException.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/java/org/apache/shardingsphere/proxy/exception/DatabaseServerLoadingServerException.java
@@ -17,14 +17,14 @@
package org.apache.shardingsphere.proxy.exception;
-import org.apache.shardingsphere.infra.util.exception.ShardingSphereException;
+import
org.apache.shardingsphere.infra.util.exception.ShardingSphereServerException;
import java.sql.SQLException;
/**
* Database server loading exception.
*/
-public final class DatabaseServerLoadingException extends
ShardingSphereException {
+public final class DatabaseServerLoadingServerException extends
ShardingSphereServerException {
private static final long serialVersionUID = -4016611838309960905L;
@@ -32,7 +32,7 @@ public final class DatabaseServerLoadingException extends
ShardingSphereExceptio
private static final int ERROR_CODE = 1;
- public DatabaseServerLoadingException(final SQLException cause) {
+ public DatabaseServerLoadingServerException(final SQLException cause) {
super(ERROR_CATEGORY, ERROR_CODE, "Load database server info failed",
cause);
}
}
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/test/java/org/apache/shardingsphere/proxy/database/DatabaseServerInfoTest.java
b/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/test/java/org/apache/shardingsphere/proxy/database/DatabaseServerInfoTest.java
index f1847cc327f..af7afcc0b1e 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/test/java/org/apache/shardingsphere/proxy/database/DatabaseServerInfoTest.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/test/java/org/apache/shardingsphere/proxy/database/DatabaseServerInfoTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.proxy.database;
-import
org.apache.shardingsphere.proxy.exception.DatabaseServerLoadingException;
+import
org.apache.shardingsphere.proxy.exception.DatabaseServerLoadingServerException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Answers;
@@ -39,7 +39,7 @@ public final class DatabaseServerInfoTest {
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
private DataSource dataSource;
- @Test(expected = DatabaseServerLoadingException.class)
+ @Test(expected = DatabaseServerLoadingServerException.class)
public void assertNewInstanceFailure() throws SQLException {
when(dataSource.getConnection()).thenThrow(SQLException.class);
new DatabaseServerInfo(dataSource);
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/exception/ExpectedExceptions.java
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/exception/ExpectedExceptions.java
index 31306fe9131..5bebcc8e4ad 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/exception/ExpectedExceptions.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/exception/ExpectedExceptions.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.proxy.frontend.exception;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
-import org.apache.shardingsphere.infra.util.exception.ShardingSphereException;
+import
org.apache.shardingsphere.infra.util.exception.ShardingSphereServerException;
import
org.apache.shardingsphere.infra.util.exception.ShardingSphereInsideException;
import
org.apache.shardingsphere.infra.util.exception.sql.ShardingSphereSQLException;
@@ -35,7 +35,7 @@ public final class ExpectedExceptions {
private static final Collection<Class<? extends Exception>> EXCEPTIONS =
new HashSet<>();
static {
- EXCEPTIONS.add(ShardingSphereException.class);
+ EXCEPTIONS.add(ShardingSphereServerException.class);
EXCEPTIONS.add(ShardingSphereInsideException.class);
EXCEPTIONS.add(ShardingSphereSQLException.class);
}
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/test/java/org/apache/shardingsphere/proxy/frontend/exception/ExpectedExceptionsTest.java
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/test/java/org/apache/shardingsphere/proxy/frontend/exception/ExpectedExceptionsTest.java
index 444e96b8776..d27a022128c 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/test/java/org/apache/shardingsphere/proxy/frontend/exception/ExpectedExceptionsTest.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/test/java/org/apache/shardingsphere/proxy/frontend/exception/ExpectedExceptionsTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.proxy.frontend.exception;
import org.apache.shardingsphere.dialect.exception.SQLDialectException;
-import org.apache.shardingsphere.infra.util.exception.ShardingSphereException;
+import
org.apache.shardingsphere.infra.util.exception.ShardingSphereServerException;
import
org.apache.shardingsphere.infra.util.exception.ShardingSphereInsideException;
import
org.apache.shardingsphere.infra.util.exception.sql.ShardingSphereSQLException;
import org.junit.Test;
@@ -30,7 +30,7 @@ public final class ExpectedExceptionsTest {
@Test
public void assertIsExpected() {
-
assertTrue(ExpectedExceptions.isExpected(ShardingSphereException.class));
+
assertTrue(ExpectedExceptions.isExpected(ShardingSphereServerException.class));
assertTrue(ExpectedExceptions.isExpected(ShardingSphereInsideException.class));
assertTrue(ExpectedExceptions.isExpected(SQLDialectException.class));
assertTrue(ExpectedExceptions.isExpected(ShardingSphereSQLException.class));
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-reactive-core/src/test/java/org/apache/shardingsphere/proxy/frontend/reactive/protocol/ReactiveDatabaseProtocolFrontendEngineFactoryTest.java
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-reactive-core/src/test/java/org/apache/shardingsphere/proxy/frontend/reactive/protocol/ReactiveDatabaseProtocolFrontendEngineFactoryTest.java
index 4ceb0ca8780..39daacf658e 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-reactive-core/src/test/java/org/apache/shardingsphere/proxy/frontend/reactive/protocol/ReactiveDatabaseProtocolFrontendEngineFactoryTest.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-reactive-core/src/test/java/org/apache/shardingsphere/proxy/frontend/reactive/protocol/ReactiveDatabaseProtocolFrontendEngineFactoryTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.proxy.frontend.reactive.protocol;
import
org.apache.shardingsphere.proxy.frontend.reactive.protocol.fixture.DummyReactiveDatabaseProtocolFrontendEngine;
-import
org.apache.shardingsphere.infra.util.spi.exception.ServiceProviderNotFoundException;
+import
org.apache.shardingsphere.infra.util.spi.exception.ServiceProviderNotFoundServerException;
import org.junit.Assert;
import org.junit.Test;
@@ -31,7 +31,7 @@ public final class
ReactiveDatabaseProtocolFrontendEngineFactoryTest {
Assert.assertThat(ReactiveDatabaseProtocolFrontendEngineFactory.newInstance("Dummy"),
instanceOf(DummyReactiveDatabaseProtocolFrontendEngine.class));
}
- @Test(expected = ServiceProviderNotFoundException.class)
+ @Test(expected = ServiceProviderNotFoundServerException.class)
public void assertNewInstanceWithUnknownType() {
ReactiveDatabaseProtocolFrontendEngineFactory.newInstance("Unknown");
}