21import static org.junit.jupiter.api.Assertions.assertEquals;
22import static org.junit.jupiter.api.Assertions.assertTrue;
26import org.junit.jupiter.api.Test;
27import org.junit.jupiter.api.io.TempDir;
29import denoptim.io.DenoptimIO;
30import denoptim.logging.Version;
31import denoptim.main.Main.RunType;
32import denoptim.programs.RunTimeParameters.ParametersType;
37 private final String
SEP = System.getProperty(
"file.separator");
47 assertTrue(this.tempDir.isDirectory(),
"Should be a directory");
48 String inputPathName =
tempDir.getAbsolutePath() +
SEP +
"input.par";
51 String inputPathName2 =
tempDir.getAbsolutePath() +
SEP +
"input2.par";
68 assertTrue(b.
helpMsg.contains(
"usage:"),
"Help Msg");
81 assertTrue(b.
cmd.getArgList().contains(inputPathName),
"Input file");
91 assertTrue(b.
errorMsg.contains(
"not enabled from CLI"),
"Error Msg");
98 assertTrue(b.
cmd.getArgList().contains(inputPathName),
"Input file");
117 assertTrue(b.
helpMsg.contains(
"usage:"),
"Help Msg");
118 assertTrue(b.
errorMsg.contains(
"Unrecognized option"),
"Error Msg");
125 assertTrue(b.
errorMsg.contains(
"not found"),
"Error Msg");
129 assertTrue(b.
errorMsg.contains(
"not found"),
"Error Msg");
138 assertTrue(b.
cmd.getArgList().contains(inputPathName),
"Input file");
139 assertTrue(b.
cmd.getArgList().contains(inputPathName2),
"Input file");
Utility methods for input/output.
static void writeData(String fileName, String data, boolean append)
Write text-like data file.
Class handling DENOPTIM's version identifier for headers.
static final String VERSION
Version identifier (from pom.xml via Maven properties)
Represents the behavior of the program at start-up.
RunType runType
The type of run that is requested.
String errorMsg
The error message.
CommandLine cmd
The parsed command line arguments.
int exitStatus
A non-zero value means some error has occurred and the program will terminate.
String helpMsg
The help message.
static Option help
Option requesting the printing of the help message.
static Option version
Option requesting only the printing of the version.
static Option run
Option controlling the type of run.
Entry point of any kind of run of the DENOPTIM program.
static Behavior defineProgramBehavior(String[] args)
Does the processing of the application arguments and decides what the program should do.
void testDefineProgramBehavior()
Types of runs that can be requested to the DENOPTIM Main class.
GA
Run the genetic algorithm with DenoptimGA.
GUI
Launch the graphical user interface denoptim.gui.GUI.
FSE
Run a combinatorial generation of candidates with FragSpaceExplorer.
Identifier of the type of parameters.
GA_PARAMS
Parameters pertaining the genetic algorithm.