diff options
author | Kevin Sawicki | 2011-05-12 00:59:05 +0000 |
---|---|---|
committer | Kevin Sawicki | 2011-05-12 00:59:05 +0000 |
commit | 0d93fc473545becca69c0595289ac472afaea68f (patch) | |
tree | d13058e842837a7feb2375cb0a48c798976570ae /org.eclipse.mylyn.github.ui/src | |
parent | 31e119034516c7674964a6c7c87fedefd57376b8 (diff) | |
download | egit-github-0d93fc473545becca69c0595289ac472afaea68f.tar.gz egit-github-0d93fc473545becca69c0595289ac472afaea68f.tar.xz egit-github-0d93fc473545becca69c0595289ac472afaea68f.zip |
Add new core GitHub API plug-in and unit tests.
This moves the current API unit tests from the mylyn
test plug-in and creates a new package of live tests
that can be run directly against a GitHub instance.
The new core API plug-in has no Eclipse dependencies
and only relies on GSON and Apache Commons HTTP client.
Change-Id: I2b4dc436760818e5fcf1503f7ba80e351aca4fb6
Signed-off-by: Kevin Sawicki <kevin@github.com>
Diffstat (limited to 'org.eclipse.mylyn.github.ui/src')
9 files changed, 23 insertions, 26 deletions
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/CreateGistHandler.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/CreateGistHandler.java index e4371b45..e6b1df26 100644 --- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/CreateGistHandler.java +++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/CreateGistHandler.java @@ -20,13 +20,13 @@ import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.CoreException; +import org.eclipse.egit.github.core.client.GitHubClient; +import org.eclipse.egit.github.core.service.GistService; import org.eclipse.jface.text.ITextSelection; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.mylyn.commons.net.AuthenticationCredentials; import org.eclipse.mylyn.commons.net.AuthenticationType; -import org.eclipse.mylyn.github.internal.GistService; -import org.eclipse.mylyn.github.internal.GitHubClient; import org.eclipse.mylyn.internal.github.core.gist.GistConnector; import org.eclipse.mylyn.tasks.core.TaskRepository; import org.eclipse.mylyn.tasks.ui.TasksUi; diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/CreateGistJob.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/CreateGistJob.java index db87251d..4797d0bc 100644 --- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/CreateGistJob.java +++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/CreateGistJob.java @@ -15,14 +15,12 @@ import java.util.Collections; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.mylyn.github.internal.Gist; -import org.eclipse.mylyn.github.internal.GistFile; -import org.eclipse.mylyn.github.internal.GistService; -import org.eclipse.mylyn.github.internal.User; -import org.eclipse.swt.widgets.Display; +import org.eclipse.egit.github.core.Gist; +import org.eclipse.egit.github.core.GistFile; +import org.eclipse.egit.github.core.User; +import org.eclipse.egit.github.core.service.GistService; import org.eclipse.ui.PlatformUI; public class CreateGistJob extends Job { diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GistNotificationPopup.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GistNotificationPopup.java index 71adb7f6..deefcf7a 100644 --- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GistNotificationPopup.java +++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GistNotificationPopup.java @@ -12,7 +12,7 @@ package org.eclipse.mylyn.github.ui.internal; import java.util.Set; -import org.eclipse.mylyn.github.internal.Gist; +import org.eclipse.egit.github.core.Gist; import org.eclipse.mylyn.internal.github.core.gist.GistConnector; import org.eclipse.mylyn.internal.provisional.commons.ui.AbstractNotificationPopup; import org.eclipse.mylyn.tasks.core.TaskRepository; @@ -24,7 +24,6 @@ import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.program.Program; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositoryConnectorUI.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositoryConnectorUI.java index f536654d..c82ffdee 100644 --- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositoryConnectorUI.java +++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositoryConnectorUI.java @@ -17,6 +17,7 @@ import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.eclipse.egit.github.core.Repository; import org.eclipse.jface.text.Region; import org.eclipse.jface.text.hyperlink.IHyperlink; import org.eclipse.jface.text.hyperlink.URLHyperlink; @@ -24,7 +25,6 @@ import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.wizard.IWizard; import org.eclipse.mylyn.github.internal.GitHub; import org.eclipse.mylyn.github.internal.GitHubRepositoryConnector; -import org.eclipse.mylyn.github.internal.Repository; import org.eclipse.mylyn.tasks.core.IRepositoryQuery; import org.eclipse.mylyn.tasks.core.ITaskMapping; import org.eclipse.mylyn.tasks.core.TaskRepository; diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositoryQueryPage.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositoryQueryPage.java index 1a2d9410..ba421dfa 100644 --- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositoryQueryPage.java +++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositoryQueryPage.java @@ -21,6 +21,9 @@ import java.util.List; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.egit.github.core.Milestone; +import org.eclipse.egit.github.core.service.IssueService; +import org.eclipse.egit.github.core.util.LabelComparator; import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.jface.layout.GridDataFactory; import org.eclipse.jface.layout.GridLayoutFactory; @@ -32,9 +35,6 @@ import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.mylyn.commons.net.Policy; import org.eclipse.mylyn.github.internal.GitHubRepositoryConnector; -import org.eclipse.mylyn.github.internal.IssueService; -import org.eclipse.mylyn.github.internal.LabelComparator; -import org.eclipse.mylyn.github.internal.Milestone; import org.eclipse.mylyn.github.internal.QueryUtils; import org.eclipse.mylyn.internal.provisional.commons.ui.CommonUiUtil; import org.eclipse.mylyn.internal.provisional.commons.ui.ICoreRunnable; @@ -282,11 +282,11 @@ public class GitHubRepositoryQueryPage extends AbstractRepositoryQueryPage { TaskRepository repository = getTaskRepository(); boolean hasLabels = connector.hasCachedLabels(repository); if (hasLabels) { - List<org.eclipse.mylyn.github.internal.Label> labels = connector + List<org.eclipse.egit.github.core.Label> labels = connector .getLabels(repository); Collections.sort(labels, new LabelComparator()); List<String> labelNames = new ArrayList<String>(labels.size()); - for (org.eclipse.mylyn.github.internal.Label label : labels) + for (org.eclipse.egit.github.core.Label label : labels) labelNames.add(label.getName()); this.labelsViewer.setInput(labelNames); } diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositorySettingsPage.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositorySettingsPage.java index 77749bc7..84550f68 100644 --- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositorySettingsPage.java +++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositorySettingsPage.java @@ -20,13 +20,13 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; +import org.eclipse.egit.github.core.Repository; +import org.eclipse.egit.github.core.client.GitHubClient; +import org.eclipse.egit.github.core.service.IssueService; import org.eclipse.jface.dialogs.IMessageProvider; import org.eclipse.mylyn.commons.net.AuthenticationCredentials; import org.eclipse.mylyn.commons.net.AuthenticationType; import org.eclipse.mylyn.github.internal.GitHub; -import org.eclipse.mylyn.github.internal.GitHubClient; -import org.eclipse.mylyn.github.internal.IssueService; -import org.eclipse.mylyn.github.internal.Repository; import org.eclipse.mylyn.internal.tasks.core.IRepositoryConstants; import org.eclipse.mylyn.tasks.core.TaskRepository; import org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage; diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/ImportRepositoriesWizard.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/ImportRepositoriesWizard.java index bae092b5..660f43fd 100644 --- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/ImportRepositoriesWizard.java +++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/ImportRepositoriesWizard.java @@ -10,13 +10,13 @@ *******************************************************************************/ package org.eclipse.mylyn.github.ui.internal; +import org.eclipse.egit.github.core.Repository; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.wizard.IWizardPage; import org.eclipse.jface.wizard.Wizard; import org.eclipse.mylyn.commons.net.AuthenticationCredentials; import org.eclipse.mylyn.commons.net.AuthenticationType; import org.eclipse.mylyn.github.internal.GitHub; -import org.eclipse.mylyn.github.internal.Repository; import org.eclipse.mylyn.internal.github.core.gist.GistConnector; import org.eclipse.mylyn.internal.github.ui.gist.GistRepositorySettingsPage; import org.eclipse.mylyn.internal.github.ui.gist.Messages; diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/RepositorySelectionWizardPage.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/RepositorySelectionWizardPage.java index b67870f7..2c8293b8 100644 --- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/RepositorySelectionWizardPage.java +++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/RepositorySelectionWizardPage.java @@ -19,6 +19,10 @@ import java.util.List; import org.apache.commons.httpclient.HostConfiguration; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.egit.github.core.Repository; +import org.eclipse.egit.github.core.client.GitHubClient; +import org.eclipse.egit.github.core.client.IGitHubConstants; +import org.eclipse.egit.github.core.service.RepositoryService; import org.eclipse.egit.ui.internal.FilteredCheckboxTree; import org.eclipse.jface.layout.GridDataFactory; import org.eclipse.jface.layout.GridLayoutFactory; @@ -30,10 +34,6 @@ import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.ViewerSorter; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.mylyn.github.internal.GitHub; -import org.eclipse.mylyn.github.internal.GitHubClient; -import org.eclipse.mylyn.github.internal.IGitHubConstants; -import org.eclipse.mylyn.github.internal.Repository; -import org.eclipse.mylyn.github.internal.RepositoryService; import org.eclipse.mylyn.internal.github.core.gist.GistConnector; import org.eclipse.mylyn.tasks.core.TaskRepository; import org.eclipse.mylyn.tasks.ui.TasksUi; diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistRepositorySettingsPage.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistRepositorySettingsPage.java index 9e8d795f..af467e22 100644 --- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistRepositorySettingsPage.java +++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistRepositorySettingsPage.java @@ -18,10 +18,10 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; +import org.eclipse.egit.github.core.client.GitHubClient; +import org.eclipse.egit.github.core.service.GistService; import org.eclipse.jface.dialogs.IMessageProvider; import org.eclipse.mylyn.commons.net.AuthenticationType; -import org.eclipse.mylyn.github.internal.GistService; -import org.eclipse.mylyn.github.internal.GitHubClient; import org.eclipse.mylyn.github.ui.internal.GitHubUi; import org.eclipse.mylyn.internal.github.core.gist.GistConnector; import org.eclipse.mylyn.internal.tasks.core.IRepositoryConstants; |