@Override public void afterPropertiesSet() throws Exception { flow = createFlow(); if (skipStrategy != null) { flow.setFlowSkipStrategy(skipStrategy); } if (stepStrategy != null) { flow.setFlowStepStrategy(stepStrategy); } if (listeners != null) { for (FlowListener listener : listeners) { flow.addListener(listener); } } if (StringUtils.hasText(writeDOT)) { flow.writeDOT(writeDOT); } if (StringUtils.hasText(writeStepsDOT)) { flow.writeStepsDOT(writeStepsDOT); } if (priority != null) { flow.setSubmitPriority(priority); } }
/** * sanity check to make sure writeDOT still works * * @throws Exception */ @Test public void testWriteDot() throws Exception { Tap source = getPlatform().getTextFile( "input" ); Tap sink = getPlatform().getTextFile( "unknown" ); Pipe pipe = new Pipe( "test" ); pipe = new Each( pipe, new Fields( "line" ), new RegexSplitter( Fields.UNKNOWN ) ); pipe = new Each( pipe, new Debug() ); pipe = new Each( pipe, new Fields( 2 ), new Identity( new Fields( "label" ) ) ); pipe = new Each( pipe, new Debug() ); pipe = new Each( pipe, new Fields( "label" ), new RegexFilter( "[A-Z]*" ) ); pipe = new Each( pipe, new Debug() ); pipe = new GroupBy( pipe, Fields.ALL ); pipe = new GroupBy( pipe, Fields.ALL ); Flow flow = getPlatform().getFlowConnector().connect( source, sink, pipe ); String outputPath = getOutputPath( "writedot.dot" ); flow.writeDOT( outputPath ); assertTrue( new File( outputPath ).exists() ); outputPath = getOutputPath( "writestepdot.dot" ); flow.writeStepsDOT( outputPath ); assertTrue( new File( outputPath ).exists() ); }
/** * sanity check to make sure writeDOT still works * * @throws Exception */ @Test public void testWriteDot() throws Exception { Tap source = getPlatform().getTextFile( "input" ); Tap sink = getPlatform().getTextFile( "unknown" ); Pipe pipe = new Pipe( "test" ); pipe = new Each( pipe, new Fields( "line" ), new RegexSplitter( Fields.UNKNOWN ) ); pipe = new Each( pipe, new Debug() ); pipe = new Each( pipe, new Fields( 2 ), new Identity( new Fields( "label" ) ) ); pipe = new Each( pipe, new Debug() ); pipe = new Each( pipe, new Fields( "label" ), new RegexFilter( "[A-Z]*" ) ); pipe = new Each( pipe, new Debug() ); pipe = new GroupBy( pipe, Fields.ALL ); pipe = new GroupBy( pipe, Fields.ALL ); Flow flow = getPlatform().getFlowConnector().connect( source, sink, pipe ); String outputPath = getOutputPath( "writedot.dot" ); flow.writeDOT( outputPath ); assertTrue( new File( outputPath ).exists() ); outputPath = getOutputPath( "writestepdot.dot" ); flow.writeStepsDOT( outputPath ); assertTrue( new File( outputPath ).exists() ); }