Search in sources :

Example 6 with ProjectData

use of org.eclipse.che.plugin.github.ide.load.ProjectData in project che by eclipse.

the class GithubImporterPageViewImpl method setRepositories.

@Override
public void setRepositories(@NotNull List<ProjectData> repositories) {
    // Wraps Array in java.util.List
    List<ProjectData> list = new ArrayList<>();
    for (ProjectData repository : repositories) {
        list.add(repository);
    }
    this.repositories.setRowData(list);
}
Also used : ArrayList(java.util.ArrayList) ProjectData(org.eclipse.che.plugin.github.ide.load.ProjectData)

Example 7 with ProjectData

use of org.eclipse.che.plugin.github.ide.load.ProjectData in project che by eclipse.

the class GithubImporterPagePresenterTest method onRepositorySelectedTest.

@Test
public void onRepositorySelectedTest() {
    ProjectData projectData = new ProjectData("name", "description", "type", new ArrayList<String>(), "repoUrl", "readOnlyUrl");
    presenter.onRepositorySelected(projectData);
    verify(dataObject).setName(eq("name"));
    verify(dataObject).setDescription(eq("description"));
    verify(source).setLocation(eq("repoUrl"));
    verify(view).setProjectName(anyString());
    verify(view).setProjectDescription(anyString());
    verify(view).setProjectUrl(anyString());
    verify(updateDelegate).updateControls();
}
Also used : Matchers.anyString(org.mockito.Matchers.anyString) ProjectData(org.eclipse.che.plugin.github.ide.load.ProjectData) Test(org.junit.Test)

Aggregations

ProjectData (org.eclipse.che.plugin.github.ide.load.ProjectData)7 Test (org.junit.Test)4 Promise (org.eclipse.che.api.promises.client.Promise)3 Matchers.anyString (org.mockito.Matchers.anyString)3 Mockito.doAnswer (org.mockito.Mockito.doAnswer)3 InvocationOnMock (org.mockito.invocation.InvocationOnMock)3 Answer (org.mockito.stubbing.Answer)3 ArrayList (java.util.ArrayList)2 ImageResourceCell (com.google.gwt.cell.client.ImageResourceCell)1 SafeHtmlCell (com.google.gwt.cell.client.SafeHtmlCell)1 ImageResource (com.google.gwt.resources.client.ImageResource)1 SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)1 SafeHtmlBuilder (com.google.gwt.safehtml.shared.SafeHtmlBuilder)1 Column (com.google.gwt.user.cellview.client.Column)1 SelectionChangeEvent (com.google.gwt.view.client.SelectionChangeEvent)1 SingleSelectionModel (com.google.gwt.view.client.SingleSelectionModel)1 ProfileDto (org.eclipse.che.api.user.shared.dto.ProfileDto)1 CurrentUser (org.eclipse.che.ide.api.app.CurrentUser)1 GitHubRepository (org.eclipse.che.plugin.github.shared.GitHubRepository)1 OAuthStatus (org.eclipse.che.security.oauth.OAuthStatus)1