projects
/
cli-helper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update naming in commandline parser
[cli-helper.git]
/
src
/
test
/
java
/
eu
/
svjatoslav
/
commons
/
cli_helper
/
parameter_parser
/
ParserTest.java
diff --git
a/src/test/java/eu/svjatoslav/commons/cli_helper/parameter_parser/ParserTest.java
b/src/test/java/eu/svjatoslav/commons/cli_helper/parameter_parser/ParserTest.java
index
ab87cae
..
949e255
100755
(executable)
--- a/
src/test/java/eu/svjatoslav/commons/cli_helper/parameter_parser/ParserTest.java
+++ b/
src/test/java/eu/svjatoslav/commons/cli_helper/parameter_parser/ParserTest.java
@@
-4,8
+4,8
@@
*/
package eu.svjatoslav.commons.cli_helper.parameter_parser;
*/
package eu.svjatoslav.commons.cli_helper.parameter_parser;
-import eu.svjatoslav.commons.cli_helper.parameter_parser.parameter.File
Parameter
;
-import eu.svjatoslav.commons.cli_helper.parameter_parser.parameter.String
Parameter
;
+import eu.svjatoslav.commons.cli_helper.parameter_parser.parameter.File
Option
;
+import eu.svjatoslav.commons.cli_helper.parameter_parser.parameter.String
Option
;
import org.junit.Before;
import org.junit.Test;
import org.junit.Before;
import org.junit.Test;
@@
-28,13
+28,13
@@
public class ParserTest {
public void testParse() throws IOException {
// define allowed parameters
public void testParse() throws IOException {
// define allowed parameters
- final String
Parameter helpParameter = parser.add(new StringParameter
("Show help screen")
+ final String
Option helpOption = parser.add(new StringOption
("Show help screen")
.addAliases("--help", "-h").setMandatory());
.addAliases("--help", "-h").setMandatory());
- final String
Parameter compileParameter = parser.add(new StringParameter
("Compile code"))
+ final String
Option compileOption = parser.add(new StringOption
("Compile code"))
.addAliases("--compile", "-c");
.addAliases("--compile", "-c");
- File
Parameter fileParameter = parser.add(new FileParameter
("Input file")
+ File
Option fileOption = parser.add(new FileOption
("Input file")
.addAliases("-i").mustExist());
createTemporaryFile();
.addAliases("-i").mustExist());
createTemporaryFile();
@@
-46,16
+46,16
@@
public class ParserTest {
parser.parse(new String[]{"--help", "section", "-i", "/tmp/file with spaces"});
// --help was in the arguments
parser.parse(new String[]{"--help", "section", "-i", "/tmp/file with spaces"});
// --help was in the arguments
- assertTrue(help
Parameter.isSpecified
());
+ assertTrue(help
Option.isPresent
());
// compile was not present
// compile was not present
- assertFalse(compile
Parameter.isSpecified
());
+ assertFalse(compile
Option.isPresent
());
// validate that help argument was "section"
// validate that help argument was "section"
- assertEquals("section", help
Parameter
.getValue());
+ assertEquals("section", help
Option
.getValue());
- assertTrue(file
Parameter.isSpecified
());
- assertEquals("/tmp/file with spaces", file
Parameter
.getValue().getAbsolutePath());
+ assertTrue(file
Option.isPresent
());
+ assertEquals("/tmp/file with spaces", file
Option
.getValue().getAbsolutePath());
}
}