Search in sources :

Example 11 with AcceptsOneWidget

use of com.google.gwt.user.client.ui.AcceptsOneWidget in project che by eclipse.

the class CustomPagePresenterTest method testGo.

@Test
public void testGo() throws Exception {
    AcceptsOneWidget container = Mockito.mock(AcceptsOneWidget.class);
    arbitraryPagePresenter.go(container);
    verify(container).setWidget(eq(arbitraryPageView));
    verify(command, times(2)).getCommandLine();
    verify(arbitraryPageView).setCommandLine(eq(COMMAND_LINE));
}
Also used : AcceptsOneWidget(com.google.gwt.user.client.ui.AcceptsOneWidget) Test(org.junit.Test)

Example 12 with AcceptsOneWidget

use of com.google.gwt.user.client.ui.AcceptsOneWidget in project che by eclipse.

the class SubversionProjectImporterPresenterTest method testGo.

/**
     * Test for {@link SubversionProjectImporterPresenter#go(AcceptsOneWidget)}.
     *
     * @throws Exception if anything goes wrong
     */
@Test
public void testGo() throws Exception {
    final String importerDescription = "Some description.";
    final AcceptsOneWidget container = mock(AcceptsOneWidget.class);
    final ProjectImporterDescriptor projectImporter = mock(ProjectImporterDescriptor.class);
    when(projectImporter.getDescription()).thenReturn(importerDescription);
    presenter.go(container);
    verify(container).setWidget(eq(view));
    verify(view).setProjectName(anyString());
    verify(view).setProjectDescription(anyString());
    verify(view).setProjectUrl(anyString());
    verify(view).setInputsEnableState(eq(true));
}
Also used : Mockito.anyString(org.mockito.Mockito.anyString) AcceptsOneWidget(com.google.gwt.user.client.ui.AcceptsOneWidget) ProjectImporterDescriptor(org.eclipse.che.api.project.shared.dto.ProjectImporterDescriptor) Test(org.junit.Test)

Example 13 with AcceptsOneWidget

use of com.google.gwt.user.client.ui.AcceptsOneWidget in project che by eclipse.

the class TestResultPresenterTest method methodGoShouldBePerformed.

@Test
public void methodGoShouldBePerformed() {
    AcceptsOneWidget container = mock(AcceptsOneWidget.class);
    testResultPresenter.go(container);
    verify(container).setWidget(view);
}
Also used : AcceptsOneWidget(com.google.gwt.user.client.ui.AcceptsOneWidget) Test(org.junit.Test)

Example 14 with AcceptsOneWidget

use of com.google.gwt.user.client.ui.AcceptsOneWidget in project che by eclipse.

the class NodeJsDebuggerConfigurationPagePresenterTest method testGo.

@Test
public void testGo() throws Exception {
    AcceptsOneWidget container = Mockito.mock(AcceptsOneWidget.class);
    pagePresenter.go(container);
    verify(container).setWidget(eq(pageView));
    verify(configuration, atLeastOnce()).getConnectionProperties();
    verify(pageView).setScriptPath(anyString());
}
Also used : AcceptsOneWidget(com.google.gwt.user.client.ui.AcceptsOneWidget) Test(org.junit.Test)

Example 15 with AcceptsOneWidget

use of com.google.gwt.user.client.ui.AcceptsOneWidget in project che by eclipse.

the class EditorMultiPartStackViewImpl method addPartStack.

@Override
public void addPartStack(@NotNull final EditorPartStack partStack, final EditorPartStack relativePartStack, final Constraints constraints, final double size) {
    AcceptsOneWidget partViewContainer = new AcceptsOneWidget() {

        @Override
        public void setWidget(IsWidget widget) {
            if (relativePartStack == null) {
                rootView = splitEditorPartViewFactory.create(widget);
                splitEditorParts.put(partStack, rootView);
                contentPanel.remove(emptyEditorsPanel);
                contentPanel.add(rootView);
                return;
            }
            SplitEditorPartView relativePartStackView = splitEditorParts.get(relativePartStack);
            if (relativePartStackView == null) {
                Log.error(getClass(), "Can not find container for specified editor");
                return;
            }
            relativePartStackView.split(widget, constraints.direction, size);
            splitEditorParts.put(partStack, relativePartStackView.getReplica());
            splitEditorParts.put(relativePartStack, relativePartStackView.getSpecimen());
        }
    };
    partStack.go(partViewContainer);
}
Also used : IsWidget(com.google.gwt.user.client.ui.IsWidget) AcceptsOneWidget(com.google.gwt.user.client.ui.AcceptsOneWidget)

Aggregations

AcceptsOneWidget (com.google.gwt.user.client.ui.AcceptsOneWidget)27 Test (org.junit.Test)23 IsWidget (com.google.gwt.user.client.ui.IsWidget)3 ProjectImporterDescriptor (org.eclipse.che.api.project.shared.dto.ProjectImporterDescriptor)2 ActivePartChangedEvent (org.eclipse.che.ide.api.event.ActivePartChangedEvent)2 SelectionChangedHandler (org.eclipse.che.ide.api.event.SelectionChangedHandler)2 AbstractPartPresenter (org.eclipse.che.ide.api.parts.AbstractPartPresenter)2 Selection (org.eclipse.che.ide.api.selection.Selection)2 ArrayList (java.util.ArrayList)1 Breakpoint (org.eclipse.che.ide.api.debug.Breakpoint)1 ProcessTreeNode (org.eclipse.che.ide.extension.machine.client.processes.ProcessTreeNode)1 BaseTest (org.eclipse.che.plugin.debugger.ide.BaseTest)1 Matchers.anyString (org.mockito.Matchers.anyString)1 Mockito.anyString (org.mockito.Mockito.anyString)1 Test (org.testng.annotations.Test)1