hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Yu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-14178) Move Mockito up to version 2.x
Date Thu, 05 Oct 2017 16:25:01 GMT

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

Ted Yu commented on HADOOP-14178:
---------------------------------

Is this going to hadoop-3 beta / GA ?

If not, how about upgrading to 1.10.19 for hadoop-3 ?

I got the following when starting hadoop-3 mini dfs cluster:
{code}
2017-10-05 08:31:26,525 WARN  [main] hbase.HBaseTestingUtility(1077): error starting mini
dfs
java.lang.NoClassDefFoundError: org/mockito/stubbing/Answer
  at org.apache.hadoop.hdfs.MiniDFSCluster.shouldWait(MiniDFSCluster.java:2668)
  at org.apache.hadoop.hdfs.MiniDFSCluster.waitActive(MiniDFSCluster.java:2564)
  at org.apache.hadoop.hdfs.MiniDFSCluster.waitActive(MiniDFSCluster.java:2607)
  at org.apache.hadoop.hdfs.MiniDFSCluster.startDataNodes(MiniDFSCluster.java:1667)
  at org.apache.hadoop.hdfs.MiniDFSCluster.initMiniDFSCluster(MiniDFSCluster.java:874)
  at org.apache.hadoop.hdfs.MiniDFSCluster.<init>(MiniDFSCluster.java:769)
  at org.apache.hadoop.hbase.HBaseTestingUtility.startMiniDFSCluster(HBaseTestingUtility.java:661)
  at org.apache.hadoop.hbase.HBaseTestingUtility.startMiniCluster(HBaseTestingUtility.java:1075)
  at org.apache.hadoop.hbase.HBaseTestingUtility.startMiniCluster(HBaseTestingUtility.java:953)
{code}
hbase uses mockito-all 1.10.19

If I downgrade to 1.8.5 (hadoop), hbase code won't compile:
{code}
[ERROR] /Users/tyu/trunk/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestClientScanner.java:[146,62]
cannot find symbol
[ERROR] symbol:   method getArgumentAt(int,java.lang.Class<org.apache.hadoop.hbase.client.ScannerCallableWithReplicas>)
[ERROR] location: variable invocation of type org.mockito.invocation.InvocationOnMock
[ERROR] /Users/tyu/trunk/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestClientScanner.java:[207,60]
cannot find symbol
[ERROR] symbol:   method getArgumentAt(int,java.lang.Class<org.apache.hadoop.hbase.client.ScannerCallableWithReplicas>)
[ERROR] location: variable invocation of type org.mockito.invocation.InvocationOnMock
{code}

> Move Mockito up to version 2.x
> ------------------------------
>
>                 Key: HADOOP-14178
>                 URL: https://issues.apache.org/jira/browse/HADOOP-14178
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: test
>    Affects Versions: 2.9.0
>            Reporter: Steve Loughran
>            Assignee: Akira Ajisaka
>
> I don't know when Hadoop picked up Mockito, but it has been frozen at 1.8.5 since the
switch to maven in 2011. 
> Mockito is now at version 2.1, [with lots of Java 8 support|https://github.com/mockito/mockito/wiki/What%27s-new-in-Mockito-2].
That' s not just defining actions as closures, but in supporting Optional types, mocking methods
in interfaces, etc. 
> It's only used for testing, and, *provided there aren't regressions*, cost of upgrade
is low. The good news: test tools usually come with good test coverage. The bad: mockito does
go deep into java bytecodes.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


Mime
View raw message