Cascade cascade = new CascadeConnector().connect( flow1, flow2 );
cascade.complete();
CascadeStats cascadeStats = cascade.getCascadeStats();
assertNotNull( cascadeStats.getID() );
// unsure why this has changed
// if( getPlatform() instanceof HadoopPlatform )
// {
// Collection<String> counterGroups = cascadeStats.getCounterGroups();
// assertEquals( getPlatform().isUseCluster() ? 5 : 4, counterGroups.size() );
// }
assertEquals( 1, cascadeStats.getCounterGroupsMatching( "cascading\\.stats\\..*" ).size() );
assertEquals( 2, cascadeStats.getCountersFor( TestEnum.class.getName() ).size() );
assertEquals( 2, cascadeStats.getCountersFor( TestEnum.class ).size() );
assertEquals( 40, cascadeStats.getCounterValue( TestEnum.FIRST ) );
assertEquals( 20, cascadeStats.getCounterValue( TestEnum.SECOND ) );
// should not throw npe
assertEquals( 0, cascadeStats.getCounterValue( TestEnum.THIRD ) );
assertEquals( 0, cascadeStats.getCounterValue( "FOO", "BAR" ) );
FlowStats flowStats1 = flow1.getFlowStats();
assertNotNull( flowStats1.getID() );
assertEquals( 20, flowStats1.getCounterValue( TestEnum.FIRST ) );
assertEquals( 10, flowStats1.getCounterValue( TestEnum.SECOND ) );
assertEquals( 10, flowStats1.getFlowStepStats().get( 0 ).getCounterValue( TestEnum.FIRST ) );
assertEquals( 10, flowStats1.getFlowStepStats().get( 1 ).getCounterValue( TestEnum.FIRST ) );
// should not throw npe
assertEquals( 0, flowStats1.getCounterValue( TestEnum.THIRD ) );
assertEquals( 0, flowStats1.getCounterValue( "FOO", "BAR" ) );
FlowStats flowStats2 = flow2.getFlowStats();
assertNotNull( flowStats2.getID() );
assertEquals( 20, flowStats2.getCounterValue( TestEnum.FIRST ) );
assertEquals( 10, flowStats2.getCounterValue( TestEnum.SECOND ) );
cascadeStats.captureDetail();
assertEquals( 2, flowStats1.getStepsCount() );
assertEquals( 2, flowStats2.getStepsCount() );
HadoopStepStats stats1 = (HadoopStepStats) flowStats1.getFlowStepStats().get( 0 );