Questions tagged [gwtmockito]
15 questions
5
votes
1 answer
GWTMockito UnsatisfiedLinkError
I've done most of my GWT testing MVP-style, without testing widgets. I'd like to be able to build more complex widgets and test them well without using GwtTestCase (slow).
Out of curiosity, I tried an extremely simple test. Given a very simple…

Geoffrey Wiseman
- 5,459
- 3
- 34
- 52
3
votes
0 answers
JaCoCo integration with gwtmockito
I am using JaCoCo maven plugin for the test coverage reports. It works with MockitoJUnitRunner, but when I use it with tests that run with GwtMockitoTestRunner (annotated @RunWith(GwtMockitoTestRunner.class)) I always get zero coverage. In the…

J. Soltes
- 31
- 2
3
votes
1 answer
Is it possible to test a method that uses uiBinder XML elements with JUnit?
Here is my problem :
I have a method called desactiveNavLinks that desactive all widgets in my sideBarContainer (HTMLPanel), this method works perfecly. So here is the code of my uiBinder XML :
MainSideBarImpl.ui.xml :

Pintouch
- 2,630
- 1
- 15
- 22
2
votes
2 answers
GWT.create and wrap existing html element
Is it possible to create a TextBox using GWT.create, not the constructor, and wrap an existing HTML element?
I tried:
TextBox text=GWT.create(TextBox.class)
text.setElement(DOM.createInput()) (2)
The above fails on line (2) with "cannot set element…

nlight
- 43
- 4
1
vote
0 answers
gwtmockito with requestbuilder
This is a part of my class, I want to test:
public class PrefPanel extends Composite {
private static PrefPanelUiBinder uiBinder = GWT.create(PrefPanelUiBinder.class);
interface PrefPanelUiBinder extends UiBinder {}
…

klimaschreck
- 11
- 3
1
vote
0 answers
How to run an click event on simple GWT Button via Mockito and make the Test pass
Here is the code:
I know by default this code below overrides the default behavier of the Button as Mock object. So it won't work. I stuck on that.
What's the best practice to pass the Test with an already existing view like that ? How can I run…

TheJavaCoder
- 23
- 5
1
vote
0 answers
Mocking @UiField when using GWTMock and Mockito
I am using GWT2.7 where I have a view that is something like this:
public class InContextSearchView
extends ViewWithUiHandlers
implements InContextSearchPresenter.MyView
{
@UiField
TextBox…

Amit
- 152
- 1
- 2
- 12
1
vote
2 answers
Mockito Verify method not giving consistent results
I'm learning GwtMockito but having trouble getting consistent verify() method results in one of my tests.
I'm trying to test the correct GwtEvents are being fired by my application. So I've mocked the Event Bus like this in my @Before…

GridDragon
- 2,857
- 2
- 33
- 41
0
votes
1 answer
GwtMockito: Single tests pass and multiple fails when using Async-service within tested class. (GwtMock- and GWT.create-related)
I have the following:
ExampleLogic.java (Class that uses an Async-service to do a server call)
ExampleServiceAsync.java (Interface á la GWT)
ExampleService.java (Interface á la GWT to create the async-instance)
ExampleLogicTest (This is where the…

lemoncactus
- 13
- 3
0
votes
0 answers
Simple radio button unit test using gwtmockito/mockito?
I wanted to write a simple unit test avoiding GWTTeseCase for an extension of a radio button.
This is the composite
public class DeselectableRadioButton extends RadioButton {
private Boolean backingValue;
private final class…

user1472672
- 313
- 1
- 9
0
votes
1 answer
GWT Mockito and TestNG
How to use GWT Mockito found here GWT Mockito in parallel with TestNG to test GWT methods ?
Edit:8/5/2015
I have searched over the internet, and i found that GWT Mockito is only used with Junit 4, our company uses TestNG as standard, so we need to…

Ahmed Ibrahim
- 31
- 1
- 7
0
votes
1 answer
GwtMockito - click handlers for many buttons
I have problem with GwtMock and click handlers.
In my unit test I have a field with ClickHandler and Button:
@GwtMock
private ClickHandler clickHandler;
My setUp method looks like:
@Before
public void setUp() {
…

tomasz-mer
- 3,753
- 10
- 50
- 69
0
votes
1 answer
false code coverage reported using GwtMockito
Is there any reason why EclEmma(JaCoCo based) in Eclipse falsely reports the code coverage while using the GwtMockitoTestRunner?
Looking at it's source code, it does install it's own class loader and does byte code manipulation using the Javassist…

Dan L.
- 1,717
- 1
- 21
- 41
0
votes
1 answer
cannot debug GWT native code within gwtmockito
I have a GwtMockitoTestCase and the debugger seems not to enter inside any vanilla GWT class like Widget, ResizeLayoutPanel, etc.
However, when running the same code inside DevMode, the debugger steps correctly through that code.
Does this have to…

Dan L.
- 1,717
- 1
- 21
- 41
0
votes
1 answer
GwtMockito: Is there a way to test Window.open()?
I would like to test that my call of Window.open(String) is with the correct URL (to download a file).
Is there any better way of doing it, besides using a partial mock, like this?
MySUT sut = Mockito.spy(new MySUT());
String expectedURL =…

Niel de Wet
- 7,806
- 9
- 63
- 100