Cleanup: add support for non-public fields. Track matches as state of parsing engine as well as definitions.
Made fields of command-line argument system non-public by default. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@606 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
f5eae98af2
commit
98716138e9
|
|
@ -24,49 +24,49 @@ public class GenomeAnalysisTK extends CommandLineProgram {
|
||||||
|
|
||||||
// parameters and their defaults
|
// parameters and their defaults
|
||||||
@Argument(fullName="input_file",shortName="I",doc="SAM or BAM file(s)",required=false)
|
@Argument(fullName="input_file",shortName="I",doc="SAM or BAM file(s)",required=false)
|
||||||
public List<File> INPUT_FILES = null;
|
protected List<File> INPUT_FILES = null;
|
||||||
|
|
||||||
@Argument(fullName="maximum_reads",shortName="M",doc="Maximum number of reads to process before exiting",required=false)
|
@Argument(fullName="maximum_reads",shortName="M",doc="Maximum number of reads to process before exiting",required=false)
|
||||||
public String MAX_READS_ARG = "-1";
|
protected String MAX_READS_ARG = "-1";
|
||||||
|
|
||||||
@Argument(fullName="validation_strictness",shortName="S",doc="How strict should we be with validation (LENIENT|SILENT|STRICT)",required=false)
|
@Argument(fullName="validation_strictness",shortName="S",doc="How strict should we be with validation (LENIENT|SILENT|STRICT)",required=false)
|
||||||
public String STRICTNESS_ARG = "strict";
|
protected String STRICTNESS_ARG = "strict";
|
||||||
|
|
||||||
@Argument(fullName="reference_sequence", shortName="R",doc="Reference sequence file",required=false)
|
@Argument(fullName="reference_sequence", shortName="R",doc="Reference sequence file",required=false)
|
||||||
public File REF_FILE_ARG = null;
|
protected File REF_FILE_ARG = null;
|
||||||
|
|
||||||
@Argument(fullName="genome_region", shortName="L", doc="Genome region to operation on: from chr:start-end",required=false)
|
@Argument(fullName="genome_region", shortName="L", doc="Genome region to operation on: from chr:start-end",required=false)
|
||||||
public String REGION_STR = null;
|
protected String REGION_STR = null;
|
||||||
|
|
||||||
@Argument(fullName="analysis_type", shortName="T", doc="Type of analysis to run")
|
@Argument(fullName="analysis_type", shortName="T", doc="Type of analysis to run")
|
||||||
public String Analysis_Name = null;
|
protected String Analysis_Name = null;
|
||||||
|
|
||||||
@Argument(fullName="DBSNP",shortName="D",doc="DBSNP file",required=false)
|
@Argument(fullName="DBSNP",shortName="D",doc="DBSNP file",required=false)
|
||||||
public String DBSNP_FILE = null;
|
protected String DBSNP_FILE = null;
|
||||||
|
|
||||||
@Argument(fullName="hapmap",shortName="H",doc="Hapmap file",required=false)
|
@Argument(fullName="hapmap",shortName="H",doc="Hapmap file",required=false)
|
||||||
public String HAPMAP_FILE = null;
|
protected String HAPMAP_FILE = null;
|
||||||
|
|
||||||
@Argument(fullName="hapmap_chip",shortName="hc",doc="Hapmap chip file",required=false)
|
@Argument(fullName="hapmap_chip",shortName="hc",doc="Hapmap chip file",required=false)
|
||||||
public String HAPMAP_CHIP_FILE = null;
|
protected String HAPMAP_CHIP_FILE = null;
|
||||||
|
|
||||||
@Argument(fullName="threaded_IO",shortName="P",doc="If set, enables threaded I/O operations",required=false)
|
@Argument(fullName="threaded_IO",shortName="P",doc="If set, enables threaded I/O operations",required=false)
|
||||||
public Boolean ENABLED_THREADED_IO = false;
|
protected Boolean ENABLED_THREADED_IO = false;
|
||||||
|
|
||||||
@Argument(fullName="unsafe",shortName="U",doc="If set, enables unsafe operations, nothing will be checked at runtime.",required=false)
|
@Argument(fullName="unsafe",shortName="U",doc="If set, enables unsafe operations, nothing will be checked at runtime.",required=false)
|
||||||
public Boolean UNSAFE = false;
|
protected Boolean UNSAFE = false;
|
||||||
|
|
||||||
@Argument(fullName="sort_on_the_fly",shortName="sort",doc="Maximum number of reads to sort on the fly",required=false)
|
@Argument(fullName="sort_on_the_fly",shortName="sort",doc="Maximum number of reads to sort on the fly",required=false)
|
||||||
public String MAX_ON_FLY_SORTS = null;
|
protected String MAX_ON_FLY_SORTS = null;
|
||||||
|
|
||||||
@Argument(fullName="downsample_to_fraction",shortName="dfrac",doc="Fraction [0.0-1.0] of reads to downsample to",required=false)
|
@Argument(fullName="downsample_to_fraction",shortName="dfrac",doc="Fraction [0.0-1.0] of reads to downsample to",required=false)
|
||||||
public String DOWNSAMPLE_FRACTION = null;
|
protected String DOWNSAMPLE_FRACTION = null;
|
||||||
|
|
||||||
@Argument(fullName="downsample_to_coverage",shortName="dcov",doc="Coverage [integer] to downsample to",required=false)
|
@Argument(fullName="downsample_to_coverage",shortName="dcov",doc="Coverage [integer] to downsample to",required=false)
|
||||||
public String DOWNSAMPLE_COVERAGE = null;
|
protected String DOWNSAMPLE_COVERAGE = null;
|
||||||
|
|
||||||
@Argument(fullName="intervals_file",shortName="V",doc="File containing list of genomic intervals to operate on. line := <contig> <start> <end>",required=false)
|
@Argument(fullName="intervals_file",shortName="V",doc="File containing list of genomic intervals to operate on. line := <contig> <start> <end>",required=false)
|
||||||
public String INTERVALS_FILE = null;
|
protected String INTERVALS_FILE = null;
|
||||||
|
|
||||||
// our walker manager
|
// our walker manager
|
||||||
private WalkerManager walkerManager = null;
|
private WalkerManager walkerManager = null;
|
||||||
|
|
@ -76,34 +76,34 @@ public class GenomeAnalysisTK extends CommandLineProgram {
|
||||||
public boolean DEBUGGING = false;
|
public boolean DEBUGGING = false;
|
||||||
|
|
||||||
@Argument(fullName="all_loci",shortName="A",doc="Should we process all loci, not just those covered by reads",required=false)
|
@Argument(fullName="all_loci",shortName="A",doc="Should we process all loci, not just those covered by reads",required=false)
|
||||||
public Boolean WALK_ALL_LOCI = false;
|
protected Boolean WALK_ALL_LOCI = false;
|
||||||
|
|
||||||
@Argument(fullName="disablethreading",shortName="dt",doc="Disable experimental threading support.",required=false)
|
@Argument(fullName="disablethreading",shortName="dt",doc="Disable experimental threading support.",required=false)
|
||||||
public Boolean DISABLE_THREADING = false;
|
protected Boolean DISABLE_THREADING = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An output file presented to the walker.
|
* An output file presented to the walker.
|
||||||
*/
|
*/
|
||||||
@Argument(fullName="out",shortName="o",doc="An output file presented to the walker. Will overwrite contents if file exists.",required=false)
|
@Argument(fullName="out",shortName="o",doc="An output file presented to the walker. Will overwrite contents if file exists.",required=false)
|
||||||
public String outFileName = null;
|
protected String outFileName = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An error output file presented to the walker.
|
* An error output file presented to the walker.
|
||||||
*/
|
*/
|
||||||
@Argument(fullName="err",shortName="e",doc="An error output file presented to the walker. Will overwrite contents if file exists.",required=false)
|
@Argument(fullName="err",shortName="e",doc="An error output file presented to the walker. Will overwrite contents if file exists.",required=false)
|
||||||
public String errFileName = null;
|
protected String errFileName = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A joint file for both 'normal' and error output presented to the walker.
|
* A joint file for both 'normal' and error output presented to the walker.
|
||||||
*/
|
*/
|
||||||
@Argument(fullName="outerr",shortName="oe",doc="A joint file for 'normal' and error output presented to the walker. Will overwrite contents if file exists.",required=false)
|
@Argument(fullName="outerr",shortName="oe",doc="A joint file for 'normal' and error output presented to the walker. Will overwrite contents if file exists.",required=false)
|
||||||
public String outErrFileName = null;
|
protected String outErrFileName = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* How many threads should be allocated to this analysis.
|
* How many threads should be allocated to this analysis.
|
||||||
*/
|
*/
|
||||||
@Argument(fullName="numthreads",shortName="nt",doc="How many threads should be allocated to running this analysis.",required=false)
|
@Argument(fullName="numthreads",shortName="nt",doc="How many threads should be allocated to running this analysis.",required=false)
|
||||||
public int numThreads = 1;
|
protected int numThreads = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Collection of output streams used by the walker.
|
* Collection of output streams used by the walker.
|
||||||
|
|
@ -116,7 +116,7 @@ public class GenomeAnalysisTK extends CommandLineProgram {
|
||||||
private static Logger logger = Logger.getLogger(GenomeAnalysisTK.class);
|
private static Logger logger = Logger.getLogger(GenomeAnalysisTK.class);
|
||||||
|
|
||||||
@Argument(fullName="rodBind",shortName="B",doc="",required=false)
|
@Argument(fullName="rodBind",shortName="B",doc="",required=false)
|
||||||
public static ArrayList<String> ROD_BINDINGS = new ArrayList<String>();
|
protected static ArrayList<String> ROD_BINDINGS = new ArrayList<String>();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@ public abstract class CommandLineProgram {
|
||||||
* The command-line program and the arguments it returned.
|
* The command-line program and the arguments it returned.
|
||||||
*/
|
*/
|
||||||
private ParsingEngine parser = null;
|
private ParsingEngine parser = null;
|
||||||
private ArgumentMatches parameters = null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* our log, which we want to capture anything from org.broadinstitute.sting
|
* our log, which we want to capture anything from org.broadinstitute.sting
|
||||||
|
|
@ -44,7 +43,7 @@ public abstract class CommandLineProgram {
|
||||||
shortName="l",
|
shortName="l",
|
||||||
doc="Set the minimum level of logging, i.e. setting INFO get's you INFO up to FATAL, setting ERROR gets you ERROR and FATAL level logging. (DEBUG, INFO, WARN, ERROR, FATAL, OFF). ",
|
doc="Set the minimum level of logging, i.e. setting INFO get's you INFO up to FATAL, setting ERROR gets you ERROR and FATAL level logging. (DEBUG, INFO, WARN, ERROR, FATAL, OFF). ",
|
||||||
required=false)
|
required=false)
|
||||||
public String logging_level = "ERROR";
|
protected String logging_level = "ERROR";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -54,7 +53,7 @@ public abstract class CommandLineProgram {
|
||||||
shortName="log",
|
shortName="log",
|
||||||
doc="Set the logging location",
|
doc="Set the logging location",
|
||||||
required=false)
|
required=false)
|
||||||
public String toFile = null;
|
protected String toFile = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* do we want to silence the command line output
|
* do we want to silence the command line output
|
||||||
|
|
@ -63,7 +62,7 @@ public abstract class CommandLineProgram {
|
||||||
shortName="quiet",
|
shortName="quiet",
|
||||||
doc="Set the logging to quiet mode, no output to stdout",
|
doc="Set the logging to quiet mode, no output to stdout",
|
||||||
required=false)
|
required=false)
|
||||||
public Boolean quietMode = false;
|
protected Boolean quietMode = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* do we want to generate debugging information with the logs
|
* do we want to generate debugging information with the logs
|
||||||
|
|
@ -72,7 +71,7 @@ public abstract class CommandLineProgram {
|
||||||
shortName="debug",
|
shortName="debug",
|
||||||
doc="Set the logging file string to include a lot of debugging information (SLOW!)",
|
doc="Set the logging file string to include a lot of debugging information (SLOW!)",
|
||||||
required=false)
|
required=false)
|
||||||
public Boolean debugMode = false;
|
protected Boolean debugMode = false;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -135,23 +134,24 @@ public abstract class CommandLineProgram {
|
||||||
|
|
||||||
// setup the parser
|
// setup the parser
|
||||||
ParsingEngine parser = clp.parser = new ParsingEngine();
|
ParsingEngine parser = clp.parser = new ParsingEngine();
|
||||||
parser.addArgumentSources( clp.getClass() );
|
parser.addArgumentSource( clp.getClass() );
|
||||||
|
|
||||||
// process the args
|
// process the args
|
||||||
if( clp.canAddArgumentsDynamically() ) {
|
if( clp.canAddArgumentsDynamically() ) {
|
||||||
// if the command-line program can toss in extra args, fetch them and reparse the arguments.
|
// if the command-line program can toss in extra args, fetch them and reparse the arguments.
|
||||||
clp.parameters = parser.parse(args);
|
parser.parse(args);
|
||||||
parser.validate( clp.parameters, EnumSet.of(ParsingEngine.ValidationType.InvalidArgument) );
|
parser.validate( EnumSet.of(ParsingEngine.ValidationType.InvalidArgument) );
|
||||||
parser.loadArgumentsIntoObject( clp, clp.parameters );
|
parser.loadArgumentsIntoObject( clp );
|
||||||
|
|
||||||
Class[] argumentSources = clp.getArgumentSources();
|
Class[] argumentSources = clp.getArgumentSources();
|
||||||
parser.addArgumentSources( argumentSources );
|
for( Class argumentSource: argumentSources )
|
||||||
clp.parameters = parser.parse(args);
|
parser.addArgumentSource( argumentSource );
|
||||||
parser.validate( clp.parameters );
|
parser.parse(args);
|
||||||
|
parser.validate();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
clp.parameters = parser.parse(args);
|
parser.parse(args);
|
||||||
parser.validate( clp.parameters );
|
parser.validate();
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we're in debug mode, set the mode up
|
// if we're in debug mode, set the mode up
|
||||||
|
|
@ -224,7 +224,7 @@ public abstract class CommandLineProgram {
|
||||||
* @param obj Object to inspect for command line arguments.
|
* @param obj Object to inspect for command line arguments.
|
||||||
*/
|
*/
|
||||||
public void loadArgumentsIntoObject( Object obj ) {
|
public void loadArgumentsIntoObject( Object obj ) {
|
||||||
parser.loadArgumentsIntoObject( obj, parameters );
|
parser.loadArgumentsIntoObject( obj );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,13 @@ public class ParsingEngine {
|
||||||
*/
|
*/
|
||||||
ArgumentDefinitions argumentDefinitions = new ArgumentDefinitions();
|
ArgumentDefinitions argumentDefinitions = new ArgumentDefinitions();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A list of matches from defined arguments to command-line text.
|
||||||
|
* Indicates as best as possible where command-line text remains unmatched
|
||||||
|
* to existing arguments.
|
||||||
|
*/
|
||||||
|
ArgumentMatches argumentMatches = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Techniques for parsing and for argument lookup.
|
* Techniques for parsing and for argument lookup.
|
||||||
*/
|
*/
|
||||||
|
|
@ -61,18 +68,19 @@ public class ParsingEngine {
|
||||||
/**
|
/**
|
||||||
* Add an argument source. Argument sources are expected to have
|
* Add an argument source. Argument sources are expected to have
|
||||||
* any number of fields with an @Argument annotation attached.
|
* any number of fields with an @Argument annotation attached.
|
||||||
* @param sources A list of argument sources from which to extract
|
* @param source An argument source from which to extract
|
||||||
* command-line arguments.
|
* command-line arguments.
|
||||||
*/
|
*/
|
||||||
public void addArgumentSources( Class... sources ) {
|
public void addArgumentSource( Class source ) {
|
||||||
for( Class source: sources ) {
|
do {
|
||||||
Field[] fields = source.getFields();
|
Field[] fields = source.getDeclaredFields();
|
||||||
for( Field field: fields ) {
|
for( Field field: fields ) {
|
||||||
Argument argument = field.getAnnotation(Argument.class);
|
Argument argument = field.getAnnotation(Argument.class);
|
||||||
if(argument != null)
|
if(argument != null)
|
||||||
argumentDefinitions.add( argument, source, field );
|
argumentDefinitions.add( argument, source, field );
|
||||||
}
|
}
|
||||||
}
|
source = source.getSuperclass();
|
||||||
|
} while( source != null );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -84,10 +92,9 @@ public class ParsingEngine {
|
||||||
* @return A object indicating which matches are best. Might return
|
* @return A object indicating which matches are best. Might return
|
||||||
* an empty object, but will never return null.
|
* an empty object, but will never return null.
|
||||||
*/
|
*/
|
||||||
public ArgumentMatches parse( String[] tokens ) {
|
public void parse( String[] tokens ) {
|
||||||
ArgumentMatches argumentMatches = parseArguments( tokens );
|
argumentMatches = parseArguments( tokens );
|
||||||
fitValuesToArguments( argumentMatches, tokens );
|
fitValuesToArguments( argumentMatches, tokens );
|
||||||
return argumentMatches;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ValidationType { MissingRequiredArgument,
|
public enum ValidationType { MissingRequiredArgument,
|
||||||
|
|
@ -97,19 +104,17 @@ public class ParsingEngine {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validates the list of command-line argument matches.
|
* Validates the list of command-line argument matches.
|
||||||
* @param argumentMatches Matches to validate.
|
|
||||||
*/
|
*/
|
||||||
public void validate( ArgumentMatches argumentMatches ) {
|
public void validate() {
|
||||||
validate( argumentMatches, EnumSet.noneOf(ValidationType.class) );
|
validate( EnumSet.noneOf(ValidationType.class) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validates the list of command-line argument matches. On failure throws an exception with detailed info about the
|
* Validates the list of command-line argument matches. On failure throws an exception with detailed info about the
|
||||||
* particular failures. Takes an EnumSet indicating which validation checks to skip.
|
* particular failures. Takes an EnumSet indicating which validation checks to skip.
|
||||||
* @param argumentMatches Matches to validate.
|
|
||||||
* @param skipValidationOf List of validation checks to skip.
|
* @param skipValidationOf List of validation checks to skip.
|
||||||
*/
|
*/
|
||||||
public void validate( ArgumentMatches argumentMatches, EnumSet<ValidationType> skipValidationOf ) {
|
public void validate( EnumSet<ValidationType> skipValidationOf ) {
|
||||||
// Find missing required arguments.
|
// Find missing required arguments.
|
||||||
if( !skipValidationOf.contains(ValidationType.MissingRequiredArgument) ) {
|
if( !skipValidationOf.contains(ValidationType.MissingRequiredArgument) ) {
|
||||||
Collection<ArgumentDefinition> requiredArguments =
|
Collection<ArgumentDefinition> requiredArguments =
|
||||||
|
|
@ -156,10 +161,9 @@ public class ParsingEngine {
|
||||||
/**
|
/**
|
||||||
* Loads a set of matched command-line arguments into the given object.
|
* Loads a set of matched command-line arguments into the given object.
|
||||||
* @param object Object into which to add arguments.
|
* @param object Object into which to add arguments.
|
||||||
* @param matches List of matches.
|
|
||||||
*/
|
*/
|
||||||
public void loadArgumentsIntoObject( Object object, ArgumentMatches matches ) {
|
public void loadArgumentsIntoObject( Object object ) {
|
||||||
for( ArgumentMatch match: matches ) {
|
for( ArgumentMatch match: argumentMatches ) {
|
||||||
ArgumentDefinition definition = match.definition;
|
ArgumentDefinition definition = match.definition;
|
||||||
|
|
||||||
// A null definition might be in the list if some invalid arguments were passed in but we
|
// A null definition might be in the list if some invalid arguments were passed in but we
|
||||||
|
|
@ -167,8 +171,9 @@ public class ParsingEngine {
|
||||||
if( definition == null )
|
if( definition == null )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( object.getClass().equals(definition.sourceClass) ) {
|
if( definition.sourceClass.isAssignableFrom(object.getClass()) ) {
|
||||||
try {
|
try {
|
||||||
|
definition.sourceField.setAccessible(true);
|
||||||
if( !isArgumentFlag(definition) )
|
if( !isArgumentFlag(definition) )
|
||||||
definition.sourceField.set( object, constructFromString( definition.sourceField, match.values() ) );
|
definition.sourceField.set( object, constructFromString( definition.sourceField, match.values() ) );
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -42,12 +42,12 @@ public class ParsingEngineTest extends BaseTest {
|
||||||
public void shortNameArgumentTest() {
|
public void shortNameArgumentTest() {
|
||||||
final String[] commandLine = new String[] {"-I","na12878.bam"};
|
final String[] commandLine = new String[] {"-I","na12878.bam"};
|
||||||
|
|
||||||
parsingEngine.addArgumentSources( InputFileArgProvider.class );
|
parsingEngine.addArgumentSource( InputFileArgProvider.class );
|
||||||
ArgumentMatches argumentMatches = parsingEngine.parse( commandLine );
|
parsingEngine.parse( commandLine );
|
||||||
parsingEngine.validate(argumentMatches);
|
parsingEngine.validate();
|
||||||
|
|
||||||
InputFileArgProvider argProvider = new InputFileArgProvider();
|
InputFileArgProvider argProvider = new InputFileArgProvider();
|
||||||
parsingEngine.loadArgumentsIntoObject( argProvider, argumentMatches);
|
parsingEngine.loadArgumentsIntoObject( argProvider );
|
||||||
|
|
||||||
Assert.assertEquals("Argument is not correctly initialized", "na12878.bam", argProvider.inputFile );
|
Assert.assertEquals("Argument is not correctly initialized", "na12878.bam", argProvider.inputFile );
|
||||||
}
|
}
|
||||||
|
|
@ -56,12 +56,12 @@ public class ParsingEngineTest extends BaseTest {
|
||||||
public void shortNameCompositeArgumentTest() {
|
public void shortNameCompositeArgumentTest() {
|
||||||
final String[] commandLine = new String[] {"-Ina12878.bam"};
|
final String[] commandLine = new String[] {"-Ina12878.bam"};
|
||||||
|
|
||||||
parsingEngine.addArgumentSources( InputFileArgProvider.class );
|
parsingEngine.addArgumentSource( InputFileArgProvider.class );
|
||||||
ArgumentMatches argumentMatches = parsingEngine.parse( commandLine );
|
parsingEngine.parse( commandLine );
|
||||||
parsingEngine.validate(argumentMatches);
|
parsingEngine.validate();
|
||||||
|
|
||||||
InputFileArgProvider argProvider = new InputFileArgProvider();
|
InputFileArgProvider argProvider = new InputFileArgProvider();
|
||||||
parsingEngine.loadArgumentsIntoObject( argProvider, argumentMatches);
|
parsingEngine.loadArgumentsIntoObject( argProvider );
|
||||||
|
|
||||||
Assert.assertEquals("Argument is not correctly initialized", "na12878.bam", argProvider.inputFile );
|
Assert.assertEquals("Argument is not correctly initialized", "na12878.bam", argProvider.inputFile );
|
||||||
}
|
}
|
||||||
|
|
@ -70,12 +70,12 @@ public class ParsingEngineTest extends BaseTest {
|
||||||
public void multiCharShortNameArgumentTest() {
|
public void multiCharShortNameArgumentTest() {
|
||||||
final String[] commandLine = new String[] {"-out","out.txt"};
|
final String[] commandLine = new String[] {"-out","out.txt"};
|
||||||
|
|
||||||
parsingEngine.addArgumentSources( MultiCharShortNameArgProvider.class );
|
parsingEngine.addArgumentSource( MultiCharShortNameArgProvider.class );
|
||||||
ArgumentMatches argumentMatches = parsingEngine.parse( commandLine );
|
parsingEngine.parse( commandLine );
|
||||||
parsingEngine.validate(argumentMatches);
|
parsingEngine.validate();
|
||||||
|
|
||||||
MultiCharShortNameArgProvider argProvider = new MultiCharShortNameArgProvider();
|
MultiCharShortNameArgProvider argProvider = new MultiCharShortNameArgProvider();
|
||||||
parsingEngine.loadArgumentsIntoObject( argProvider, argumentMatches);
|
parsingEngine.loadArgumentsIntoObject( argProvider );
|
||||||
|
|
||||||
Assert.assertEquals("Argument is not correctly initialized", "out.txt", argProvider.outputFile );
|
Assert.assertEquals("Argument is not correctly initialized", "out.txt", argProvider.outputFile );
|
||||||
}
|
}
|
||||||
|
|
@ -90,12 +90,12 @@ public class ParsingEngineTest extends BaseTest {
|
||||||
public void longNameArgumentTest() {
|
public void longNameArgumentTest() {
|
||||||
final String[] commandLine = new String[] {"--input_file", "na12878.bam"};
|
final String[] commandLine = new String[] {"--input_file", "na12878.bam"};
|
||||||
|
|
||||||
parsingEngine.addArgumentSources( InputFileArgProvider.class );
|
parsingEngine.addArgumentSource( InputFileArgProvider.class );
|
||||||
ArgumentMatches argumentMatches = parsingEngine.parse( commandLine );
|
parsingEngine.parse( commandLine );
|
||||||
parsingEngine.validate(argumentMatches);
|
parsingEngine.validate();
|
||||||
|
|
||||||
InputFileArgProvider argProvider = new InputFileArgProvider();
|
InputFileArgProvider argProvider = new InputFileArgProvider();
|
||||||
parsingEngine.loadArgumentsIntoObject( argProvider, argumentMatches);
|
parsingEngine.loadArgumentsIntoObject( argProvider );
|
||||||
|
|
||||||
Assert.assertEquals("Argument is not correctly initialized", "na12878.bam", argProvider.inputFile );
|
Assert.assertEquals("Argument is not correctly initialized", "na12878.bam", argProvider.inputFile );
|
||||||
}
|
}
|
||||||
|
|
@ -104,12 +104,12 @@ public class ParsingEngineTest extends BaseTest {
|
||||||
public void extraWhitespaceTest() {
|
public void extraWhitespaceTest() {
|
||||||
final String[] commandLine = new String[] {" --input_file ", "na12878.bam"};
|
final String[] commandLine = new String[] {" --input_file ", "na12878.bam"};
|
||||||
|
|
||||||
parsingEngine.addArgumentSources( InputFileArgProvider.class );
|
parsingEngine.addArgumentSource( InputFileArgProvider.class );
|
||||||
ArgumentMatches argumentMatches = parsingEngine.parse( commandLine );
|
parsingEngine.parse( commandLine );
|
||||||
parsingEngine.validate(argumentMatches);
|
parsingEngine.validate();
|
||||||
|
|
||||||
InputFileArgProvider argProvider = new InputFileArgProvider();
|
InputFileArgProvider argProvider = new InputFileArgProvider();
|
||||||
parsingEngine.loadArgumentsIntoObject( argProvider, argumentMatches);
|
parsingEngine.loadArgumentsIntoObject( argProvider );
|
||||||
|
|
||||||
Assert.assertEquals("Argument is not correctly initialized", "na12878.bam", argProvider.inputFile );
|
Assert.assertEquals("Argument is not correctly initialized", "na12878.bam", argProvider.inputFile );
|
||||||
}
|
}
|
||||||
|
|
@ -118,12 +118,12 @@ public class ParsingEngineTest extends BaseTest {
|
||||||
public void flagTest() {
|
public void flagTest() {
|
||||||
final String[] commandLine = new String[] {"--all_loci"};
|
final String[] commandLine = new String[] {"--all_loci"};
|
||||||
|
|
||||||
parsingEngine.addArgumentSources( AllLociArgProvider.class );
|
parsingEngine.addArgumentSource( AllLociArgProvider.class );
|
||||||
ArgumentMatches argumentMatches = parsingEngine.parse( commandLine );
|
parsingEngine.parse( commandLine );
|
||||||
parsingEngine.validate(argumentMatches);
|
parsingEngine.validate();
|
||||||
|
|
||||||
AllLociArgProvider argProvider = new AllLociArgProvider();
|
AllLociArgProvider argProvider = new AllLociArgProvider();
|
||||||
parsingEngine.loadArgumentsIntoObject( argProvider, argumentMatches);
|
parsingEngine.loadArgumentsIntoObject( argProvider );
|
||||||
|
|
||||||
Assert.assertTrue("Argument is not correctly initialized", argProvider.allLoci );
|
Assert.assertTrue("Argument is not correctly initialized", argProvider.allLoci );
|
||||||
}
|
}
|
||||||
|
|
@ -137,12 +137,12 @@ public class ParsingEngineTest extends BaseTest {
|
||||||
public void arrayTest() {
|
public void arrayTest() {
|
||||||
final String[] commandLine = new String[] {"-Ifoo.txt", "--input_file", "bar.txt"};
|
final String[] commandLine = new String[] {"-Ifoo.txt", "--input_file", "bar.txt"};
|
||||||
|
|
||||||
parsingEngine.addArgumentSources( MultiValueArgProvider.class );
|
parsingEngine.addArgumentSource( MultiValueArgProvider.class );
|
||||||
ArgumentMatches argumentMatches = parsingEngine.parse( commandLine );
|
parsingEngine.parse( commandLine );
|
||||||
parsingEngine.validate(argumentMatches);
|
parsingEngine.validate();
|
||||||
|
|
||||||
MultiValueArgProvider argProvider = new MultiValueArgProvider();
|
MultiValueArgProvider argProvider = new MultiValueArgProvider();
|
||||||
parsingEngine.loadArgumentsIntoObject( argProvider, argumentMatches);
|
parsingEngine.loadArgumentsIntoObject( argProvider );
|
||||||
|
|
||||||
Assert.assertEquals("Argument array is of incorrect length", 2, argProvider.inputFile.length);
|
Assert.assertEquals("Argument array is of incorrect length", 2, argProvider.inputFile.length);
|
||||||
Assert.assertEquals("1st filename is incorrect", "foo.txt", argProvider.inputFile[0] );
|
Assert.assertEquals("1st filename is incorrect", "foo.txt", argProvider.inputFile[0] );
|
||||||
|
|
@ -158,12 +158,12 @@ public class ParsingEngineTest extends BaseTest {
|
||||||
public void typedCollectionTest() {
|
public void typedCollectionTest() {
|
||||||
final String[] commandLine = new String[] { "-N2", "-N4", "-N6", "-N8", "-N10" };
|
final String[] commandLine = new String[] { "-N2", "-N4", "-N6", "-N8", "-N10" };
|
||||||
|
|
||||||
parsingEngine.addArgumentSources( IntegerListArgProvider.class );
|
parsingEngine.addArgumentSource( IntegerListArgProvider.class );
|
||||||
ArgumentMatches argumentMatches = parsingEngine.parse( commandLine );
|
parsingEngine.parse( commandLine );
|
||||||
parsingEngine.validate(argumentMatches);
|
parsingEngine.validate();
|
||||||
|
|
||||||
IntegerListArgProvider argProvider = new IntegerListArgProvider();
|
IntegerListArgProvider argProvider = new IntegerListArgProvider();
|
||||||
parsingEngine.loadArgumentsIntoObject( argProvider, argumentMatches);
|
parsingEngine.loadArgumentsIntoObject( argProvider );
|
||||||
|
|
||||||
Assert.assertNotNull("Argument array is null",argProvider.integers);
|
Assert.assertNotNull("Argument array is null",argProvider.integers);
|
||||||
Assert.assertEquals("Argument array is of incorrect length", 5, argProvider.integers.size());
|
Assert.assertEquals("Argument array is of incorrect length", 5, argProvider.integers.size());
|
||||||
|
|
@ -183,12 +183,12 @@ public class ParsingEngineTest extends BaseTest {
|
||||||
public void untypedCollectionTest() {
|
public void untypedCollectionTest() {
|
||||||
final String[] commandLine = new String[] { "-N2", "-N4", "-N6", "-N8", "-N10" };
|
final String[] commandLine = new String[] { "-N2", "-N4", "-N6", "-N8", "-N10" };
|
||||||
|
|
||||||
parsingEngine.addArgumentSources( UntypedListArgProvider.class );
|
parsingEngine.addArgumentSource( UntypedListArgProvider.class );
|
||||||
ArgumentMatches argumentMatches = parsingEngine.parse( commandLine );
|
parsingEngine.parse( commandLine );
|
||||||
parsingEngine.validate(argumentMatches);
|
parsingEngine.validate();
|
||||||
|
|
||||||
UntypedListArgProvider argProvider = new UntypedListArgProvider();
|
UntypedListArgProvider argProvider = new UntypedListArgProvider();
|
||||||
parsingEngine.loadArgumentsIntoObject( argProvider, argumentMatches);
|
parsingEngine.loadArgumentsIntoObject( argProvider );
|
||||||
|
|
||||||
Assert.assertNotNull("Argument array is null",argProvider.integers);
|
Assert.assertNotNull("Argument array is null",argProvider.integers);
|
||||||
Assert.assertEquals("Argument array is of incorrect length", 5, argProvider.integers.size());
|
Assert.assertEquals("Argument array is of incorrect length", 5, argProvider.integers.size());
|
||||||
|
|
@ -208,9 +208,9 @@ public class ParsingEngineTest extends BaseTest {
|
||||||
public void requiredArgTest() {
|
public void requiredArgTest() {
|
||||||
final String[] commandLine = new String[0];
|
final String[] commandLine = new String[0];
|
||||||
|
|
||||||
parsingEngine.addArgumentSources( RequiredArgProvider.class );
|
parsingEngine.addArgumentSource( RequiredArgProvider.class );
|
||||||
ArgumentMatches argumentMatches = parsingEngine.parse( commandLine );
|
parsingEngine.parse( commandLine );
|
||||||
parsingEngine.validate( argumentMatches );
|
parsingEngine.validate();
|
||||||
}
|
}
|
||||||
|
|
||||||
private class RequiredArgProvider {
|
private class RequiredArgProvider {
|
||||||
|
|
@ -222,12 +222,12 @@ public class ParsingEngineTest extends BaseTest {
|
||||||
public void disableValidationOfRequiredArgTest() {
|
public void disableValidationOfRequiredArgTest() {
|
||||||
final String[] commandLine = new String[0];
|
final String[] commandLine = new String[0];
|
||||||
|
|
||||||
parsingEngine.addArgumentSources( RequiredArgProvider.class );
|
parsingEngine.addArgumentSource( RequiredArgProvider.class );
|
||||||
ArgumentMatches argumentMatches = parsingEngine.parse( commandLine );
|
parsingEngine.parse( commandLine );
|
||||||
parsingEngine.validate( argumentMatches, EnumSet.of(ParsingEngine.ValidationType.MissingRequiredArgument) );
|
parsingEngine.validate( EnumSet.of(ParsingEngine.ValidationType.MissingRequiredArgument) );
|
||||||
|
|
||||||
RequiredArgProvider argProvider = new RequiredArgProvider();
|
RequiredArgProvider argProvider = new RequiredArgProvider();
|
||||||
parsingEngine.loadArgumentsIntoObject(argProvider, argumentMatches);
|
parsingEngine.loadArgumentsIntoObject(argProvider );
|
||||||
|
|
||||||
Assert.assertNull("Value should have remain unset",argProvider.value);
|
Assert.assertNull("Value should have remain unset",argProvider.value);
|
||||||
}
|
}
|
||||||
|
|
@ -236,12 +236,12 @@ public class ParsingEngineTest extends BaseTest {
|
||||||
public void unrequiredArgTest() {
|
public void unrequiredArgTest() {
|
||||||
final String[] commandLine = new String[0];
|
final String[] commandLine = new String[0];
|
||||||
|
|
||||||
parsingEngine.addArgumentSources( UnrequiredArgProvider.class );
|
parsingEngine.addArgumentSource( UnrequiredArgProvider.class );
|
||||||
ArgumentMatches argumentMatches = parsingEngine.parse( commandLine );
|
parsingEngine.parse( commandLine );
|
||||||
parsingEngine.validate( argumentMatches );
|
parsingEngine.validate();
|
||||||
|
|
||||||
UnrequiredArgProvider argProvider = new UnrequiredArgProvider();
|
UnrequiredArgProvider argProvider = new UnrequiredArgProvider();
|
||||||
parsingEngine.loadArgumentsIntoObject( argProvider, argumentMatches);
|
parsingEngine.loadArgumentsIntoObject( argProvider );
|
||||||
|
|
||||||
Assert.assertNull( "Value was unrequired and unspecified; contents should be null", argProvider.value );
|
Assert.assertNull( "Value was unrequired and unspecified; contents should be null", argProvider.value );
|
||||||
}
|
}
|
||||||
|
|
@ -255,14 +255,14 @@ public class ParsingEngineTest extends BaseTest {
|
||||||
public void invalidArgTest() {
|
public void invalidArgTest() {
|
||||||
final String[] commandLine = new String[] { "--foo" };
|
final String[] commandLine = new String[] { "--foo" };
|
||||||
|
|
||||||
parsingEngine.addArgumentSources( UnrequiredArgProvider.class );
|
parsingEngine.addArgumentSource( UnrequiredArgProvider.class );
|
||||||
ArgumentMatches argumentMatches = parsingEngine.parse( commandLine );
|
parsingEngine.parse( commandLine );
|
||||||
parsingEngine.validate( argumentMatches );
|
parsingEngine.validate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected=StingException.class)
|
@Test(expected=StingException.class)
|
||||||
public void duplicateLongNameTest() {
|
public void duplicateLongNameTest() {
|
||||||
parsingEngine.addArgumentSources( DuplicateLongNameProvider.class );
|
parsingEngine.addArgumentSource( DuplicateLongNameProvider.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
private class DuplicateLongNameProvider {
|
private class DuplicateLongNameProvider {
|
||||||
|
|
@ -275,7 +275,7 @@ public class ParsingEngineTest extends BaseTest {
|
||||||
|
|
||||||
@Test(expected=StingException.class)
|
@Test(expected=StingException.class)
|
||||||
public void duplicateShortNameTest() {
|
public void duplicateShortNameTest() {
|
||||||
parsingEngine.addArgumentSources( DuplicateShortNameProvider.class );
|
parsingEngine.addArgumentSource( DuplicateShortNameProvider.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -291,9 +291,9 @@ public class ParsingEngineTest extends BaseTest {
|
||||||
public void missingArgumentNameTest() {
|
public void missingArgumentNameTest() {
|
||||||
final String[] commandLine = new String[] {"foo.txt"};
|
final String[] commandLine = new String[] {"foo.txt"};
|
||||||
|
|
||||||
parsingEngine.addArgumentSources( NoArgProvider.class );
|
parsingEngine.addArgumentSource( NoArgProvider.class );
|
||||||
ArgumentMatches argumentMatches = parsingEngine.parse( commandLine );
|
parsingEngine.parse( commandLine );
|
||||||
parsingEngine.validate(argumentMatches);
|
parsingEngine.validate();
|
||||||
}
|
}
|
||||||
|
|
||||||
private class NoArgProvider {
|
private class NoArgProvider {
|
||||||
|
|
@ -304,40 +304,39 @@ public class ParsingEngineTest extends BaseTest {
|
||||||
public void extraValueTest() {
|
public void extraValueTest() {
|
||||||
final String[] commandLine = new String[] {"-Ifoo.txt", "bar.txt"};
|
final String[] commandLine = new String[] {"-Ifoo.txt", "bar.txt"};
|
||||||
|
|
||||||
parsingEngine.addArgumentSources( InputFileArgProvider.class );
|
parsingEngine.addArgumentSource( InputFileArgProvider.class );
|
||||||
ArgumentMatches argumentMatches = parsingEngine.parse( commandLine );
|
parsingEngine.parse( commandLine );
|
||||||
parsingEngine.validate(argumentMatches);
|
parsingEngine.validate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected=MissingArgumentException.class)
|
@Test(expected=MissingArgumentException.class)
|
||||||
public void multipleInvalidArgTest() {
|
public void multipleInvalidArgTest() {
|
||||||
final String[] commandLine = new String[] {"-N1", "-N2", "-N3"};
|
final String[] commandLine = new String[] {"-N1", "-N2", "-N3"};
|
||||||
|
|
||||||
parsingEngine.addArgumentSources( RequiredArgProvider.class );
|
parsingEngine.addArgumentSource( RequiredArgProvider.class );
|
||||||
ArgumentMatches argumentMatches = parsingEngine.parse( commandLine );
|
parsingEngine.parse( commandLine );
|
||||||
parsingEngine.validate( argumentMatches );
|
parsingEngine.validate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected=TooManyValuesForArgumentException.class)
|
@Test(expected=TooManyValuesForArgumentException.class)
|
||||||
public void invalidArgCountTest() {
|
public void invalidArgCountTest() {
|
||||||
final String[] commandLine = new String[] {"--value","1","--value","2","--value","3"};
|
final String[] commandLine = new String[] {"--value","1","--value","2","--value","3"};
|
||||||
|
|
||||||
parsingEngine.addArgumentSources( RequiredArgProvider.class );
|
parsingEngine.addArgumentSource( RequiredArgProvider.class );
|
||||||
ArgumentMatches argumentMatches = parsingEngine.parse( commandLine );
|
parsingEngine.parse( commandLine );
|
||||||
parsingEngine.validate( argumentMatches );
|
parsingEngine.validate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
@Test
|
@Test
|
||||||
public void packageProtectedArgTest() {
|
public void packageProtectedArgTest() {
|
||||||
final String[] commandLine = new String[] {"--foo", "1"};
|
final String[] commandLine = new String[] {"--foo", "1"};
|
||||||
|
|
||||||
parsingEngine.addArgumentSources( PackageProtectedArgProvider.class );
|
parsingEngine.addArgumentSource( PackageProtectedArgProvider.class );
|
||||||
ArgumentMatches argumentMatches = parsingEngine.parse( commandLine );
|
parsingEngine.parse( commandLine );
|
||||||
parsingEngine.validate(argumentMatches);
|
parsingEngine.validate();
|
||||||
|
|
||||||
PackageProtectedArgProvider argProvider = new PackageProtectedArgProvider();
|
PackageProtectedArgProvider argProvider = new PackageProtectedArgProvider();
|
||||||
parsingEngine.loadArgumentsIntoObject( argProvider, argumentMatches);
|
parsingEngine.loadArgumentsIntoObject(argProvider);
|
||||||
|
|
||||||
Assert.assertEquals("Argument is not correctly initialized", 1, argProvider.foo.intValue() );
|
Assert.assertEquals("Argument is not correctly initialized", 1, argProvider.foo.intValue() );
|
||||||
}
|
}
|
||||||
|
|
@ -346,11 +345,32 @@ public class ParsingEngineTest extends BaseTest {
|
||||||
@Argument(doc="foo")
|
@Argument(doc="foo")
|
||||||
Integer foo;
|
Integer foo;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
@Test
|
||||||
|
public void derivedArgTest() {
|
||||||
|
final String[] commandLine = new String[] {"--bar", "5"};
|
||||||
|
|
||||||
|
parsingEngine.addArgumentSource( DerivedArgProvider.class );
|
||||||
|
parsingEngine.parse( commandLine );
|
||||||
|
parsingEngine.validate();
|
||||||
|
|
||||||
|
DerivedArgProvider argProvider = new DerivedArgProvider();
|
||||||
|
parsingEngine.loadArgumentsIntoObject(argProvider);
|
||||||
|
|
||||||
|
Assert.assertEquals("Argument is not correctly initialized", 5, argProvider.bar.intValue() );
|
||||||
|
}
|
||||||
|
|
||||||
|
private class DerivedArgProvider extends BaseArgProvider {
|
||||||
|
}
|
||||||
|
|
||||||
|
private class BaseArgProvider {
|
||||||
|
@Argument(doc="bar")
|
||||||
|
public Integer bar;
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void correctDefaultArgNameTest() {
|
public void correctDefaultArgNameTest() {
|
||||||
parsingEngine.addArgumentSources( CamelCaseArgProvider.class );
|
parsingEngine.addArgumentSource( CamelCaseArgProvider.class );
|
||||||
|
|
||||||
DefinitionMatcher matcher = ArgumentDefinitions.FullNameDefinitionMatcher;
|
DefinitionMatcher matcher = ArgumentDefinitions.FullNameDefinitionMatcher;
|
||||||
ArgumentDefinition definition = parsingEngine.argumentDefinitions.findArgumentDefinition("myarg", matcher);
|
ArgumentDefinition definition = parsingEngine.argumentDefinitions.findArgumentDefinition("myarg", matcher);
|
||||||
|
|
@ -367,9 +387,9 @@ public class ParsingEngineTest extends BaseTest {
|
||||||
public void booleanWithParameterTest() {
|
public void booleanWithParameterTest() {
|
||||||
final String[] commandLine = new String[] {"--mybool", "true"};
|
final String[] commandLine = new String[] {"--mybool", "true"};
|
||||||
|
|
||||||
parsingEngine.addArgumentSources( BooleanArgProvider.class );
|
parsingEngine.addArgumentSource( BooleanArgProvider.class );
|
||||||
ArgumentMatches argumentMatches = parsingEngine.parse( commandLine );
|
parsingEngine.parse( commandLine );
|
||||||
parsingEngine.validate(argumentMatches);
|
parsingEngine.validate();
|
||||||
}
|
}
|
||||||
|
|
||||||
private class BooleanArgProvider {
|
private class BooleanArgProvider {
|
||||||
|
|
@ -381,12 +401,12 @@ public class ParsingEngineTest extends BaseTest {
|
||||||
public void testValidParseForAnalysisType() {
|
public void testValidParseForAnalysisType() {
|
||||||
final String[] commandLine = new String[] {"--analysis_type", "Pileup" };
|
final String[] commandLine = new String[] {"--analysis_type", "Pileup" };
|
||||||
|
|
||||||
parsingEngine.addArgumentSources( AnalysisTypeArgProvider.class );
|
parsingEngine.addArgumentSource( AnalysisTypeArgProvider.class );
|
||||||
ArgumentMatches argumentMatches = parsingEngine.parse( commandLine );
|
parsingEngine.parse( commandLine );
|
||||||
parsingEngine.validate(argumentMatches, EnumSet.of(ParsingEngine.ValidationType.MissingRequiredArgument) );
|
parsingEngine.validate( EnumSet.of(ParsingEngine.ValidationType.MissingRequiredArgument) );
|
||||||
|
|
||||||
AnalysisTypeArgProvider argProvider = new AnalysisTypeArgProvider();
|
AnalysisTypeArgProvider argProvider = new AnalysisTypeArgProvider();
|
||||||
parsingEngine.loadArgumentsIntoObject( argProvider, argumentMatches );
|
parsingEngine.loadArgumentsIntoObject( argProvider );
|
||||||
|
|
||||||
Assert.assertEquals("Argument is not correctly initialized", "Pileup", argProvider.Analysis_Name );
|
Assert.assertEquals("Argument is not correctly initialized", "Pileup", argProvider.Analysis_Name );
|
||||||
}
|
}
|
||||||
|
|
@ -400,9 +420,9 @@ public class ParsingEngineTest extends BaseTest {
|
||||||
public void testInvalidParseForAnalysisType() {
|
public void testInvalidParseForAnalysisType() {
|
||||||
final String[] commandLine = new String[] {"--analysis_type", "Pileup", "-TCountReads" };
|
final String[] commandLine = new String[] {"--analysis_type", "Pileup", "-TCountReads" };
|
||||||
|
|
||||||
parsingEngine.addArgumentSources( AnalysisTypeArgProvider.class );
|
parsingEngine.addArgumentSource( AnalysisTypeArgProvider.class );
|
||||||
ArgumentMatches argumentMatches = parsingEngine.parse( commandLine );
|
parsingEngine.parse( commandLine );
|
||||||
parsingEngine.validate(argumentMatches, EnumSet.of(ParsingEngine.ValidationType.MissingRequiredArgument) );
|
parsingEngine.validate( EnumSet.of(ParsingEngine.ValidationType.MissingRequiredArgument) );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue