1

I have a program that I want to run test cases on, I'm supposed to automate iterating through all the test cases using the Terminal. My problem is that I have already written the program to take in input using the Scanner(System.in) command (Through the keyboard).

Is there a way to feed my program the input using text files instead of keyboard without changing my code? [Eg: using a specific terminal command that would extract text from a file and give it back to the program when prompted for keyboard entry]

Many thanks

====================== Note: I have multiple inputs not just one. If I change the standard input stream(?) to the text file, how do I control the extraction so that every line is one "answer"?

Sara Bahis
  • 61
  • 3

0 Answers0