You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by "Suman Karumuri (JIRA)" <ji...@apache.org> on 2013/11/04 23:25:19 UTC
[jira] [Created] (MESOS-796) org.apache.mesos.Log isn't mockable
Suman Karumuri created MESOS-796:
------------------------------------
Summary: org.apache.mesos.Log isn't mockable
Key: MESOS-796
URL: https://issues.apache.org/jira/browse/MESOS-796
Project: Mesos
Issue Type: Bug
Components: java-api
Reporter: Suman Karumuri
Currently, the Log class (org.apache.mesos.Log) in the Java API has a static initializer that calls MesosNativeLibrary.load(). This static initialization causes issues when mocking this class.
Per JLS, using the Class name shouldn't trigger the static initialization. However, the ClassProxy in EasyMock performs some reflection tricks which trigger the static initializer. Since the static initializer needs a native library which would be otherwise be linked dynamically in it's path, it makes our unit tests flaky.
After considering a few possibilities, the cleanest solution seems to be
(a) Make org.apache.mesos.Log an interface so users using the Java-API can mock the interface. or
(b) Add a new interface that org.apache.mesos.Log implements, which the clients can use for mocking.
--
This message was sent by Atlassian JIRA
(v6.1#6144)