You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Zhihong Yu (Issue Comment Edited) (JIRA)" <ji...@apache.org> on 2012/02/23 05:53:49 UTC

[jira] [Issue Comment Edited] (HBASE-5456) Introduce PowerMock into our unit tests to reduce unnecessary method exposure

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

Zhihong Yu edited comment on HBASE-5456 at 2/23/12 4:53 AM:
------------------------------------------------------------

@Mikhail:
Thanks for the reminder and pardon my math :-)

Looking at https://builds.apache.org/job/PreCommit-HBASE-Build/1013/console again, we can see:
{code}
Results :

Tests run: 519, Failures: 0, Errors: 0, Skipped: 0
...
Results :

Failed tests:   testMROnTable(org.apache.hadoop.hbase.mapreduce.TestImportTsv)
  testMROnTableWithCustomMapper(org.apache.hadoop.hbase.mapreduce.TestImportTsv)
  testMRIncrementalLoad(org.apache.hadoop.hbase.mapreduce.TestHFileOutputFormat)
  testMRIncrementalLoadWithSplit(org.apache.hadoop.hbase.mapreduce.TestHFileOutputFormat)
  testExcludeMinorCompaction(org.apache.hadoop.hbase.mapreduce.TestHFileOutputFormat)
  queueFailover(org.apache.hadoop.hbase.replication.TestReplication): Waited too much time for queueFailover replication

Tests in error: 
  testMultiRegionTable(org.apache.hadoop.hbase.mapred.TestTableMapReduce): Job failed!

Tests run: 885, Failures: 6, Errors: 1, Skipped: 10
{code}
519+885 is 1404 which is very close to what you have seen.
                
      was (Author: zhihyu@ebaysf.com):
    @Mikhail:
Thanks for the reminder and pardon my math :-)
{code}
Looking at https://builds.apache.org/job/PreCommit-HBASE-Build/1013/console again, we can see:

Results :

Tests run: 519, Failures: 0, Errors: 0, Skipped: 0
...
Results :

Failed tests:   testMROnTable(org.apache.hadoop.hbase.mapreduce.TestImportTsv)
  testMROnTableWithCustomMapper(org.apache.hadoop.hbase.mapreduce.TestImportTsv)
  testMRIncrementalLoad(org.apache.hadoop.hbase.mapreduce.TestHFileOutputFormat)
  testMRIncrementalLoadWithSplit(org.apache.hadoop.hbase.mapreduce.TestHFileOutputFormat)
  testExcludeMinorCompaction(org.apache.hadoop.hbase.mapreduce.TestHFileOutputFormat)
  queueFailover(org.apache.hadoop.hbase.replication.TestReplication): Waited too much time for queueFailover replication

Tests in error: 
  testMultiRegionTable(org.apache.hadoop.hbase.mapred.TestTableMapReduce): Job failed!

Tests run: 885, Failures: 6, Errors: 1, Skipped: 10
{code}
519+885 is 1404 which is very close to what you have seen.
                  
> Introduce PowerMock into our unit tests to reduce unnecessary method exposure
> -----------------------------------------------------------------------------
>
>                 Key: HBASE-5456
>                 URL: https://issues.apache.org/jira/browse/HBASE-5456
>             Project: HBase
>          Issue Type: Task
>            Reporter: Zhihong Yu
>
> We should introduce PowerMock into our unit tests so that we don't have to expose methods intended to be used by unit tests.
> Here was Benoit's reply to a user of asynchbase about testability:
> OpenTSDB has unit tests that are mocking out HBaseClient just fine
> [1].  You can mock out pretty much anything on the JVM: final,
> private, JDK stuff, etc.  All you need is the right tools.  I've been
> very happy with PowerMock.  It supports Mockito and EasyMock.
> I've never been keen on mutilating public interfaces for the sake of
> testing.  With tools like PowerMock, we can keep the public APIs tidy
> while mocking and overriding anything, even in the most private guts
> of the classes.
>  [1] https://github.com/stumbleupon/opentsdb/blob/master/src/uid/TestUniqueId.java#L66

--
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