You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2020/09/12 15:02:19 UTC

[shardingsphere] branch master updated: Add test case for ExpectedExceptions (#7420)

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 57798ff  Add test case for ExpectedExceptions (#7420)
57798ff is described below

commit 57798ff6637fdff613139277ed53ad401829ddec
Author: Serendipity <ja...@163.com>
AuthorDate: Sat Sep 12 23:01:53 2020 +0800

    Add test case for ExpectedExceptions (#7420)
---
 .../frontend/exception/ExpectedExceptionsTest.java | 39 ++++++++++++++++++++++
 1 file changed, 39 insertions(+)

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
new file mode 100644
index 0000000..b2b896d
--- /dev/null
+++ b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/test/java/org/apache/shardingsphere/proxy/frontend/exception/ExpectedExceptionsTest.java
@@ -0,0 +1,39 @@
+/*
+ * 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.shardingsphere.proxy.frontend.exception;
+
+import org.apache.shardingsphere.infra.config.exception.ShardingSphereConfigurationException;
+import org.apache.shardingsphere.infra.exception.ShardingSphereException;
+import org.apache.shardingsphere.proxy.backend.exception.BackendException;
+import org.apache.shardingsphere.proxy.backend.text.sctl.exception.ShardingCTLException;
+import org.apache.shardingsphere.sql.parser.exception.SQLParsingException;
+import org.junit.Test;
+
+import static org.junit.Assert.assertTrue;
+
+public final class ExpectedExceptionsTest {
+    
+    @Test
+    public void assertIsExpected() {
+        assertTrue(ExpectedExceptions.isExpected(ShardingSphereException.class));
+        assertTrue(ExpectedExceptions.isExpected(ShardingSphereConfigurationException.class));
+        assertTrue(ExpectedExceptions.isExpected(SQLParsingException.class));
+        assertTrue(ExpectedExceptions.isExpected(ShardingCTLException.class));
+        assertTrue(ExpectedExceptions.isExpected(BackendException.class));
+    }
+}