You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Uwe Schindler (JIRA)" <ji...@apache.org> on 2017/11/04 16:38:00 UTC

[jira] [Created] (SOLR-11606) Mockito does not work with newer Java versions -> disable tests automatically when no working Mockito

Uwe Schindler created SOLR-11606:
------------------------------------

             Summary: Mockito does not work with newer Java versions -> disable tests automatically when no working Mockito
                 Key: SOLR-11606
                 URL: https://issues.apache.org/jira/browse/SOLR-11606
             Project: Solr
          Issue Type: Bug
      Security Level: Public (Default Security Level. Issues are Public)
          Components: Tests
            Reporter: Uwe Schindler
            Assignee: Uwe Schindler
            Priority: Normal
             Fix For: 7.2, master (8.0)


When running Solr's tests with Java versions that are not supported by the Mockito mocking library, it fails with an error message.

We should disable the tests, if the underlying Mockito version does not allow to mock classes, because the Java version is too new. There is already and issue open at ByteBuddy that is the root cause.

The idea here is to use ByteBuddy's ClassFileVersion class to check if mocking is supported. This adds a new method to SolrTestCaseJ4: {{assumeWorkingMockito()}}

Tests that use the Mockito library should add this assume to their tests, to disable them if the mocking is not supported. Instead of using a Java version test, we do this with ByteBuddy, because this is more dynamic (if we update Mockito so it works with newer Java versions, it is automatically working).

At the same time, we should update Mockito/ByteBuddy ASAP when a new version is available.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org