mesos-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benjamin Mahler (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (MESOS-796) org.apache.mesos.Log isn't mockable
Date Tue, 12 Nov 2013 22:50:17 GMT

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

Mime
View raw message