All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opengis.cite.ogcapifeatures10.CommandLineArguments Maven / Gradle / Ivy

There is a newer version: 1.7.1
Show newest version
package org.opengis.cite.ogcapifeatures10;

import com.beust.jcommander.Parameter;
import java.io.File;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;

/**
 * Declares supported command line arguments that are parsed using the
 * JCommander library. All arguments are optional. The default values are as
 * follows:
 * 
    *
  • XML properties file: ${user.home}/test-run-props.xml
  • *
  • outputDir: ${user.home}
  • *
  • deleteSubjectOnFinish: false
  • *
  • generateHtmlReport: false
  • *
* *

* Synopsis *

* *
 * ets-${ets-code}-${version}-aio.jar [-o|--outputDir $TMPDIR] [-d|--deleteSubjectOnFinish] [-h|--generateHtmlReport] [test-run-props.xml]
 * 
*/ public class CommandLineArguments { @Parameter(description = "Properties file") private List xmlProps; @Parameter(names = {"-o", "--outputDir"}, description = "Output directory") private String outputDir; @Parameter(names = {"-d", "--deleteSubjectOnFinish"}, description = "Delete file containing representation of test subject when finished") private boolean deleteSubjectOnFinish = false; @Parameter(names = {"-h", "--generateHtmlReport"}, arity = 1, description = "Enable HTML report generation") private boolean generateHtmlReport = false; public CommandLineArguments() { this.xmlProps = new ArrayList<>(); } public File getPropertiesFile() { File fileRef; if (xmlProps.isEmpty()) { fileRef = new File(System.getProperty("user.home"), "test-run-props.xml"); } else { String propsFile = xmlProps.get(0); fileRef = (propsFile.startsWith("file:")) ? new File(URI.create(propsFile)) : new File(propsFile); } return fileRef; } public String getOutputDir() { return (null != outputDir) ? outputDir : System.getProperty("user.home"); } public boolean doDeleteSubjectOnFinish() { return deleteSubjectOnFinish; } public boolean isGenerateHtmlReport() { return generateHtmlReport; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy