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

Uwe Schindler commented on SOLR-9893:
-------------------------------------

Hi,
I was able to update Solr-Code's Test Dependencies to latest Mockito/Bytebuddy. 
This makes most Mocking tests works again.
But Easymock did not release a new version (and seems no longer maintained). If 
somemody has time to rewrite those tests (about 13 Suites with 23 tests, 
only!!!!) to use Mockito, too - we would be able to run our tests with Java 9:

Some of those tests that failed in my local run may be unrelated, this is just 
the output:

[junit4] Tests with failures [seed: A99FA98E35E3349A] (first 10 out of 23):
   [junit4]   - 
org.apache.solr.cloud.TestSolrCloudWithDelegationTokens.testDelegationTokenCancelFail
   [junit4]   - 
org.apache.solr.core.BlobRepositoryMockingTest.testGetBlobIncrRefStringDecoder
   [junit4]   - 
org.apache.solr.core.BlobRepositoryMockingTest.testGetBlobIncrRefString
   [junit4]   - org.apache.solr.core.BlobRepositoryMockingTest.testCachedAlready
   [junit4]   - org.apache.solr.core.BlobRepositoryMockingTest.testCloudOnly
   [junit4]   - org.apache.solr.cloud.SyncSliceTest (suite)
   [junit4]   - org.apache.solr.cloud.OverseerCollectionConfigSetProcessorTest 
(suite)
   [junit4]   - 
org.apache.solr.handler.component.DistributedFacetPivotWhiteBoxTest (suite)
   [junit4]   - 
org.apache.solr.servlet.SolrRequestParserTest.testStandardFormdataUploadLimit
   [junit4]   - 
org.apache.solr.servlet.SolrRequestParserTest.testStandardParseParamsAndFillStreamsISO88591

The problem with Easymock is: Old versions (Solr uses 3.0) depend on outdated 
cglib that has no Java 9 compatible release. Newer versions (3.4) ships with 
CGLIB bundled and shaded. So even if CGLIB releases a newer version, it won't 
help, because Easymock uses the shaded and bundled broken version. Easymock 
seems dead to me. So let's nuke it. Mockito is the way to go.

For now my only chance is to disable all Easymock based tests, they are 
incompatible to Java 9.

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