@Test(expected = IllegalArgumentException.class) public void shouldFailIfNoArguments() { SortHandler handler = getSortHandler(); final ApplicationOptions options = new ApplicationOptions(); handler.parseAndVerifyArguments(Collections.emptyList(), options); }
@Override public void parseAndVerifyArguments(List<String> arguments, ApplicationOptions options) { if (arguments.isEmpty()) { throw new IllegalArgumentException(MessageConstants.getMessage(MINIMUM_COMMAND_ARGUMENTS, getCommand(), 1, arguments.size())); } originalFilePath = arguments.get(0); if (arguments.size() > 1) { sortedFilePath = arguments.get(1); } maxMemory = options.getMaxMemory(); if (maxMemory < 0) { throw new IllegalArgumentException(MessageConstants.getMessage(MessageConstants.ERROR_NEGATIVE_MEMORY)); } BiologicalDataItemFormat format = BiologicalDataItemFormat.getByFilePath(originalFilePath); if (format != BiologicalDataItemFormat.VCF && format != BiologicalDataItemFormat.GENE && format != BiologicalDataItemFormat.BED) { throw new IllegalArgumentException( MessageConstants.getMessage(MessageConstants.ERROR_UNSUPPORTED_FORMAT, format.toString())); } }
SortHandler extends AbstractHTTPCommandHandler { @Override public void parseAndVerifyArguments(List<String> arguments, ApplicationOptions options) { if (arguments.isEmpty()) { throw new IllegalArgumentException(MessageConstants.getMessage(MINIMUM_COMMAND_ARGUMENTS, getCommand(), 1, arguments.size())); } originalFilePath = arguments.get(0); if (arguments.size() > 1) { sortedFilePath = arguments.get(1); } maxMemory = options.getMaxMemory(); if (maxMemory < 0) { throw new IllegalArgumentException(MessageConstants.getMessage(MessageConstants.ERROR_NEGATIVE_MEMORY)); } BiologicalDataItemFormat format = BiologicalDataItemFormat.getByFilePath(originalFilePath); if (format != BiologicalDataItemFormat.VCF && format != BiologicalDataItemFormat.GENE && format != BiologicalDataItemFormat.BED) { throw new IllegalArgumentException( MessageConstants.getMessage(MessageConstants.ERROR_UNSUPPORTED_FORMAT, format.toString())); } } }
SortHandler extends AbstractHTTPCommandHandler { @Override public void parseAndVerifyArguments(List<String> arguments, ApplicationOptions options) { if (arguments.isEmpty()) { throw new IllegalArgumentException(MessageConstants.getMessage(MINIMUM_COMMAND_ARGUMENTS, getCommand(), 1, arguments.size())); } originalFilePath = arguments.get(0); if (arguments.size() > 1) { sortedFilePath = arguments.get(1); } maxMemory = options.getMaxMemory(); if (maxMemory < 0) { throw new IllegalArgumentException(MessageConstants.getMessage(MessageConstants.ERROR_NEGATIVE_MEMORY)); } BiologicalDataItemFormat format = BiologicalDataItemFormat.getByFilePath(originalFilePath); if (format != BiologicalDataItemFormat.VCF && format != BiologicalDataItemFormat.GENE && format != BiologicalDataItemFormat.BED) { throw new IllegalArgumentException( MessageConstants.getMessage(MessageConstants.ERROR_UNSUPPORTED_FORMAT, format.toString())); } }  }
SortHandler extends AbstractHTTPCommandHandler { @Override public void parseAndVerifyArguments(List<String> arguments, ApplicationOptions options) { if (arguments.isEmpty()) { throw new IllegalArgumentException(MessageConstants.getMessage(MINIMUM_COMMAND_ARGUMENTS, getCommand(), 1, arguments.size())); } originalFilePath = arguments.get(0); if (arguments.size() > 1) { sortedFilePath = arguments.get(1); } maxMemory = options.getMaxMemory(); if (maxMemory < 0) { throw new IllegalArgumentException(MessageConstants.getMessage(MessageConstants.ERROR_NEGATIVE_MEMORY)); } BiologicalDataItemFormat format = BiologicalDataItemFormat.getByFilePath(originalFilePath); if (format != BiologicalDataItemFormat.VCF && format != BiologicalDataItemFormat.GENE && format != BiologicalDataItemFormat.BED) { throw new IllegalArgumentException( MessageConstants.getMessage(MessageConstants.ERROR_UNSUPPORTED_FORMAT, format.toString())); } }  @Override void parseAndVerifyArguments(List<String> arguments, ApplicationOptions options); @Override int runCommand(); }
SortHandler extends AbstractHTTPCommandHandler { @Override public void parseAndVerifyArguments(List<String> arguments, ApplicationOptions options) { if (arguments.isEmpty()) { throw new IllegalArgumentException(MessageConstants.getMessage(MINIMUM_COMMAND_ARGUMENTS, getCommand(), 1, arguments.size())); } originalFilePath = arguments.get(0); if (arguments.size() > 1) { sortedFilePath = arguments.get(1); } maxMemory = options.getMaxMemory(); if (maxMemory < 0) { throw new IllegalArgumentException(MessageConstants.getMessage(MessageConstants.ERROR_NEGATIVE_MEMORY)); } BiologicalDataItemFormat format = BiologicalDataItemFormat.getByFilePath(originalFilePath); if (format != BiologicalDataItemFormat.VCF && format != BiologicalDataItemFormat.GENE && format != BiologicalDataItemFormat.BED) { throw new IllegalArgumentException( MessageConstants.getMessage(MessageConstants.ERROR_UNSUPPORTED_FORMAT, format.toString())); } }  @Override void parseAndVerifyArguments(List<String> arguments, ApplicationOptions options); @Override int runCommand();  }