How to check an interactive Java application using cucumber and aruba
I have this cucumber / Aruba scenario is:
Scenario: When I type "some \ n" to run 'java -cp / bin echo' interactively in view of the general echo, in the output "Something" should be to test this simple Java program:
import java.util. *; Square echo {public static zero main (string [] args) {scanner stdin = new scanner (System.in); Println (stdin.next ()); }} When I run the test, it fails and I get the following error:
Then the output should contain "something" Output should contain "some" '' in which "something" (RSPEC :: Exxpectation :: Execution Notat Error) / Feature / Client.Feature: 15: I try the same exam with
What is the second method to read from the standard input What is the system? Is the system used only for the keyboard?
You can try:
First test that cucumber / Aruba is getting out in your system. Forcing the output to the output, call what you expect in your test: i.e.
System.out.println ("something"); If that works, then you are encoded on standard input reading (I The way I have read puts you do it). The answer below is how do I generally see people reading from standard input in Java:
Comments
Post a Comment