mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-25 16:55:39 +00:00
Checking only for "Usage:" but as a constant; No ANSI codes!
This commit is contained in:
parent
7a7712188d
commit
a8a3fd100c
2 changed files with 5 additions and 11 deletions
|
|
@ -20,12 +20,10 @@ import java.nio.file.Path;
|
|||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
import de.kosit.validationtool.cmd.CommandLineApplication.Level;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import de.kosit.validationtool.cmd.CommandLineApplication.Level;
|
||||
|
||||
import picocli.CommandLine.ArgGroup;
|
||||
import picocli.CommandLine.Command;
|
||||
import picocli.CommandLine.Help.Visibility;
|
||||
|
|
@ -38,10 +36,12 @@ import picocli.CommandLine.Parameters;
|
|||
* @author Andreas Penski
|
||||
*/
|
||||
@Command(description = "Structural and semantic validation of xml files", name = "KoSIT Validator", mixinStandardHelpOptions = false,
|
||||
separator = " ")
|
||||
separator = " ", synopsisHeading = CommandLineOptions.SYNOSIS_HEADING)
|
||||
@Getter
|
||||
public class CommandLineOptions implements Callable<ReturnValue> {
|
||||
|
||||
static final String SYNOSIS_HEADING = "Usage: ";
|
||||
|
||||
/**
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -76,18 +76,12 @@ public class CommandlineApplicationTest {
|
|||
final String[] args = { "-?" };
|
||||
CommandLineApplication.mainProgram(args);
|
||||
assertThat(CommandLine.getErrorOutput()).isEmpty();
|
||||
log.warn("Philip1");
|
||||
checkForHelp(CommandLine.getOutputLines());
|
||||
log.warn("Philip2");
|
||||
}
|
||||
|
||||
private static void checkForHelp(final List<String> outputLines) {
|
||||
assertThat(outputLines.size()).isPositive();
|
||||
log.warn("!!!!");
|
||||
for (final String s : outputLines)
|
||||
log.warn(s);
|
||||
log.warn("!!!");
|
||||
assertThat(outputLines.stream().filter(l -> l.startsWith("Usage: KoSIT Validator"))).hasSize(1);
|
||||
assertThat(outputLines.stream().filter(l -> l.startsWith(CommandLineOptions.SYNOSIS_HEADING))).hasSize(1);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue