test_class.declarator: randomReplicaLoadBalanceAlgorithm = new RandomReplicaLoadBalanceAlgorithm()
test_class.modifier: private final
test_class.original_string: private final RandomReplicaLoadBalanceAlgorithm randomReplicaLoadBalanceAlgorithm = new RandomReplicaLoadBalanceAlgorithm();
test_class.type: RandomReplicaLoadBalanceAlgorithm
test_class.var_name: randomReplicaLoadBalanceAlgorithm
test_class.file: shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/test/java/org/apache/shardingsphere/replication/primaryreplica/algorithm/RandomReplicaLoadBalanceAlgorithmTest.java
test_class.identifier: RandomReplicaLoadBalanceAlgorithmTest
test_case.body: @Test
      public void assertGetDataSource() {
          String primaryDataSourceName = "test_primary_ds";
          String replicaDataSourceName1 = "test_replica_ds_1";
          String replicaDataSourceName2 = "test_replica_ds_2";
          List<String> replicaDataSourceNames = Arrays.asList(replicaDataSourceName1, replicaDataSourceName2);
          assertTrue(replicaDataSourceNames.contains(randomReplicaLoadBalanceAlgorithm.getDataSource("ds", primaryDataSourceName, replicaDataSourceNames)));
          assertTrue(replicaDataSourceNames.contains(randomReplicaLoadBalanceAlgorithm.getDataSource("ds", primaryDataSourceName, replicaDataSourceNames)));
          assertTrue(replicaDataSourceNames.contains(randomReplicaLoadBalanceAlgorithm.getDataSource("ds", primaryDataSourceName, replicaDataSourceNames)));
      }
test_case.class_method_signature: RandomReplicaLoadBalanceAlgorithmTest.assertGetDataSource()
test_case.full_signature: @Test public void assertGetDataSource()
test_case.identifier: assertGetDataSource
test_case.invocations: asList assertTrue contains getDataSource assertTrue contains getDataSource assertTrue contains getDataSource
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertGetDataSource()
focal_class.declarator: props = new Properties()
focal_class.modifier: private
focal_class.original_string: private Properties props = new Properties();
focal_class.type: Properties
focal_class.var_name: props
focal_class.file: shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/main/java/org/apache/shardingsphere/replication/primaryreplica/algorithm/RandomReplicaLoadBalanceAlgorithm.java
focal_class.identifier: RandomReplicaLoadBalanceAlgorithm
focal_class.interfaces: implements ReplicaLoadBalanceAlgorithm
focal_class.class_method_signature: RandomReplicaLoadBalanceAlgorithm.getDataSource(final String name, final String primaryDataSourceName, final List<String> replicaDataSourceNames)
focal_class.full_signature: @Override public String getDataSource(final String name, final String primaryDataSourceName, final List<String> replicaDataSourceNames)
focal_class.identifier: getDataSource
focal_class.modifiers: @Override public
focal_class.parameters: (final String name, final String primaryDataSourceName, final List<String> replicaDataSourceNames)
focal_class.return: String
focal_class.signature: String getDataSource(final String name, final String primaryDataSourceName, final List<String> replicaDataSourceNames)
focal_class.class_method_signature: RandomReplicaLoadBalanceAlgorithm.getType()
focal_class.full_signature: @Override public String getType()
focal_class.identifier: getType
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getType()
focal_method.body: @Override
      public String getDataSource(final String name, final String primaryDataSourceName, final List<String> replicaDataSourceNames) {
          return replicaDataSourceNames.get(ThreadLocalRandom.current().nextInt(replicaDataSourceNames.size()));
      }
focal_method.class_method_signature: RandomReplicaLoadBalanceAlgorithm.getDataSource(final String name, final String primaryDataSourceName, final List<String> replicaDataSourceNames)
focal_method.full_signature: @Override public String getDataSource(final String name, final String primaryDataSourceName, final List<String> replicaDataSourceNames)
focal_method.identifier: getDataSource
focal_method.invocations: get nextInt current size
focal_method.modifiers: @Override public
focal_method.parameters: (final String name, final String primaryDataSourceName, final List<String> replicaDataSourceNames)
focal_method.return: String
focal_method.signature: String getDataSource(final String name, final String primaryDataSourceName, final List<String> replicaDataSourceNames)