[ 
https://issues.apache.org/jira/browse/HBASE-6345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13409823#comment-13409823
 ] 

Todd Lipcon commented on HBASE-6345:
------------------------------------

Yea, we haven't been using the AspectJ FI stuff since we mavenized quite some 
time ago. It was a pain to maintain, and only one person ever really knew how 
to write FI tests with this framework.

All of our new fault injection tests are just using Mockito. Where necessary 
we're adding FaultInjector classes which are easy to hook, for example: 
https://github.com/toddlipcon/hadoop-common/blob/auto-failover-and-qjournal/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CheckpointFaultInjector.java
                
> Utilize fault injection in testing using AspectJ
> ------------------------------------------------
>
>                 Key: HBASE-6345
>                 URL: https://issues.apache.org/jira/browse/HBASE-6345
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Zhihong Ted Yu
>
> HDFS uses fault injection to test pipeline failure in addition to mock, spy. 
> HBase uses mock, spy. But there are cases where mock, spy aren't convenient.
> Some example from DFSClientAspects.aj :
> {code}
>   pointcut pipelineInitNonAppend(DataStreamer datastreamer):
>     callCreateBlockOutputStream(datastreamer)
>     && cflow(execution(* nextBlockOutputStream(..)))
>     && within(DataStreamer);
>   after(DataStreamer datastreamer) returning : 
> pipelineInitNonAppend(datastreamer) {
>     LOG.info("FI: after pipelineInitNonAppend: hasError="
>         + datastreamer.hasError + " errorIndex=" + datastreamer.errorIndex);
>     if (datastreamer.hasError) {
>       DataTransferTest dtTest = DataTransferTestUtil.getDataTransferTest();
>       if (dtTest != null)
>         dtTest.fiPipelineInitErrorNonAppend.run(datastreamer.errorIndex);
>     }
>   }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to