org.apache.commons.pipeline.testFramework
Class FaultingTestStage

java.lang.Object
  extended by org.apache.commons.pipeline.testFramework.TestStage
      extended by org.apache.commons.pipeline.testFramework.FaultingTestStage
All Implemented Interfaces:
Stage

public class FaultingTestStage
extends TestStage

This stage will generate StageExceptions for every other object this stage processes. By design, the even numbered objects will cause a StageException to be thrown (counting the first object as 1).


Field Summary
 
Fields inherited from class org.apache.commons.pipeline.testFramework.TestStage
initialized, postprocessed, preprocessed, processedObjects, released
 
Constructor Summary
FaultingTestStage(int index)
           
 
Method Summary
 void process(Object obj)
          Implementations of this method should atomically process a single data object and transfer any feed objects resulting from this processing to the downstream Feeder.
 
Methods inherited from class org.apache.commons.pipeline.testFramework.TestStage
getIndex, init, postprocess, preprocess, release, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FaultingTestStage

public FaultingTestStage(int index)
Method Detail

process

public void process(Object obj)
             throws StageException
Description copied from interface: Stage
Implementations of this method should atomically process a single data object and transfer any feed objects resulting from this processing to the downstream Feeder. This Feeder can be obtained from the stage context made available during initialization. NOTE: Implementations of this method must be thread-safe!

Specified by:
process in interface Stage
Overrides:
process in class TestStage
Parameters:
obj - an object to be processed
Throws:
StageException - any checked Exception thrown by the implementation should be wrapped in a StageException


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.