Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-9966

Convert/migrate tests using EasyMock to Mockito



    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.5, 7.0
    • Component/s: Tests
    • Labels:


      In SOLR-9893 I disabled all tests on Java 9 that use EasyMock, because Easymock is not compatible with Java 9 (it uses outdated cglib version that does not work with Jigsaw module system). To me the project seems dead (no releases since more than 2 years).

      Mockito latest version is compatible to Java 9 because it no longer uses cglib and the more modern and powerful Byte-Buddy lib; SOLR-9893 updated to it.

      I found this about more or less "automated rewrite" of EasyMock tests to Mockito:

      It is not many tests, so this would be a great cleanup:

      • 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

      There is one special case:

      • contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestJdbcDataSource.java

      I am not sure how to convert this one, because it uses some strange system properties and a handler that intercepts some EasyMock stuff. I may need help to convert that one!

      After this is resolved we can remove the following dependencies from Solr:

      • cglib-nodep
      • easymock


        1. SOLR-9966.patch
          86 kB
          Cao Manh Dat

          Issue Links



              • Assignee:
                caomanhdat Cao Manh Dat
                uschindler Uwe Schindler
              • Votes:
                0 Vote for this issue
                6 Start watching this issue


                • Created: