[ 
https://issues.apache.org/jira/browse/MESOS-796?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benjamin Mahler updated MESOS-796:
----------------------------------

    Component/s: replicated log

> 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, replicated log
>            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)

Reply via email to