@Override public TupleEntryIterator openForRead( FlowProcess<? extends Properties> flowProcess, InputStream inputStream ) throws IOException { return new TupleEntrySchemeIterator<Properties, InputStream>( flowProcess, this, getScheme(), System.in ); }
@Test public void testIO() { String lines = "line1\nline2\n"; System.setIn( new ByteArrayInputStream( lines.getBytes() ) ); ByteArrayOutputStream output = new ByteArrayOutputStream(); System.setOut( new PrintStream( output ) ); Tap source = new StdInTap( new TextLine( new Fields( "line" ) ) ); Tap sink = new StdOutTap( new TextLine( new Fields( "line" ) ) ); Pipe pipe = new Pipe( "io" ); Flow flow = new LocalFlowConnector().connect( source, sink, pipe ); flow.complete(); assertEquals( lines, output.toString() ); }