I\'m developing application with Netbeans and Maven. My application should obtain data from stdin. But I could not understand how to test it. Putting < data.txt
I assume you have a thing like:
public static void main(String[] args) {
...
}
This can used as an entry point to your application and before that you change the input channel via:
FileInputStream is = new FileInputStream(new File("test.data"));
System.setIn(is);
The above can be used within a unit/integration test.