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/08/19 10:15:35 UTC
[shardingsphere] branch master updated: Add test case for
RuleSchemaMetaData(#6731) (#6819)
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 fc830bc Add test case for RuleSchemaMetaData(#6731) (#6819)
fc830bc is described below
commit fc830bca55412590df7f94bdbf52e92230e30e3c
Author: GeniusQ <ge...@qq.com>
AuthorDate: Wed Aug 19 18:15:23 2020 +0800
Add test case for RuleSchemaMetaData(#6731) (#6819)
* Add more test case for HintManager (apache#6712)
Co-authored-by: 胡宏韬 <hu...@gddxit.com>
---
.../shardingsphere/infra/hint/HintManagerTest.java | 2 --
.../metadata/schema/RuleSchemaMetaDataTest.java | 38 ++++++++++++++++++++++
2 files changed, 38 insertions(+), 2 deletions(-)
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/hint/HintManagerTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/hint/HintManagerTest.java
index 978eaee..fda6a38 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/hint/HintManagerTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/hint/HintManagerTest.java
@@ -120,7 +120,6 @@ public final class HintManagerTest {
assertFalse(HintManager.isDatabaseShardingOnly());
assertThat(HintManager.getDatabaseShardingValues("logic_table").size(), is(1));
assertTrue(HintManager.getDatabaseShardingValues("logic_table").contains(2));
- hintManager.close();
}
}
@@ -133,7 +132,6 @@ public final class HintManagerTest {
assertFalse(HintManager.isDatabaseShardingOnly());
assertThat(HintManager.getTableShardingValues("logic_table").size(), is(1));
assertTrue(HintManager.getTableShardingValues("logic_table").contains(2));
- hintManager.close();
}
}
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/schema/RuleSchemaMetaDataTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/schema/RuleSchemaMetaDataTest.java
new file mode 100644
index 0000000..d057748
--- /dev/null
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/schema/RuleSchemaMetaDataTest.java
@@ -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.shardingsphere.infra.metadata.schema;
+
+import org.apache.shardingsphere.sql.parser.binder.metadata.schema.SchemaMetaData;
+import org.apache.shardingsphere.sql.parser.binder.metadata.table.TableMetaData;
+import org.junit.Test;
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.junit.Assert.assertNotNull;
+
+public final class RuleSchemaMetaDataTest {
+
+ @Test
+ public void assertGetSchemaMetaData() {
+ Map<String, TableMetaData> tableMetaDataMap = new HashMap<>(1, 1);
+ Map<String, SchemaMetaData> unconfiguredSchemaMetaDataMap = new HashMap<>(1, 1);
+ RuleSchemaMetaData ruleSchemaMetaData = new RuleSchemaMetaData(new SchemaMetaData(tableMetaDataMap), unconfiguredSchemaMetaDataMap);
+ SchemaMetaData schemaMetaData = ruleSchemaMetaData.getSchemaMetaData();
+ assertNotNull("SchemaMetaData is null", schemaMetaData);
+ }
+}