test_class.file: gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/SettingsTest.java
test_class.identifier: SettingsTest
test_case.body: @Test
      public void shouldCreateFromConfiguration() {
          final Configuration conf = new BaseConfiguration();
          conf.setProperty("port", 8000);
          conf.setProperty("nioPoolSize", 16);
          conf.setProperty("workerPoolSize", 32);
          conf.setProperty("username", "user1");
          conf.setProperty("password", "password1");
          conf.setProperty("jaasEntry", "JaasIt");
          conf.setProperty("protocol", "protocol0");
          conf.setProperty("hosts", Arrays.asList("255.0.0.1", "255.0.0.2", "255.0.0.3"));
          conf.setProperty("serializer.className", "my.serializers.MySerializer");
          conf.setProperty("serializer.config.any", "thing");
          conf.setProperty("connectionPool.enableSsl", true);
          conf.setProperty("connectionPool.trustCertChainFile", "pem");
          conf.setProperty("connectionPool.minSize", 100);
          conf.setProperty("connectionPool.maxSize", 200);
          conf.setProperty("connectionPool.minSimultaneousUsagePerConnection", 300);
          conf.setProperty("connectionPool.maxSimultaneousUsagePerConnection", 400);
          conf.setProperty("connectionPool.maxInProcessPerConnection", 500);
          conf.setProperty("connectionPool.minInProcessPerConnection", 600);
          conf.setProperty("connectionPool.maxWaitForConnection", 700);
          conf.setProperty("connectionPool.maxContentLength", 800);
          conf.setProperty("connectionPool.reconnectInterval", 900);
          conf.setProperty("connectionPool.reconnectInitialDelay", 1000);
          conf.setProperty("connectionPool.resultIterationBatchSize", 1100);
          conf.setProperty("connectionPool.channelizer", "channelizer0");
  
          final Settings settings = Settings.from(conf);
  
          assertEquals(8000, settings.port);
          assertEquals(16, settings.nioPoolSize);
          assertEquals(32, settings.workerPoolSize);
          assertEquals("user1", settings.username);
          assertEquals("password1", settings.password);
          assertEquals("JaasIt", settings.jaasEntry);
          assertEquals("protocol0", settings.protocol);
          assertEquals("my.serializers.MySerializer", settings.serializer.className);
          assertEquals("thing", settings.serializer.config.get("any"));
          assertEquals(true, settings.connectionPool.enableSsl);
          assertEquals("pem", settings.connectionPool.trustCertChainFile);
          assertEquals(100, settings.connectionPool.minSize);
          assertEquals(200, settings.connectionPool.maxSize);
          assertEquals(300, settings.connectionPool.minSimultaneousUsagePerConnection);
          assertEquals(400, settings.connectionPool.maxSimultaneousUsagePerConnection);
          assertEquals(500, settings.connectionPool.maxInProcessPerConnection);
          assertEquals(600, settings.connectionPool.minInProcessPerConnection);
          assertEquals(700, settings.connectionPool.maxWaitForConnection);
          assertEquals(800, settings.connectionPool.maxContentLength);
          assertEquals(900, settings.connectionPool.reconnectInterval);
          assertEquals(1000, settings.connectionPool.reconnectInitialDelay);
          assertEquals(1100, settings.connectionPool.resultIterationBatchSize);
          assertEquals("channelizer0", settings.connectionPool.channelizer);
      }
test_case.class_method_signature: SettingsTest.shouldCreateFromConfiguration()
test_case.full_signature: @Test public void shouldCreateFromConfiguration()
test_case.identifier: shouldCreateFromConfiguration
test_case.invocations: setProperty setProperty setProperty setProperty setProperty setProperty setProperty setProperty asList setProperty setProperty setProperty setProperty setProperty setProperty setProperty setProperty setProperty setProperty setProperty setProperty setProperty setProperty setProperty setProperty from assertEquals assertEquals assertEquals assertEquals assertEquals assertEquals assertEquals assertEquals assertEquals get assertEquals assertEquals assertEquals assertEquals assertEquals assertEquals assertEquals assertEquals assertEquals assertEquals assertEquals assertEquals assertEquals assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldCreateFromConfiguration()
focal_class.declarator: port = 8182
focal_class.modifier: public
focal_class.original_string: public int port = 8182;
focal_class.type: int
focal_class.var_name: port
focal_class.declarator: hosts = new ArrayList<>()
focal_class.modifier: public
focal_class.original_string: public List<String> hosts = new ArrayList<>();
focal_class.type: List<String>
focal_class.var_name: hosts
focal_class.declarator: serializer = new SerializerSettings()
focal_class.modifier: public
focal_class.original_string: public SerializerSettings serializer = new SerializerSettings();
focal_class.type: SerializerSettings
focal_class.var_name: serializer
focal_class.declarator: connectionPool = new ConnectionPoolSettings()
focal_class.modifier: public
focal_class.original_string: public ConnectionPoolSettings connectionPool = new ConnectionPoolSettings();
focal_class.type: ConnectionPoolSettings
focal_class.var_name: connectionPool
focal_class.declarator: nioPoolSize = Runtime.getRuntime().availableProcessors()
focal_class.modifier: public
focal_class.original_string: public int nioPoolSize = Runtime.getRuntime().availableProcessors();
focal_class.type: int
focal_class.var_name: nioPoolSize
focal_class.declarator: workerPoolSize = Runtime.getRuntime().availableProcessors() * 2
focal_class.modifier: public
focal_class.original_string: public int workerPoolSize = Runtime.getRuntime().availableProcessors() * 2;
focal_class.type: int
focal_class.var_name: workerPoolSize
focal_class.declarator: username = null
focal_class.modifier: public
focal_class.original_string: public String username = null;
focal_class.type: String
focal_class.var_name: username
focal_class.declarator: password = null
focal_class.modifier: public
focal_class.original_string: public String password = null;
focal_class.type: String
focal_class.var_name: password
focal_class.declarator: jaasEntry = null
focal_class.modifier: public
focal_class.original_string: public String jaasEntry = null;
focal_class.type: String
focal_class.var_name: jaasEntry
focal_class.declarator: protocol = null
focal_class.modifier: public
focal_class.original_string: public String protocol = null;
focal_class.type: String
focal_class.var_name: protocol
focal_class.file: gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
focal_class.identifier: Settings
focal_class.class_method_signature: Settings.read(final InputStream stream)
focal_class.full_signature: public static Settings read(final InputStream stream)
focal_class.identifier: read
focal_class.modifiers: public static
focal_class.parameters: (final InputStream stream)
focal_class.return: Settings
focal_class.signature: Settings read(final InputStream stream)
focal_class.class_method_signature: Settings.from(final Configuration conf)
focal_class.full_signature: public static Settings from(final Configuration conf)
focal_class.identifier: from
focal_class.modifiers: public static
focal_class.parameters: (final Configuration conf)
focal_class.return: Settings
focal_class.signature: Settings from(final Configuration conf)
focal_method.body: public static Settings from(final Configuration conf) {
          final Settings settings = new Settings();
  
          if (conf.containsKey("port"))
              settings.port = conf.getInt("port");
  
          if (conf.containsKey("nioPoolSize"))
              settings.nioPoolSize = conf.getInt("nioPoolSize");
  
          if (conf.containsKey("workerPoolSize"))
              settings.workerPoolSize = conf.getInt("workerPoolSize");
  
          if (conf.containsKey("username"))
              settings.username = conf.getString("username");
  
          if (conf.containsKey("password"))
              settings.password = conf.getString("password");
  
          if (conf.containsKey("jaasEntry"))
              settings.jaasEntry = conf.getString("jaasEntry");
  
          if (conf.containsKey("protocol"))
              settings.protocol = conf.getString("protocol");
  
          if (conf.containsKey("hosts"))
              settings.hosts = conf.getList("hosts").stream().map(Object::toString).collect(Collectors.toList());
  
          if (conf.containsKey("serializer.className")) {
              final SerializerSettings serializerSettings = new SerializerSettings();
              final Configuration serializerConf = conf.subset("serializer");
  
              if (serializerConf.containsKey("className"))
                  serializerSettings.className = serializerConf.getString("className");
  
              final Configuration serializerConfigConf = conf.subset("serializer.config");
              if (IteratorUtils.count(serializerConfigConf.getKeys()) > 0) {
                  final Map<String,Object> m = new HashMap<>();
                  serializerConfigConf.getKeys().forEachRemaining(name -> {
                      m.put(name, serializerConfigConf.getProperty(name));
                  });
                  serializerSettings.config = m;
              }
              settings.serializer = serializerSettings;
          }
  
          final Configuration connectionPoolConf = conf.subset("connectionPool");
          if (IteratorUtils.count(connectionPoolConf.getKeys()) > 0) {
              final ConnectionPoolSettings cpSettings = new ConnectionPoolSettings();
  
              if (connectionPoolConf.containsKey("channelizer"))
                  cpSettings.channelizer = connectionPoolConf.getString("channelizer");
  
              if (connectionPoolConf.containsKey("enableSsl"))
                  cpSettings.enableSsl = connectionPoolConf.getBoolean("enableSsl");
  
              if (connectionPoolConf.containsKey("trustCertChainFile"))
                  cpSettings.trustCertChainFile = connectionPoolConf.getString("trustCertChainFile");
  
              if (connectionPoolConf.containsKey("minSize"))
                  cpSettings.minSize = connectionPoolConf.getInt("minSize");
  
              if (connectionPoolConf.containsKey("maxSize"))
                  cpSettings.maxSize = connectionPoolConf.getInt("maxSize");
  
              if (connectionPoolConf.containsKey("minSimultaneousUsagePerConnection"))
                  cpSettings.minSimultaneousUsagePerConnection = connectionPoolConf.getInt("minSimultaneousUsagePerConnection");
  
              if (connectionPoolConf.containsKey("maxSimultaneousUsagePerConnection"))
                  cpSettings.maxSimultaneousUsagePerConnection = connectionPoolConf.getInt("maxSimultaneousUsagePerConnection");
  
              if (connectionPoolConf.containsKey("maxInProcessPerConnection"))
                  cpSettings.maxInProcessPerConnection = connectionPoolConf.getInt("maxInProcessPerConnection");
  
              if (connectionPoolConf.containsKey("minInProcessPerConnection"))
                  cpSettings.minInProcessPerConnection = connectionPoolConf.getInt("minInProcessPerConnection");
  
              if (connectionPoolConf.containsKey("maxWaitForConnection"))
                  cpSettings.maxWaitForConnection = connectionPoolConf.getInt("maxWaitForConnection");
  
              if (connectionPoolConf.containsKey("maxContentLength"))
                  cpSettings.maxContentLength = connectionPoolConf.getInt("maxContentLength");
  
              if (connectionPoolConf.containsKey("reconnectInterval"))
                  cpSettings.reconnectInterval = connectionPoolConf.getInt("reconnectInterval");
  
              if (connectionPoolConf.containsKey("reconnectInitialDelay"))
                  cpSettings.reconnectInitialDelay = connectionPoolConf.getInt("reconnectInitialDelay");
  
              if (connectionPoolConf.containsKey("resultIterationBatchSize"))
                  cpSettings.resultIterationBatchSize = connectionPoolConf.getInt("resultIterationBatchSize");
  
  
              settings.connectionPool = cpSettings;
          }
  
          return settings;
      }
focal_method.class_method_signature: Settings.from(final Configuration conf)
focal_method.full_signature: public static Settings from(final Configuration conf)
focal_method.identifier: from
focal_method.invocations: containsKey getInt containsKey getInt containsKey getInt containsKey getString containsKey getString containsKey getString containsKey getString containsKey collect map stream getList toList containsKey subset containsKey getString subset count getKeys forEachRemaining getKeys put getProperty subset count getKeys containsKey getString containsKey getBoolean containsKey getString containsKey getInt containsKey getInt containsKey getInt containsKey getInt containsKey getInt containsKey getInt containsKey getInt containsKey getInt containsKey getInt containsKey getInt containsKey getInt
focal_method.modifiers: public static
focal_method.parameters: (final Configuration conf)
focal_method.return: Settings
focal_method.signature: Settings from(final Configuration conf)