test_class.declarator: environmentVariables = new EnvironmentVariables()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public EnvironmentVariables environmentVariables = new EnvironmentVariables();
test_class.type: EnvironmentVariables
test_class.var_name: environmentVariables
test_class.declarator: dataBridgeApp = new MockDataBridgeApp()
test_class.modifier: private
test_class.original_string: private MockDataBridgeApp dataBridgeApp = new MockDataBridgeApp();
test_class.type: MockDataBridgeApp
test_class.var_name: dataBridgeApp
test_class.file: herd-code/herd-tools/herd-tools-common/src/test/java/org/finra/herd/tools/common/databridge/DataBridgeAppTest.java
test_class.identifier: DataBridgeAppTest
test_class.superclass: extends AbstractDataBridgeTest
test_case.body: @Test
      public void testParseCommandLineArgumentsParseException()
      {
          String[] arguments = {};
          ReturnValue returnValue = dataBridgeApp.parseCommandLineArguments(arguments, applicationContext);
  
          assertEquals("returnValue", ReturnValue.FAILURE, returnValue);
      }
test_case.class_method_signature: DataBridgeAppTest.testParseCommandLineArgumentsParseException()
test_case.full_signature: @Test public void testParseCommandLineArgumentsParseException()
test_case.identifier: testParseCommandLineArgumentsParseException
test_case.invocations: parseCommandLineArguments assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testParseCommandLineArgumentsParseException()
focal_class.declarator: BUILD_INFO_STRING_FORMAT = "buildDate: %s\nbuildNumber: %s\nbuildOS: %s\nbuildUser: %s"
focal_class.modifier: public static final
focal_class.original_string: public static final String BUILD_INFO_STRING_FORMAT = "buildDate: %s\nbuildNumber: %s\nbuildOS: %s\nbuildUser: %s";
focal_class.type: String
focal_class.var_name: BUILD_INFO_STRING_FORMAT
focal_class.declarator: LOGGER = LoggerFactory.getLogger(DataBridgeApp.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(DataBridgeApp.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: s3AccessKeyOpt
focal_class.modifier: protected
focal_class.original_string: protected Option s3AccessKeyOpt;
focal_class.type: Option
focal_class.var_name: s3AccessKeyOpt
focal_class.declarator: s3SecretKeyOpt
focal_class.modifier: protected
focal_class.original_string: protected Option s3SecretKeyOpt;
focal_class.type: Option
focal_class.var_name: s3SecretKeyOpt
focal_class.declarator: s3EndpointOpt
focal_class.modifier: protected
focal_class.original_string: protected Option s3EndpointOpt;
focal_class.type: Option
focal_class.var_name: s3EndpointOpt
focal_class.declarator: localPathOpt
focal_class.modifier: protected
focal_class.original_string: protected Option localPathOpt;
focal_class.type: Option
focal_class.var_name: localPathOpt
focal_class.declarator: manifestPathOpt
focal_class.modifier: protected
focal_class.original_string: protected Option manifestPathOpt;
focal_class.type: Option
focal_class.var_name: manifestPathOpt
focal_class.declarator: regServerHostOpt
focal_class.modifier: protected
focal_class.original_string: protected Option regServerHostOpt;
focal_class.type: Option
focal_class.var_name: regServerHostOpt
focal_class.declarator: regServerPortOpt
focal_class.modifier: protected
focal_class.original_string: protected Option regServerPortOpt;
focal_class.type: Option
focal_class.var_name: regServerPortOpt
focal_class.declarator: dmRegServerHostOpt
focal_class.modifier: protected
focal_class.original_string: protected Option dmRegServerHostOpt;
focal_class.type: Option
focal_class.var_name: dmRegServerHostOpt
focal_class.declarator: dmRegServerPortOpt
focal_class.modifier: protected
focal_class.original_string: protected Option dmRegServerPortOpt;
focal_class.type: Option
focal_class.var_name: dmRegServerPortOpt
focal_class.declarator: sslOpt
focal_class.modifier: protected
focal_class.original_string: protected Option sslOpt;
focal_class.type: Option
focal_class.var_name: sslOpt
focal_class.declarator: usernameOpt
focal_class.modifier: protected
focal_class.original_string: protected Option usernameOpt;
focal_class.type: Option
focal_class.var_name: usernameOpt
focal_class.declarator: passwordOpt
focal_class.modifier: protected
focal_class.original_string: protected Option passwordOpt;
focal_class.type: Option
focal_class.var_name: passwordOpt
focal_class.declarator: enableEnvVariablesOpt
focal_class.modifier: protected
focal_class.original_string: protected Option enableEnvVariablesOpt;
focal_class.type: Option
focal_class.var_name: enableEnvVariablesOpt
focal_class.declarator: trustSelfSignedCertificateOpt
focal_class.modifier: protected
focal_class.original_string: protected Option trustSelfSignedCertificateOpt;
focal_class.type: Option
focal_class.var_name: trustSelfSignedCertificateOpt
focal_class.declarator: disableHostnameVerificationOpt
focal_class.modifier: protected
focal_class.original_string: protected Option disableHostnameVerificationOpt;
focal_class.type: Option
focal_class.var_name: disableHostnameVerificationOpt
focal_class.declarator: helpOpt
focal_class.modifier: protected
focal_class.original_string: protected Option helpOpt;
focal_class.type: Option
focal_class.var_name: helpOpt
focal_class.declarator: versionOpt
focal_class.modifier: protected
focal_class.original_string: protected Option versionOpt;
focal_class.type: Option
focal_class.var_name: versionOpt
focal_class.declarator: httpProxyHostOpt
focal_class.modifier: protected
focal_class.original_string: protected Option httpProxyHostOpt;
focal_class.type: Option
focal_class.var_name: httpProxyHostOpt
focal_class.declarator: httpProxyPortOpt
focal_class.modifier: protected
focal_class.original_string: protected Option httpProxyPortOpt;
focal_class.type: Option
focal_class.var_name: httpProxyPortOpt
focal_class.declarator: maxThreadsOpt
focal_class.modifier: protected
focal_class.original_string: protected Option maxThreadsOpt;
focal_class.type: Option
focal_class.var_name: maxThreadsOpt
focal_class.declarator: socketTimeoutOpt
focal_class.modifier: protected
focal_class.original_string: protected Option socketTimeoutOpt;
focal_class.type: Option
focal_class.var_name: socketTimeoutOpt
focal_class.declarator: useSsl
focal_class.modifier: protected
focal_class.original_string: protected Boolean useSsl;
focal_class.type: Boolean
focal_class.var_name: useSsl
focal_class.declarator: trustSelfSignedCertificate
focal_class.modifier: protected
focal_class.original_string: protected Boolean trustSelfSignedCertificate;
focal_class.type: Boolean
focal_class.var_name: trustSelfSignedCertificate
focal_class.declarator: disableHostnameVerification
focal_class.modifier: protected
focal_class.original_string: protected Boolean disableHostnameVerification;
focal_class.type: Boolean
focal_class.var_name: disableHostnameVerification
focal_class.declarator: regServerPort
focal_class.modifier: protected
focal_class.original_string: protected Integer regServerPort;
focal_class.type: Integer
focal_class.var_name: regServerPort
focal_class.declarator: httpProxyPort
focal_class.modifier: protected
focal_class.original_string: protected Integer httpProxyPort;
focal_class.type: Integer
focal_class.var_name: httpProxyPort
focal_class.declarator: maxThreads
focal_class.modifier: protected
focal_class.original_string: protected Integer maxThreads;
focal_class.type: Integer
focal_class.var_name: maxThreads
focal_class.declarator: regServerHost
focal_class.modifier: protected
focal_class.original_string: protected String regServerHost;
focal_class.type: String
focal_class.var_name: regServerHost
focal_class.file: herd-code/herd-tools/herd-tools-common/src/main/java/org/finra/herd/tools/common/databridge/DataBridgeApp.java
focal_class.identifier: DataBridgeApp
focal_class.class_method_signature: DataBridgeApp.getArgumentParser()
focal_class.full_signature: public abstract ArgumentParser getArgumentParser()
focal_class.identifier: getArgumentParser
focal_class.modifiers: public abstract
focal_class.parameters: ()
focal_class.return: ArgumentParser
focal_class.signature: ArgumentParser getArgumentParser()
focal_class.class_method_signature: DataBridgeApp.go(String[] args)
focal_class.full_signature: public abstract ReturnValue go(String[] args)
focal_class.identifier: go
focal_class.modifiers: public abstract
focal_class.parameters: (String[] args)
focal_class.return: ReturnValue
focal_class.signature: ReturnValue go(String[] args)
focal_class.class_method_signature: DataBridgeApp.parseCommandLineArguments(String[] args, ApplicationContext applicationContext)
focal_class.full_signature: @SuppressWarnings("PMD.SystemPrintln") @SuppressFBWarnings(value = "VA_FORMAT_STRING_USES_NEWLINE", justification = "We will use the standard carriage return character.") protected ReturnValue parseCommandLineArguments(String[] args, ApplicationContext applicationContext)
focal_class.identifier: parseCommandLineArguments
focal_class.modifiers: @SuppressWarnings("PMD.SystemPrintln") @SuppressFBWarnings(value = "VA_FORMAT_STRING_USES_NEWLINE", justification = "We will use the standard carriage return character.") protected
focal_class.parameters: (String[] args, ApplicationContext applicationContext)
focal_class.return: ReturnValue
focal_class.signature: ReturnValue parseCommandLineArguments(String[] args, ApplicationContext applicationContext)
focal_class.class_method_signature: DataBridgeApp.createApplicationContext()
focal_class.full_signature: protected ApplicationContext createApplicationContext()
focal_class.identifier: createApplicationContext
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: ApplicationContext
focal_class.signature: ApplicationContext createApplicationContext()
focal_method.body: @SuppressWarnings("PMD.SystemPrintln")
      @SuppressFBWarnings(value = "VA_FORMAT_STRING_USES_NEWLINE", justification = "We will use the standard carriage return character.")
      protected ReturnValue parseCommandLineArguments(String[] args, ApplicationContext applicationContext)
      {
          // Get the application argument parser.
          ArgumentParser argParser = getArgumentParser();
  
          try
          {
              s3AccessKeyOpt = argParser.addArgument("a", "s3AccessKey", true, "S3 access key.", false);
              s3SecretKeyOpt = argParser.addArgument("p", "s3SecretKey", true, "S3 secret key.", false);
              s3EndpointOpt = argParser.addArgument("e", "s3Endpoint", true, "S3 endpoint.", false);
              localPathOpt = argParser.addArgument("l", "localPath", true, "The path to files on your local file system.", true);
              manifestPathOpt = argParser.addArgument("m", "manifestPath", true, "Local path to the manifest file.", true);
              regServerHostOpt = argParser.addArgument("H", "regServerHost", true, "Registration Service hostname.", false);
              regServerPortOpt = argParser.addArgument("P", "regServerPort", true, "Registration Service port.", false);
              dmRegServerHostOpt = argParser.addArgument("Y", "dmRegServerHost", true, "Registration Service hostname (deprecated - use regServerHost).", false);
              dmRegServerPortOpt = argParser.addArgument("Z", "dmRegServerPort", true, "Registration Service port (deprecated - use regServerPort.", false);
              sslOpt = argParser.addArgument("s", "ssl", true, "Enable or disable SSL (HTTPS).", false);
              usernameOpt = argParser.addArgument("u", "username", true, "The username for HTTPS client authentication.", false);
              passwordOpt = argParser.addArgument("w", "password", true, "The password used for HTTPS client authentication.", false);
              enableEnvVariablesOpt = argParser.addArgument("E", "enableEnvVariables", true,
                  "The enableEnvVariables used for HTTPS client authentication through environment provided variable.", false);
              trustSelfSignedCertificateOpt =
                  argParser.addArgument("C", "trustSelfSignedCertificate", true, "If set to true, makes HTTPS client trust self-signed certificate.", false);
              disableHostnameVerificationOpt =
                  argParser.addArgument("d", "disableHostnameVerification", true, "If set to true, turns off hostname verification.", false);
              helpOpt = argParser.addArgument("h", "help", false, "Display usage information and exit.", false);
              versionOpt = argParser.addArgument("v", "version", false, "Display version information and exit.", false);
              httpProxyHostOpt = argParser.addArgument("n", "httpProxyHost", true, "HTTP proxy host.", false);
              httpProxyPortOpt = argParser.addArgument("o", "httpProxyPort", true, "HTTP proxy port.", false);
              maxThreadsOpt = argParser.addArgument("t", "maxThreads", true, "Maximum number of threads.", false);
              socketTimeoutOpt =
                  argParser.addArgument("c", "socketTimeout", true, "The socket timeout in milliseconds. 0 indicates no timeout. Default 50000.", false);
  
              // Parse command line arguments without failing on any missing required arguments by passing "false" as the second argument.
              argParser.parseArguments(args, false);
  
              // If help option was specified, then display usage information and return success.
              if (argParser.getBooleanValue(helpOpt))
              {
                  System.out.println(argParser.getUsageInformation());
                  return ReturnValue.SUCCESS;
              }
  
              // If version option was specified, then display version information and return success.
              if (argParser.getBooleanValue(versionOpt))
              {
                  BuildInformation buildInformation = applicationContext.getBean(BuildInformation.class);
                  System.out.println(String
                      .format(BUILD_INFO_STRING_FORMAT, buildInformation.getBuildDate(), buildInformation.getBuildNumber(), buildInformation.getBuildOs(),
                          buildInformation.getBuildUser()));
                  return ReturnValue.SUCCESS;
              }
  
              // Parse command line arguments for the second time, enforcing the required arguments by passing "true" as the second argument.
              argParser.parseArguments(args, true);
  
              // Extract boolean option values passing "false" as a default value.
              useSsl = argParser.getStringValueAsBoolean(sslOpt, false);
              trustSelfSignedCertificate = argParser.getStringValueAsBoolean(trustSelfSignedCertificateOpt, false);
              disableHostnameVerification = argParser.getStringValueAsBoolean(disableHostnameVerificationOpt, false);
  
              if (useSsl)
              {
                  // Username is required when useSsl is enabled.
                  if (StringUtils.isBlank(argParser.getStringValue(usernameOpt)))
                  {
                      throw new ParseException("Username is required when SSL is enabled.");
                  }
                  // Password or enableEnvVariables with corresponding env var is required when useSsl is enabled.
                  ToolsArgumentHelper.validateCliEnvArgument(argParser, passwordOpt, enableEnvVariablesOpt);
              }
  
              // Ensure that both the S3 secret and access keys were specified or both not specified.
              if (StringUtils.isNotBlank(argParser.getStringValue(s3SecretKeyOpt)) && StringUtils.isBlank(argParser.getStringValue(s3AccessKeyOpt)))
              {
                  throw new ParseException("S3 access key must be specified when S3 secret key is present.");
              }
              if (StringUtils.isNotBlank(argParser.getStringValue(s3AccessKeyOpt)) && StringUtils.isBlank(argParser.getStringValue(s3SecretKeyOpt)))
              {
                  throw new ParseException("S3 secret key must be specified when S3 access key is present.");
              }
  
              // Get the registration server host
              regServerHost = argParser.getStringValue(regServerHostOpt);
              if (StringUtils.isBlank(regServerHost))
              {
                  regServerHost = argParser.getStringValue(dmRegServerHostOpt);
                  if (StringUtils.isBlank(regServerHost))
                  {
                      throw new ParseException("A registration host must be specified.");
                  }
              }
              else
              {
                  if (StringUtils.isNotBlank(argParser.getStringValue(dmRegServerHostOpt)))
                  {
                      throw new ParseException("The regServerHost and the dmRegServerHost options can't both be specified.");
                  }
              }
  
              // Get the registration server port
              regServerPort = argParser.getIntegerValue(regServerPortOpt);
              if (regServerPort == null)
              {
                  regServerPort = argParser.getIntegerValue(dmRegServerPortOpt);
                  if (regServerPort == null)
                  {
                      throw new ParseException("A registration port must be specified.");
                  }
              }
              else
              {
                  if (argParser.getIntegerValue(dmRegServerPortOpt) != null)
                  {
                      throw new ParseException("The regServerPort and the dmRegServerPort options can't both be specified.");
                  }
              }
  
              // Extract all Integer option values here to catch any NumberFormatException exceptions.
              httpProxyPort = argParser.getIntegerValue(httpProxyPortOpt);
              maxThreads = argParser.getIntegerValue(maxThreadsOpt, ToolsCommonConstants.DEFAULT_THREADS);
          }
          catch (ParseException ex)
          {
              // Log a friendly error and return a failure which will cause the application to exit.
              LOGGER.error("Error parsing command line arguments: " + ex.getMessage() + "\n" + argParser.getUsageInformation());
              return ReturnValue.FAILURE;
          }
  
          // The command line arguments were all parsed successfully so return null to continue processing.
          return null;
      }
focal_method.class_method_signature: DataBridgeApp.parseCommandLineArguments(String[] args, ApplicationContext applicationContext)
focal_method.full_signature: @SuppressWarnings("PMD.SystemPrintln") @SuppressFBWarnings(value = "VA_FORMAT_STRING_USES_NEWLINE", justification = "We will use the standard carriage return character.") protected ReturnValue parseCommandLineArguments(String[] args, ApplicationContext applicationContext)
focal_method.identifier: parseCommandLineArguments
focal_method.invocations: getArgumentParser addArgument addArgument addArgument addArgument addArgument addArgument addArgument addArgument addArgument addArgument addArgument addArgument addArgument addArgument addArgument addArgument addArgument addArgument addArgument addArgument addArgument parseArguments getBooleanValue println getUsageInformation getBooleanValue getBean println format getBuildDate getBuildNumber getBuildOs getBuildUser parseArguments getStringValueAsBoolean getStringValueAsBoolean getStringValueAsBoolean isBlank getStringValue validateCliEnvArgument isNotBlank getStringValue isBlank getStringValue isNotBlank getStringValue isBlank getStringValue getStringValue isBlank getStringValue isBlank isNotBlank getStringValue getIntegerValue getIntegerValue getIntegerValue getIntegerValue getIntegerValue error getMessage getUsageInformation
focal_method.modifiers: @SuppressWarnings("PMD.SystemPrintln") @SuppressFBWarnings(value = "VA_FORMAT_STRING_USES_NEWLINE", justification = "We will use the standard carriage return character.") protected
focal_method.parameters: (String[] args, ApplicationContext applicationContext)
focal_method.return: ReturnValue
focal_method.signature: ReturnValue parseCommandLineArguments(String[] args, ApplicationContext applicationContext)