@Test(expected = IllegalArgumentException.class) public void testNoArguments() { ReferenceRegistrationHandler handler = getReferenceRegistrationHandler(); ApplicationOptions applicationOptions = new ApplicationOptions(); handler.parseAndVerifyArguments(Collections.emptyList(), applicationOptions); }
@Override public void parseAndVerifyArguments(List<String> arguments, ApplicationOptions options) { if (arguments.isEmpty() || arguments.size() != 1) { throw new IllegalArgumentException(MessageConstants.getMessage(ILLEGAL_COMMAND_ARGUMENTS, getCommand(), 1, arguments.size())); } referencePath = Utils.getNormalizeAndAbsolutePath(arguments.get(0)); if (options.getName() != null) { referenceName = options.getName(); } if (options.getGeneFile() != null) { try { geneFileId = loadFileByNameOrBioID(options.getGeneFile()).getId(); } catch (ApplicationException e) { LOGGER.debug(e.getMessage(), e); Pair<String, String> path = parseAndVerifyFilePath(options.getGeneFile()); geneFilePath = Utils.getNormalizeAndAbsolutePath(path.getLeft()); if (geneIndexPath != null) { geneIndexPath = Utils.getNormalizeAndAbsolutePath(path.getRight()); } } } printJson = options.isPrintJson(); printTable = options.isPrintTable(); noGCContent = options.isNoGCContent(); prettyName = options.getPrettyName(); speciesVersion = options.getSpeciesVersion(); }
ReferenceRegistrationHandler extends AbstractHTTPCommandHandler { @Override public void parseAndVerifyArguments(List<String> arguments, ApplicationOptions options) { if (arguments.isEmpty() || arguments.size() != 1) { throw new IllegalArgumentException(MessageConstants.getMessage(ILLEGAL_COMMAND_ARGUMENTS, getCommand(), 1, arguments.size())); } referencePath = Utils.getNormalizeAndAbsolutePath(arguments.get(0)); if (options.getName() != null) { referenceName = options.getName(); } if (options.getGeneFile() != null) { try { geneFileId = loadFileByNameOrBioID(options.getGeneFile()).getId(); } catch (ApplicationException e) { LOGGER.debug(e.getMessage(), e); Pair<String, String> path = parseAndVerifyFilePath(options.getGeneFile()); geneFilePath = Utils.getNormalizeAndAbsolutePath(path.getLeft()); if (geneIndexPath != null) { geneIndexPath = Utils.getNormalizeAndAbsolutePath(path.getRight()); } } } printJson = options.isPrintJson(); printTable = options.isPrintTable(); noGCContent = options.isNoGCContent(); prettyName = options.getPrettyName(); speciesVersion = options.getSpeciesVersion(); } }
ReferenceRegistrationHandler extends AbstractHTTPCommandHandler { @Override public void parseAndVerifyArguments(List<String> arguments, ApplicationOptions options) { if (arguments.isEmpty() || arguments.size() != 1) { throw new IllegalArgumentException(MessageConstants.getMessage(ILLEGAL_COMMAND_ARGUMENTS, getCommand(), 1, arguments.size())); } referencePath = Utils.getNormalizeAndAbsolutePath(arguments.get(0)); if (options.getName() != null) { referenceName = options.getName(); } if (options.getGeneFile() != null) { try { geneFileId = loadFileByNameOrBioID(options.getGeneFile()).getId(); } catch (ApplicationException e) { LOGGER.debug(e.getMessage(), e); Pair<String, String> path = parseAndVerifyFilePath(options.getGeneFile()); geneFilePath = Utils.getNormalizeAndAbsolutePath(path.getLeft()); if (geneIndexPath != null) { geneIndexPath = Utils.getNormalizeAndAbsolutePath(path.getRight()); } } } printJson = options.isPrintJson(); printTable = options.isPrintTable(); noGCContent = options.isNoGCContent(); prettyName = options.getPrettyName(); speciesVersion = options.getSpeciesVersion(); }  }
ReferenceRegistrationHandler extends AbstractHTTPCommandHandler { @Override public void parseAndVerifyArguments(List<String> arguments, ApplicationOptions options) { if (arguments.isEmpty() || arguments.size() != 1) { throw new IllegalArgumentException(MessageConstants.getMessage(ILLEGAL_COMMAND_ARGUMENTS, getCommand(), 1, arguments.size())); } referencePath = Utils.getNormalizeAndAbsolutePath(arguments.get(0)); if (options.getName() != null) { referenceName = options.getName(); } if (options.getGeneFile() != null) { try { geneFileId = loadFileByNameOrBioID(options.getGeneFile()).getId(); } catch (ApplicationException e) { LOGGER.debug(e.getMessage(), e); Pair<String, String> path = parseAndVerifyFilePath(options.getGeneFile()); geneFilePath = Utils.getNormalizeAndAbsolutePath(path.getLeft()); if (geneIndexPath != null) { geneIndexPath = Utils.getNormalizeAndAbsolutePath(path.getRight()); } } } printJson = options.isPrintJson(); printTable = options.isPrintTable(); noGCContent = options.isNoGCContent(); prettyName = options.getPrettyName(); speciesVersion = options.getSpeciesVersion(); }  @Override void parseAndVerifyArguments(List<String> arguments, ApplicationOptions options); @Override int runCommand(); }
ReferenceRegistrationHandler extends AbstractHTTPCommandHandler { @Override public void parseAndVerifyArguments(List<String> arguments, ApplicationOptions options) { if (arguments.isEmpty() || arguments.size() != 1) { throw new IllegalArgumentException(MessageConstants.getMessage(ILLEGAL_COMMAND_ARGUMENTS, getCommand(), 1, arguments.size())); } referencePath = Utils.getNormalizeAndAbsolutePath(arguments.get(0)); if (options.getName() != null) { referenceName = options.getName(); } if (options.getGeneFile() != null) { try { geneFileId = loadFileByNameOrBioID(options.getGeneFile()).getId(); } catch (ApplicationException e) { LOGGER.debug(e.getMessage(), e); Pair<String, String> path = parseAndVerifyFilePath(options.getGeneFile()); geneFilePath = Utils.getNormalizeAndAbsolutePath(path.getLeft()); if (geneIndexPath != null) { geneIndexPath = Utils.getNormalizeAndAbsolutePath(path.getRight()); } } } printJson = options.isPrintJson(); printTable = options.isPrintTable(); noGCContent = options.isNoGCContent(); prettyName = options.getPrettyName(); speciesVersion = options.getSpeciesVersion(); }  @Override void parseAndVerifyArguments(List<String> arguments, ApplicationOptions options); @Override int runCommand();  }