use of at.ac.tuwien.kr.alpha.api.config.AlphaConfig in project Alpha by alpha-asp.
the class CommandLineParserTest method atomSeparator.
@Test
public void atomSeparator() throws ParseException {
CommandLineParser parser = new CommandLineParser(DEFAULT_COMMAND_LINE, DEFAULT_ABORT_ACTION);
AlphaConfig cfg = parser.parseCommandLine(new String[] { "-str", "aString.", "-sep", "some-string" });
assertEquals("some-string", cfg.getSystemConfig().getAtomSeparator());
}
use of at.ac.tuwien.kr.alpha.api.config.AlphaConfig in project Alpha by alpha-asp.
the class CommandLineParserTest method basicUsageWithFile.
@Test
public void basicUsageWithFile() throws ParseException {
CommandLineParser parser = new CommandLineParser(DEFAULT_COMMAND_LINE, DEFAULT_ABORT_ACTION);
AlphaConfig ctx = parser.parseCommandLine(new String[] { "-i", "someFile.asp", "-i", "someOtherFile.asp" });
assertEquals(Arrays.asList(new String[] { "someFile.asp", "someOtherFile.asp" }), ctx.getInputConfig().getFiles());
}
use of at.ac.tuwien.kr.alpha.api.config.AlphaConfig in project Alpha by alpha-asp.
the class CommandLineParser method parseCommandLine.
public AlphaConfig parseCommandLine(String[] args) throws ParseException {
CommandLine commandLine = new DefaultParser().parse(CommandLineParser.CLI_OPTS, args);
if (commandLine.getArgs().length > 0) {
throw new ParseException("Positional arguments { " + StringUtils.join(args, ' ') + " } are invalid!");
}
AlphaConfig retVal = new AlphaConfig();
SystemConfig sysConf = new SystemConfig();
InputConfig inputConf = new InputConfig();
if (commandLine.hasOption(CommandLineParser.OPT_HELP.getOpt())) {
LOGGER.debug("Found help option!");
this.handleHelp();
} else {
this.validate(commandLine);
}
for (Option opt : commandLine.getOptions()) {
this.handleOption(opt, sysConf, inputConf);
}
retVal.setSystemConfig(sysConf);
retVal.setInputConfig(inputConf);
return retVal;
}
use of at.ac.tuwien.kr.alpha.api.config.AlphaConfig in project Alpha by alpha-asp.
the class CommandLineParserTest method disableStratifiedEval.
@Test
public void disableStratifiedEval() throws ParseException {
CommandLineParser parser = new CommandLineParser(DEFAULT_COMMAND_LINE, DEFAULT_ABORT_ACTION);
AlphaConfig ctx = parser.parseCommandLine(new String[] { "-i", "someFile.asp", "-i", "someOtherFile.asp", "-dse" });
assertFalse(ctx.getSystemConfig().isEvaluateStratifiedPart());
}
use of at.ac.tuwien.kr.alpha.api.config.AlphaConfig in project Alpha by alpha-asp.
the class CommandLineParserTest method noInstanceRemoval.
@Test
public void noInstanceRemoval() throws ParseException {
CommandLineParser parser = new CommandLineParser(DEFAULT_COMMAND_LINE, DEFAULT_ABORT_ACTION);
AlphaConfig alphaConfig = parser.parseCommandLine(new String[] { "-str", "aString.", "-acc" });
assertTrue(alphaConfig.getSystemConfig().isGrounderAccumulatorEnabled());
}
Aggregations