未验证 提交 fc830bca 编写于 作者: G GeniusQ 提交者: GitHub

Add test case for RuleSchemaMetaData(#6731) (#6819)

* Add more test case for HintManager (apache#6712)
Co-authored-by: N胡宏韬 <huht@gddxit.com>
上级 af732b19
...@@ -120,7 +120,6 @@ public final class HintManagerTest { ...@@ -120,7 +120,6 @@ public final class HintManagerTest {
assertFalse(HintManager.isDatabaseShardingOnly()); assertFalse(HintManager.isDatabaseShardingOnly());
assertThat(HintManager.getDatabaseShardingValues("logic_table").size(), is(1)); assertThat(HintManager.getDatabaseShardingValues("logic_table").size(), is(1));
assertTrue(HintManager.getDatabaseShardingValues("logic_table").contains(2)); assertTrue(HintManager.getDatabaseShardingValues("logic_table").contains(2));
hintManager.close();
} }
} }
...@@ -133,7 +132,6 @@ public final class HintManagerTest { ...@@ -133,7 +132,6 @@ public final class HintManagerTest {
assertFalse(HintManager.isDatabaseShardingOnly()); assertFalse(HintManager.isDatabaseShardingOnly());
assertThat(HintManager.getTableShardingValues("logic_table").size(), is(1)); assertThat(HintManager.getTableShardingValues("logic_table").size(), is(1));
assertTrue(HintManager.getTableShardingValues("logic_table").contains(2)); assertTrue(HintManager.getTableShardingValues("logic_table").contains(2));
hintManager.close();
} }
} }
......
/*
* 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);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册