public class FakeMessagesMaker extends Object implements InvocationHandler
Messages
interface via
reflection, for use in JUnit tests. (This will not work in GWTTestCase.) All
calls to the returned object return the method name followed by the passed
parameters as a list surrounded by [].
Note that the default message text is very consciously not made available through the fake, to help tests ensure that specific translations of localized text are not relied upon.
Sample use:
interface MyMessages extends Messages { @DefaultMessage("Isn''t this the fakiest?") @Description("A sample message to be tested.") String myMessage(); } public void testSimple() { MyMessages messages = FakeMessagesMaker.create(MyMessages.class); assertEquals("myMessage", messages.myMessage()); }
Constructor and Description |
---|
FakeMessagesMaker() |
Copyright © 2016. All rights reserved.