test_class.file: shardingsphere-proxy/shardingsphere-proxy-common/src/test/java/org/apache/shardingsphere/proxy/config/ProxyConfigurationLoaderTest.java
test_class.identifier: ProxyConfigurationLoaderTest
test_case.body: @Test
      public void assertLoad() throws IOException {
          YamlProxyConfiguration actual = ProxyConfigurationLoader.load("/conf/");
          assertThat(actual.getServerConfiguration().getGovernance().getRegistryCenter().getServerLists(), is("localhost:2181"));
          assertThat(actual.getRuleConfigurations().size(), is(3));
          assertShardingRuleConfiguration(actual.getRuleConfigurations().get("sharding_db"));
          assertPrimaryReplicaReplicationRuleConfiguration(actual.getRuleConfigurations().get("primary_replica_db"));
          assertEncryptRuleConfiguration(actual.getRuleConfigurations().get("encrypt_db"));
      }
test_case.class_method_signature: ProxyConfigurationLoaderTest.assertLoad()
test_case.full_signature: @Test public void assertLoad()
test_case.identifier: assertLoad
test_case.invocations: load assertThat getServerLists getRegistryCenter getGovernance getServerConfiguration is assertThat size getRuleConfigurations is assertShardingRuleConfiguration get getRuleConfigurations assertPrimaryReplicaReplicationRuleConfiguration get getRuleConfigurations assertEncryptRuleConfiguration get getRuleConfigurations
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertLoad()
focal_class.declarator: DEFAULT_DATASOURCE_NAME = "dataSource"
focal_class.modifier: private static final
focal_class.original_string: private static final String DEFAULT_DATASOURCE_NAME = "dataSource";
focal_class.type: String
focal_class.var_name: DEFAULT_DATASOURCE_NAME
focal_class.declarator: SERVER_CONFIG_FILE = "server.yaml"
focal_class.modifier: private static final
focal_class.original_string: private static final String SERVER_CONFIG_FILE = "server.yaml";
focal_class.type: String
focal_class.var_name: SERVER_CONFIG_FILE
focal_class.declarator: RULE_CONFIG_FILE_PATTERN = Pattern.compile("config-.+\\.yaml")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern RULE_CONFIG_FILE_PATTERN = Pattern.compile("config-.+\\.yaml");
focal_class.type: Pattern
focal_class.var_name: RULE_CONFIG_FILE_PATTERN
focal_class.file: shardingsphere-proxy/shardingsphere-proxy-common/src/main/java/org/apache/shardingsphere/proxy/config/ProxyConfigurationLoader.java
focal_class.identifier: ProxyConfigurationLoader
focal_class.class_method_signature: ProxyConfigurationLoader.load(final String path)
focal_class.full_signature: public static YamlProxyConfiguration load(final String path)
focal_class.identifier: load
focal_class.modifiers: public static
focal_class.parameters: (final String path)
focal_class.return: YamlProxyConfiguration
focal_class.signature: YamlProxyConfiguration load(final String path)
focal_class.class_method_signature: ProxyConfigurationLoader.getResourceFile(final String path)
focal_class.full_signature: private static File getResourceFile(final String path)
focal_class.identifier: getResourceFile
focal_class.modifiers: private static
focal_class.parameters: (final String path)
focal_class.return: File
focal_class.signature: File getResourceFile(final String path)
focal_class.class_method_signature: ProxyConfigurationLoader.loadServerConfiguration(final File yamlFile)
focal_class.full_signature: private static YamlProxyServerConfiguration loadServerConfiguration(final File yamlFile)
focal_class.identifier: loadServerConfiguration
focal_class.modifiers: private static
focal_class.parameters: (final File yamlFile)
focal_class.return: YamlProxyServerConfiguration
focal_class.signature: YamlProxyServerConfiguration loadServerConfiguration(final File yamlFile)
focal_class.class_method_signature: ProxyConfigurationLoader.loadRuleConfigurations(final Collection<String> schemaNames, final File configPath)
focal_class.full_signature: private static Collection<YamlProxyRuleConfiguration> loadRuleConfigurations(final Collection<String> schemaNames, final File configPath)
focal_class.identifier: loadRuleConfigurations
focal_class.modifiers: private static
focal_class.parameters: (final Collection<String> schemaNames, final File configPath)
focal_class.return: Collection<YamlProxyRuleConfiguration>
focal_class.signature: Collection<YamlProxyRuleConfiguration> loadRuleConfigurations(final Collection<String> schemaNames, final File configPath)
focal_class.class_method_signature: ProxyConfigurationLoader.loadRuleConfiguration(final File yamlFile)
focal_class.full_signature: private static Optional<YamlProxyRuleConfiguration> loadRuleConfiguration(final File yamlFile)
focal_class.identifier: loadRuleConfiguration
focal_class.modifiers: private static
focal_class.parameters: (final File yamlFile)
focal_class.return: Optional<YamlProxyRuleConfiguration>
focal_class.signature: Optional<YamlProxyRuleConfiguration> loadRuleConfiguration(final File yamlFile)
focal_class.class_method_signature: ProxyConfigurationLoader.findRuleConfigurationFiles(final File path)
focal_class.full_signature: private static File[] findRuleConfigurationFiles(final File path)
focal_class.identifier: findRuleConfigurationFiles
focal_class.modifiers: private static
focal_class.parameters: (final File path)
focal_class.return: File[]
focal_class.signature: File[] findRuleConfigurationFiles(final File path)
focal_method.body: public static YamlProxyConfiguration load(final String path) throws IOException {
          Collection<String> schemaNames = new HashSet<>();
          YamlProxyServerConfiguration serverConfig = loadServerConfiguration(getResourceFile(path + "/" + SERVER_CONFIG_FILE));
          File configPath = getResourceFile(path);
          Collection<YamlProxyRuleConfiguration> ruleConfigurations = loadRuleConfigurations(schemaNames, configPath);
          Preconditions.checkState(!ruleConfigurations.isEmpty() || null != serverConfig.getGovernance(), "Can not find any rule configurations file in path `%s`.", configPath.getPath());
          return new YamlProxyConfiguration(serverConfig, ruleConfigurations.stream().collect(Collectors.toMap(YamlProxyRuleConfiguration::getSchemaName, each -> each)));
      }
focal_method.class_method_signature: ProxyConfigurationLoader.load(final String path)
focal_method.full_signature: public static YamlProxyConfiguration load(final String path)
focal_method.identifier: load
focal_method.invocations: loadServerConfiguration getResourceFile getResourceFile loadRuleConfigurations checkState isEmpty getGovernance getPath collect stream toMap
focal_method.modifiers: public static
focal_method.parameters: (final String path)
focal_method.return: YamlProxyConfiguration
focal_method.signature: YamlProxyConfiguration load(final String path)