use of com.google.gwt.user.client.ui.AcceptsOneWidget in project che by eclipse.
the class ZipImporterPagePresenterTest method testGo.
@Test
public void testGo() {
AcceptsOneWidget container = mock(AcceptsOneWidget.class);
when(parameters.get(SKIP_FIRST_LEVEL_PARAM_NAME)).thenReturn("true");
presenter.go(container);
verify(container).setWidget(eq(view));
verify(view).setProjectName(anyString());
verify(view).setProjectDescription(anyString());
verify(view).setProjectUrl(anyString());
verify(view).setSkipFirstLevel(anyBoolean());
verify(view).setInputsEnableState(eq(true));
verify(view).focusInUrlInput();
}
use of com.google.gwt.user.client.ui.AcceptsOneWidget in project che by eclipse.
the class FindResultPresenterTest method methodGoShouldBePerformed.
@Test
public void methodGoShouldBePerformed() {
AcceptsOneWidget container = mock(AcceptsOneWidget.class);
findResultPresenter.go(container);
verify(container).setWidget(view);
}
use of com.google.gwt.user.client.ui.AcceptsOneWidget in project che by eclipse.
the class TestSelectionAgent method shouldFireEventWhenSelectionInActivePartChanged.
/**
* If selection chang in active part, Selection Agent should fire
* an Event
*/
@Test
public void shouldFireEventWhenSelectionInActivePartChanged() {
AbstractPartPresenter part = new AbstractPartPresenter() {
@Override
public void go(AcceptsOneWidget container) {
}
@Override
public String getTitleToolTip() {
return null;
}
@Override
public SVGResource getTitleImage() {
return null;
}
@Override
public String getTitle() {
return null;
}
@Override
public IsWidget getView() {
return null;
}
};
// fire event, for agent to get information about active part
eventBus.fireEvent(new ActivePartChangedEvent(part));
SelectionChangedHandler handler = mock(SelectionChangedHandler.class);
eventBus.addHandler(SelectionChangedEvent.TYPE, handler);
part.setSelection(mock(Selection.class));
verify(handler).onSelectionChanged((SelectionChangedEvent) any());
}
use of com.google.gwt.user.client.ui.AcceptsOneWidget in project che by eclipse.
the class TestSelectionAgent method shouldNOTFireEventWhenSelectionInNONActivePartChanged.
/**
* If selection chang in non-active part, no events should be fired by
* Selection Agent
*/
@Test
public void shouldNOTFireEventWhenSelectionInNONActivePartChanged() {
AbstractPartPresenter firstPart = new AbstractPartPresenter() {
@Override
public void go(AcceptsOneWidget container) {
}
@Override
public String getTitleToolTip() {
return null;
}
@Override
public SVGResource getTitleImage() {
return null;
}
@Override
public String getTitle() {
return null;
}
@Override
public IsWidget getView() {
return null;
}
};
// fire event, for agent to get information about active part
eventBus.fireEvent(new ActivePartChangedEvent(firstPart));
// change part
eventBus.fireEvent(new ActivePartChangedEvent(mock(PartPresenter.class)));
SelectionChangedHandler handler = mock(SelectionChangedHandler.class);
eventBus.addHandler(SelectionChangedEvent.TYPE, handler);
// call setSelection on the first Part.
firstPart.setSelection(mock(Selection.class));
verifyZeroInteractions(handler);
}
use of com.google.gwt.user.client.ui.AcceptsOneWidget in project che by eclipse.
the class GdbConfigurationPagePresenterTest method testGo.
@Test
public void testGo() throws Exception {
AcceptsOneWidget container = Mockito.mock(AcceptsOneWidget.class);
pagePresenter.go(container);
verify(appContext).getWorkspace();
verify(container).setWidget(eq(pageView));
verify(configuration, atLeastOnce()).getHost();
verify(configuration, atLeastOnce()).getPort();
verify(configuration, atLeastOnce()).getConnectionProperties();
verify(pageView).setHost(eq(HOST));
verify(pageView).setPort(eq(PORT));
verify(pageView).setBinaryPath(anyString());
verify(pageView).setDevHost(eq(false));
verify(pageView).setPortEnableState(eq(true));
verify(pageView).setHostEnableState(eq(true));
}
Aggregations