MASON-INTEREST-L Archives

September 2012

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Sean Luke <[log in to unmask]>
Reply To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Date:
Fri, 28 Sep 2012 17:28:03 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (27 lines)
Okay, I just did a recommit for mason with the finals removed.

Sean

On Sep 28, 2012, at 5:04 PM, Sean Luke wrote:

> It *used* to be the case, way back when, that final methods were more likely to get inlined by the JVM and so generally ran much faster.  That's far from the case now.  We oughta get rid of the final restrictions.
> 
> Sean
> 
> On Sep 28, 2012, at 4:17 PM, Ernesto Carrella wrote:
> 
>> Hello everyone,
>> 
>> I am in the process of unit-testing some simulation but I am having some issues with the MersenneTwisterFast.
>> I am using Mockito to stub objects and I want to test the behavior of one of my classes given a very specific list of "true" and "false" returns after calling random.nextBoolean() many times.
>> 
>> The problem is that MersenneTwisterFast depressingly have all its methods as final (why is that, by the way?). So it can't be stubbed. So I can't test what I want (or in fact any test that require me to control the randomizer).
>> Is there any way to control the output so that MersenneTwisterFast gives me back a specific sequence?
>> 
>> It would be so easy to fix if MersenneTwisterFast at least was implementing an interface (I could make a facade object delegate and that would do), but it extend directly from Object so that's not even possible.
>> 
>> Thanks!
>> 
>> Ernesto
> 

ATOM RSS1 RSS2