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

Uwe Schindler edited comment on SOLR-9893 at 1/14/17 10:01 AM:
---------------------------------------------------------------

I found this about more or less "automated rewrite" of EasyMock tests to 
Mockito:
- https://wiki.magnolia-cms.com/display/DEV/Converting+Easymock-Tests+to+Mockito
- A script doing this: 
https://gist.github.com/stefanbirkner/1095194/904909cc229b6acb55c18f529e396089129e20e9

It is not many tests, so this would be a great cleanup.
- 
contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestJdbcDataSource.java
- core/src/test/org/apache/solr/cloud/ClusterStateTest.java
- 
core/src/test/org/apache/solr/cloud/OverseerCollectionConfigSetProcessorTest.java
- core/src/test/org/apache/solr/core/BlobRepositoryMockingTest.java
- core/src/test/org/apache/solr/core/CoreSorterTest.java
- core/src/test/org/apache/solr/security/TestPKIAuthenticationPlugin.java
- core/src/test/org/apache/solr/servlet/SolrRequestParserTest.java
- solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrClientCacheTest.java

I will work on a patch.


was (Author: thetaphi):
I found this about more or less "automated rewrite" of EasyMock tests to 
Mockito:
- https://wiki.magnolia-cms.com/display/DEV/Converting+Easymock-Tests+to+Mockito
- A script doing this: 
https://gist.github.com/stefanbirkner/1095194/904909cc229b6acb55c18f529e396089129e20e9

It is not many tests, so this would be a great cleanup. I will work on a patch.

> EasyMock/Mockito no longer works with Java 9 b148+
> --------------------------------------------------
>
>                 Key: SOLR-9893
>                 URL: https://issues.apache.org/jira/browse/SOLR-9893
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: Tests
>    Affects Versions: 6.x, master (7.0)
>            Reporter: Uwe Schindler
>            Priority: Blocker
>         Attachments: SOLR-9893-Mockito-update.patch
>
>
> EasyMock does not work anymore with latest Java 9, because it uses cglib 
> behind that is trying to access a protected method inside the runtime using 
> setAccessible. This is no longer allowed by Java 9.
> Actually this is really stupid. Instead of forcefully making the protected 
> defineClass method available to the outside, it is much more correct to just 
> subclass ClassLoader (like the Lucene expressions module does).
> I tried updating to easymock/mockito, but all that does not work, approx 25 
> tests fail. The only way is to disable all Mocking tests in Java 9. The 
> underlying issue in cglib is still not solved, master's code is here: 
> https://github.com/cglib/cglib/blob/master/cglib/src/main/java/net/sf/cglib/core/ReflectUtils.java#L44-L62
> As we use an old stone-aged version of mockito (1.x), a fix is not expected 
> to happen, although cglib might fix this!
> What should we do? This stupid issue prevents us from testing Java 9 with 
> Solr completely! 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to