Testing a Java program that communicates using labels on standard input and standard output

This is just a special case of Testing a program that communicates using labels on standard input and standard output where the program that is to be started is a java program.

  • Select 'implementation type': real program, communicating labels on stdin/stdout
  • Enter program+args

In the text field for 'program+args' you have to enter the command that has to be executed.
For the program you have to give the full (absolute path name), unless
For arguments that are file names you typically have to give the full (absolute) path name.

The easiest to configure is a when the program is available as a jar file that can be run as: java -jar program.jar possible other arguments
For example
  • On windows: java -jar "J:\ex\fwgc\impl\correct.jar"
  • On linux: java -jar "/path/to /ex/fwgc/impl/correct.jar"
    Note: on windows the double quotes are needed
Otherwise, you have to invoke java with a claspath, for example
  • On windows: java -classpath "J:\ex\fwgc\impl\correct" practicum.Practicum
  • On linux: java -classpath "/path/to /ex/fwgc/impl/correct" practicum.Practicum
    Note: on windows the double quotes are needed

Back to Usage scenarios