Skip to content
Browse files

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>
  • Loading branch information...
1 parent 31e1190 commit 0d93fc473545becca69c0595289ac472afaea68f @kevinsawicki kevinsawicki committed May 11, 2011
Showing with 1,110 additions and 349 deletions.
  1. +7 −0 org.eclipse.egit.github.core.tests/.classpath
  2. +2 −0 org.eclipse.egit.github.core.tests/.gitignore
  3. +28 −0 org.eclipse.egit.github.core.tests/.project
  4. +8 −0 org.eclipse.egit.github.core.tests/.settings/org.eclipse.jdt.core.prefs
  5. +18 −0 org.eclipse.egit.github.core.tests/META-INF/MANIFEST.MF
  6. +5 −0 org.eclipse.egit.github.core.tests/build.properties
  7. +2 −0 org.eclipse.egit.github.core.tests/plugin.properties
  8. +46 −0 org.eclipse.egit.github.core.tests/pom.xml
  9. +12 −12 ... org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core}/tests/AllHeadlessTests.java
  10. +5 −4 ...nal → org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests}/CommentTest.java
  11. +5 −4 ... org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests}/GistRevisionTest.java
  12. +21 −14 ...→ org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests}/GistServiceTest.java
  13. +5 −4 ...ternal → org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests}/GistTest.java
  14. +3 −3 ... org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests}/GitHubClientTest.java
  15. +24 −19 ... org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests}/IssueServiceTest.java
  16. +5 −4 ...ernal → org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests}/IssueTest.java
  17. +15 −11 ... org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests}/LabelServiceTest.java
  18. +9 −5 ....eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests}/MilestoneServiceTest.java
  19. +5 −4 ...l → org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests}/MilestoneTest.java
  20. +10 −14 ...clipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests}/PullRequestServiceTest.java
  21. +56 −0 org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/GistTest.java
  22. +59 −0 org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/IssueTest.java
  23. +71 −0 org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/LiveTest.java
  24. +9 −15 ...a → org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/LiveTests.java
  25. +66 −0 org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/PullRequestTest.java
  26. +50 −0 org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/RepositoryTest.java
  27. +7 −0 org.eclipse.egit.github.core/.classpath
  28. +2 −0 org.eclipse.egit.github.core/.gitignore
  29. +28 −0 org.eclipse.egit.github.core/.project
  30. +8 −0 org.eclipse.egit.github.core/.settings/org.eclipse.jdt.core.prefs
  31. +19 −0 org.eclipse.egit.github.core/META-INF/MANIFEST.MF
  32. +5 −0 org.eclipse.egit.github.core/build.properties
  33. +2 −0 org.eclipse.egit.github.core/plugin.properties
  34. +26 −0 org.eclipse.egit.github.core/pom.xml
  35. +69 −0 org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/Assert.java
  36. +1 −1 ...lyn/github/internal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core}/Comment.java
  37. +1 −23 .../github/internal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core}/FieldError.java
  38. +3 −3 .../mylyn/github/internal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core}/Gist.java
  39. +1 −1 ...b/internal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core}/GistChangeStatus.java
  40. +1 −1 ...yn/github/internal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core}/GistFile.java
  41. +1 −1 ...ithub/internal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core}/GistRevision.java
  42. +1 −1 ...internal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core}/IResourceCollector.java
  43. +1 −1 .../internal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core}/IResourceProvider.java
  44. +1 −1 ...se/mylyn/github/internal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core}/Id.java
  45. +1 −1 ...mylyn/github/internal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core}/Issue.java
  46. +1 −1 ...mylyn/github/internal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core}/Label.java
  47. +3 −2 ...ernal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core}/ListResourceCollector.java
  48. +1 −1 ...n/github/internal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core}/Milestone.java
  49. +1 −1 ...github/internal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core}/PullRequest.java
  50. +1 −1 ...ernal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core}/PullRequestDiscussion.java
  51. +2 −1 .../internal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core}/PullRequestMarker.java
  52. +60 −9 .../github/internal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core}/Repository.java
  53. +2 −1 ...ithub/internal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core}/RequestError.java
  54. +1 −1 .../mylyn/github/internal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core}/User.java
  55. +3 −4 ...ternal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client}/DateFormatter.java
  56. +4 −3 ...nternal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client}/GitHubClient.java
  57. +1 −1 ...ternal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client}/GitHubRequest.java
  58. +1 −1 ...ernal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client}/GitHubResponse.java
  59. +11 −1 ...nal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client}/IGitHubConstants.java
  60. +1 −1 ...b/internal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client}/PageLinks.java
  61. +5 −3 ...nternal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client}/PagedRequest.java
  62. +3 −15 ...nal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client}/RequestException.java
  63. +19 −11 ...nternal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service}/GistService.java
  64. +8 −3 ...ernal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service}/GitHubService.java
  65. +37 −31 ...ternal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service}/IssueService.java
  66. +15 −10 ...ternal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service}/LabelService.java
  67. +9 −4 ...al → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service}/MilestoneService.java
  68. +17 −19 ... → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service}/PullRequestService.java
  69. +22 −1 ...l → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service}/RepositoryService.java
  70. +4 −1 ...ternal → org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/util}/LabelComparator.java
  71. +7 −0 org.eclipse.mylyn.github-feature/feature.xml
  72. +2 −4 org.eclipse.mylyn.github.core/META-INF/MANIFEST.MF
  73. +2 −4 org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GitHub.java
  74. +74 −0 org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GitHubException.java
  75. +13 −0 org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GitHubRepositoryConnector.java
  76. +13 −0 org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GitHubTaskDataHandler.java
  77. +5 −5 ...ipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistAttachmentHandler.java
  78. +3 −3 org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistConnector.java
  79. +6 −6 ...clipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistTaskDataHandler.java
  80. +1 −6 org.eclipse.mylyn.github.tests/META-INF/MANIFEST.MF
  81. +0 −19 org.eclipse.mylyn.github.tests/pom.xml
  82. +2 −1 org.eclipse.mylyn.github.ui/META-INF/MANIFEST.MF
  83. +2 −2 org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/CreateGistHandler.java
  84. +4 −6 org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/CreateGistJob.java
  85. +1 −2 org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GistNotificationPopup.java
  86. +1 −1 ...eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositoryConnectorUI.java
  87. +5 −5 org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositoryQueryPage.java
  88. +3 −3 ...clipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositorySettingsPage.java
  89. +1 −1 org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/ImportRepositoriesWizard.java
  90. +4 −4 ...lipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/RepositorySelectionWizardPage.java
  91. +2 −2 ...pse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistRepositorySettingsPage.java
  92. +3 −1 pom.xml
View
7 org.eclipse.egit.github.core.tests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
View
2 org.eclipse.egit.github.core.tests/.gitignore
@@ -0,0 +1,2 @@
+bin
+target
View
28 org.eclipse.egit.github.core.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.egit.github.core.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
View
8 org.eclipse.egit.github.core.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Wed May 11 10:20:50 PDT 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
View
18 org.eclipse.egit.github.core.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.egit.github.core.tests
+Bundle-Version: 0.1.0.qualifier
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Import-Package: com.google.gson;version="1.6.0",
+ com.google.gson.reflect;version="1.6.0",
+ org.apache.commons.httpclient;version="3.1.0",
+ org.mockito;version="1.8.4",
+ org.mockito.runners;version="1.8.4",
+ org.mockito.stubbing;version="1.8.4"
+Require-Bundle: org.eclipse.egit.github.core;bundle-version="0.1.0",
+ org.junit;bundle-version="4.8.1",
+ org.hamcrest;bundle-version="1.1.0",
+ org.objenesis;bundle-version="1.0.0"
+Bundle-Vendor: %providerName
View
5 org.eclipse.egit.github.core.tests/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.properties
View
2 org.eclipse.egit.github.core.tests/plugin.properties
@@ -0,0 +1,2 @@
+pluginName=EGit GitHub API Tests (Incubation)
+providerName=Eclipse EGit
View
46 org.eclipse.egit.github.core.tests/pom.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2011, Chris Aniszczyk <caniszczyk@gmail.com>
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.mylyn.github</groupId>
+ <artifactId>github-parent</artifactId>
+ <version>0.1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.egit.github.core.tests</artifactId>
+ <packaging>eclipse-test-plugin</packaging>
+
+ <name>Eclipse EGit GitHub API Test Plug-in (Incubation)</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.tycho</groupId>
+ <artifactId>maven-osgi-test-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <excludes>
+ <!-- test mojo matches TestProject be default and treats it as PojoTest -->
+ <exclude>**/Test*.class</exclude>
+ </excludes>
+ <useUIHarness>false</useUIHarness>
+ <useUIThread>false</useUIThread>
+ <testSuite>org.eclipse.egit.github.core.tests</testSuite>
+ <testClass>org.eclipse.egit.github.core.tests.AllHeadlessTests</testClass>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
View
24 .../mylyn/github/tests/AllHeadlessTests.java → ...t/github/core/tests/AllHeadlessTests.java
@@ -10,19 +10,19 @@
* Christian Trutz <christian.trutz@gmail.com> - initial contribution
* Chris Aniszczyk <caniszczyk@gmail.com> - initial contribution
*******************************************************************************/
-package org.eclipse.mylyn.github.tests;
+package org.eclipse.egit.github.core.tests;
-import org.eclipse.mylyn.github.internal.CommentTest;
-import org.eclipse.mylyn.github.internal.GistRevisionTest;
-import org.eclipse.mylyn.github.internal.GistServiceTest;
-import org.eclipse.mylyn.github.internal.GistTest;
-import org.eclipse.mylyn.github.internal.GitHubClientTest;
-import org.eclipse.mylyn.github.internal.IssueServiceTest;
-import org.eclipse.mylyn.github.internal.IssueTest;
-import org.eclipse.mylyn.github.internal.LabelServiceTest;
-import org.eclipse.mylyn.github.internal.MilestoneServiceTest;
-import org.eclipse.mylyn.github.internal.MilestoneTest;
-import org.eclipse.mylyn.github.internal.PullRequestServiceTest;
+import org.eclipse.egit.github.core.tests.CommentTest;
+import org.eclipse.egit.github.core.tests.GistRevisionTest;
+import org.eclipse.egit.github.core.tests.GistServiceTest;
+import org.eclipse.egit.github.core.tests.GistTest;
+import org.eclipse.egit.github.core.tests.GitHubClientTest;
+import org.eclipse.egit.github.core.tests.IssueServiceTest;
+import org.eclipse.egit.github.core.tests.IssueTest;
+import org.eclipse.egit.github.core.tests.LabelServiceTest;
+import org.eclipse.egit.github.core.tests.MilestoneServiceTest;
+import org.eclipse.egit.github.core.tests.MilestoneTest;
+import org.eclipse.egit.github.core.tests.PullRequestServiceTest;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
View
9 ...se/mylyn/github/internal/CommentTest.java → ...e/egit/github/core/tests/CommentTest.java
@@ -8,17 +8,18 @@
* Contributors:
* Christian Trutz - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core.tests;
import static org.junit.Assert.assertTrue;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+import org.eclipse.egit.github.core.Comment;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-
/**
* Unit tests for {@link Comment}
*/
View
9 ...lyn/github/internal/GistRevisionTest.java → ...t/github/core/tests/GistRevisionTest.java
@@ -8,17 +8,18 @@
* Contributors:
* Christian Trutz - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core.tests;
import static org.junit.Assert.assertTrue;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+import org.eclipse.egit.github.core.GistRevision;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-
/**
* Unit tests for {@link GistRevision}
*/
View
35 ...ylyn/github/internal/GistServiceTest.java → ...it/github/core/tests/GistServiceTest.java
@@ -8,26 +8,33 @@
* Contributors:
* Christian Trutz - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core.tests;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.verify;
+import com.google.gson.reflect.TypeToken;
+
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.eclipse.core.runtime.AssertionFailedException;
+import org.eclipse.egit.github.core.Comment;
+import org.eclipse.egit.github.core.Gist;
+import org.eclipse.egit.github.core.User;
+import org.eclipse.egit.github.core.client.GitHubClient;
+import org.eclipse.egit.github.core.client.GitHubRequest;
+import org.eclipse.egit.github.core.client.GitHubResponse;
+import org.eclipse.egit.github.core.service.GistService;
+import org.eclipse.egit.github.core.service.IssueService;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
-import com.google.gson.reflect.TypeToken;
-
/**
* Unit tests for {@link GistService}
*/
@@ -49,12 +56,12 @@ public void before() throws IOException {
gistService = new GistService(gitHubClient);
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void constructor_NullArgument() {
new GistService(null);
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void getGist_NullId() throws IOException {
gistService.getGist(null);
}
@@ -65,7 +72,7 @@ public void getGist_OK() throws IOException {
verify(gitHubClient).get(any(GitHubRequest.class));
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void getGists_NullUser() throws IOException {
gistService.getGists(null);
}
@@ -76,7 +83,7 @@ public void getGists_OK() throws IOException {
verify(gitHubClient).get(any(GitHubRequest.class));
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void createGist_NullGist() throws IOException {
gistService.createGist(null);
}
@@ -99,7 +106,7 @@ public void createGist_NonNullUser() throws IOException {
verify(gitHubClient).post("/users/test_user/gists", gist, Gist.class);
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void createGist_NonNullUser_NullLogin() throws IOException {
Gist gist = new Gist();
User user = new User();
@@ -108,12 +115,12 @@ public void createGist_NonNullUser_NullLogin() throws IOException {
gistService.createGist(gist);
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void updateGist_NullGist() throws IOException {
gistService.updateGist(null);
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void updateGist_NullId() throws IOException {
Gist gist = new Gist();
gist.setId(null);
@@ -128,12 +135,12 @@ public void updateGist_OK() throws IOException {
verify(gitHubClient).post("/gists/123", gist, Gist.class);
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void createComment_NullGistId() throws IOException {
gistService.createComment(null, "not null");
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void createComment_NullComment() throws IOException {
gistService.createComment("not null", null);
}
@@ -147,7 +154,7 @@ public void createComment_OK() throws IOException {
verify(gitHubClient).post("/gists/1/comments", params, Comment.class);
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void getComments_NullGistId() throws IOException {
gistService.getComments(null);
}
View
9 ...lipse/mylyn/github/internal/GistTest.java → ...ipse/egit/github/core/tests/GistTest.java
@@ -8,17 +8,18 @@
* Contributors:
* Christian Trutz - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core.tests;
import static org.junit.Assert.assertTrue;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+import org.eclipse.egit.github.core.Gist;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-
/**
* Unit tests for {@link Gist}
*/
View
6 ...lyn/github/internal/GitHubClientTest.java → ...t/github/core/tests/GitHubClientTest.java
@@ -8,9 +8,9 @@
* Contributors:
* Christian Trutz - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core.tests;
-import org.eclipse.core.runtime.AssertionFailedException;
+import org.eclipse.egit.github.core.client.GitHubClient;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
@@ -19,7 +19,7 @@
@RunWith(MockitoJUnitRunner.class)
public class GitHubClientTest {
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void constructor_NullArgument() {
new GitHubClient(null);
}
View
43 ...lyn/github/internal/IssueServiceTest.java → ...t/github/core/tests/IssueServiceTest.java
@@ -8,7 +8,7 @@
* Contributors:
* Christian Trutz - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core.tests;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.doReturn;
@@ -18,7 +18,12 @@
import java.util.HashMap;
import java.util.Map;
-import org.eclipse.core.runtime.AssertionFailedException;
+import org.eclipse.egit.github.core.Comment;
+import org.eclipse.egit.github.core.Issue;
+import org.eclipse.egit.github.core.client.GitHubClient;
+import org.eclipse.egit.github.core.client.GitHubRequest;
+import org.eclipse.egit.github.core.client.GitHubResponse;
+import org.eclipse.egit.github.core.service.IssueService;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -46,22 +51,22 @@ public void before() throws IOException {
issueService = new IssueService(gitHubClient);
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void constructor_NullArgument() {
new IssueService(null);
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void getIssue_NullUser() throws IOException {
issueService.getIssue(null, "not null", "not null");
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void getIssue_NullRepository() throws IOException {
issueService.getIssue("not null", null, "not null");
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void getIssue_NullId() throws IOException {
issueService.getIssue("not null", "not null", null);
}
@@ -72,17 +77,17 @@ public void getIssue_OK() throws IOException {
verify(gitHubClient).get(any(GitHubRequest.class));
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void getComments_NullUser() throws IOException {
issueService.getComments(null, "not null", "not null");
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void getComments_NullRepository() throws IOException {
issueService.getComments("not null", null, "not null");
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void getComments_NullId() throws IOException {
issueService.getComments("not null", "not null", null);
}
@@ -93,12 +98,12 @@ public void getComments_OK() throws IOException {
verify(gitHubClient).get(any(GitHubRequest.class));
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void getIssues_NullUser() throws IOException {
issueService.getIssues(null, "not null", null);
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void getIssues_NullRepository() throws IOException {
issueService.getIssues("not null", null, null);
}
@@ -109,12 +114,12 @@ public void getIssues_OK() throws IOException {
verify(gitHubClient).get(any(GitHubRequest.class));
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void createIssue_NullUser() throws IOException {
issueService.createIssue(null, "not null", null);
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void createIssue_NullRepository() throws IOException {
issueService.createIssue("not null", null, null);
}
@@ -126,17 +131,17 @@ public void createIssue_NullIssue() throws IOException {
new HashMap<String, String>(), Issue.class);
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void editIssue_NullUser() throws IOException {
issueService.editIssue(null, "not null", null);
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void editIssue_NullRepository() throws IOException {
issueService.editIssue("not null", null, null);
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void editIssue_NullIssue() throws IOException {
issueService.editIssue("not null", "not null", null);
}
@@ -158,17 +163,17 @@ public void editIssue_OK() throws IOException {
params, Issue.class);
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void createComment_NullUser() throws IOException {
issueService.createComment(null, "not null", "not null", "not null");
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void createComment_NullRepository() throws IOException {
issueService.createComment("not null", null, "not null", "not null");
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void createComment_NullIssueId() throws IOException {
issueService.createComment("not null", "not null", null, "not null");
}
View
9 ...ipse/mylyn/github/internal/IssueTest.java → ...pse/egit/github/core/tests/IssueTest.java
@@ -8,17 +8,18 @@
* Contributors:
* Christian Trutz - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core.tests;
import static org.junit.Assert.assertTrue;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+import org.eclipse.egit.github.core.Issue;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-
/**
* Unit tests for {@link Issue}
*/
View
26 ...lyn/github/internal/LabelServiceTest.java → ...t/github/core/tests/LabelServiceTest.java
@@ -8,7 +8,7 @@
* Contributors:
* Christian Trutz - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core.tests;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.doReturn;
@@ -20,7 +20,11 @@
import java.util.LinkedList;
import java.util.List;
-import org.eclipse.core.runtime.AssertionFailedException;
+import org.eclipse.egit.github.core.Label;
+import org.eclipse.egit.github.core.client.GitHubClient;
+import org.eclipse.egit.github.core.client.GitHubRequest;
+import org.eclipse.egit.github.core.client.GitHubResponse;
+import org.eclipse.egit.github.core.service.LabelService;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -48,17 +52,17 @@ public void before() throws IOException {
labelService = new LabelService(gitHubClient);
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void constructor_NullArgument() {
new LabelService(null);
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void getLabels_NullUser() throws IOException {
labelService.getLabels(null, "not null");
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void getLabels_NullRepository() throws IOException {
labelService.getLabels("not null", null);
}
@@ -71,19 +75,19 @@ public void getLabels_OK() throws IOException {
verify(gitHubClient).get(any(GitHubRequest.class));
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void setLabels_NullUser() throws IOException {
labelService.setLabels(null, "not null", "not null",
new LinkedList<Label>());
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void setLabels_NullRepository() throws IOException {
labelService.setLabels("not null", null, "not null",
new LinkedList<Label>());
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void setLabels_NullIssueId() throws IOException {
labelService.setLabels("not null", "not null", null,
new LinkedList<Label>());
@@ -110,17 +114,17 @@ public void setLabels_OK() throws IOException {
labelsToken.getType());
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void createLabel_NullUser() throws IOException {
labelService.createLabel(null, "not null", new Label());
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void createLabel_NullRepository() throws IOException {
labelService.createLabel("not null", null, new Label());
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void createLabel_NullLabel() throws IOException {
labelService.createLabel("not null", "not null", null);
}
View
14 ...github/internal/MilestoneServiceTest.java → ...thub/core/tests/MilestoneServiceTest.java
@@ -8,7 +8,7 @@
* Contributors:
* Christian Trutz - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core.tests;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.doReturn;
@@ -19,7 +19,11 @@
import java.io.IOException;
import java.util.List;
-import org.eclipse.core.runtime.AssertionFailedException;
+import org.eclipse.egit.github.core.Milestone;
+import org.eclipse.egit.github.core.client.GitHubClient;
+import org.eclipse.egit.github.core.client.GitHubRequest;
+import org.eclipse.egit.github.core.client.GitHubResponse;
+import org.eclipse.egit.github.core.service.MilestoneService;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -47,17 +51,17 @@ public void before() throws IOException {
milestoneService = new MilestoneService(gitHubClient);
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void constructor_NullArgument() {
new MilestoneService(null);
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void getMilestones_NullUser() throws IOException {
milestoneService.getMilestones(null, "not null", "not null");
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void getMilestones_NullRepository() throws IOException {
milestoneService.getMilestones("not null", null, "not null");
}
View
9 .../mylyn/github/internal/MilestoneTest.java → ...egit/github/core/tests/MilestoneTest.java
@@ -8,17 +8,18 @@
* Contributors:
* Christian Trutz - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core.tests;
import static org.junit.Assert.assertTrue;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+import org.eclipse.egit.github.core.Milestone;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-
/**
* Unit tests for {@link Milestone}
*/
View
24 ...thub/internal/PullRequestServiceTest.java → ...ub/core/tests/PullRequestServiceTest.java
@@ -8,13 +8,15 @@
* Contributors:
* Christian Trutz - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core.tests;
import static org.mockito.Mockito.when;
import java.io.IOException;
-import org.eclipse.core.runtime.AssertionFailedException;
+import org.eclipse.egit.github.core.Repository;
+import org.eclipse.egit.github.core.client.GitHubClient;
+import org.eclipse.egit.github.core.service.PullRequestService;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
@@ -42,44 +44,38 @@ public void before() {
pullRequestService = new PullRequestService(gitHubClient);
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void constructor_NullArgument() {
new PullRequestService(null);
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void getPullRequest_NullRepository() throws IOException {
pullRequestService.getPullRequest(null, "not null");
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void getPullRequest_NullId() throws IOException {
pullRequestService.getPullRequest(repository, null);
}
- @Test(expected = AssertionFailedException.class)
- public void getPullRequest_NullRepositoryId() throws IOException {
- when(repository.getId()).thenReturn(null);
- pullRequestService.getPullRequest(repository, "test_id");
- }
-
@Test
@Ignore
public void getPullRequest_OK() throws IOException {
// the OK unit test is not possible with Mockito, but with JMockit
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void getPullRequests_NullRepository() throws IOException {
pullRequestService.getPullRequests(null, "not null");
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void getPullRequests_NullState() throws IOException {
pullRequestService.getPullRequests(repository, null);
}
- @Test(expected = AssertionFailedException.class)
+ @Test(expected = IllegalArgumentException.class)
public void getPullRequests_NullRepositoryId() throws IOException {
when(repository.getId()).thenReturn(null);
pullRequestService.getPullRequests(repository, "test_state");
View
56 org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/GistTest.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2011 GitHub Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Kevin Sawicki (GitHub Inc.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.egit.github.core.tests.live;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.egit.github.core.Comment;
+import org.eclipse.egit.github.core.Gist;
+import org.eclipse.egit.github.core.GistFile;
+import org.eclipse.egit.github.core.service.GistService;
+
+/**
+ * @author Kevin Sawicki (kevin@github.com)
+ */
+public class GistTest extends LiveTest {
+
+ /**
+ * Test list a user's gists
+ *
+ * @throws IOException
+ */
+ public void testList() throws IOException {
+ GistService service = new GistService(client);
+ Collection<Gist> gists = service.getGists("kevinsawicki");
+ assertNotNull(gists);
+ assertFalse(gists.isEmpty());
+ for (Gist gist : gists) {
+ assertNotNull(gist);
+ assertNotNull(gist.getCreatedAt());
+ assertNotNull(gist.getId());
+ assertNotNull(gist.getFiles());
+ for (GistFile file : gist.getFiles().values()) {
+ assertNotNull(file);
+ }
+ List<Comment> comments = service.getComments(gist.getId());
+ assertNotNull(comments);
+ for (Comment comment : comments) {
+ assertNotNull(comment);
+ assertNotNull(comment.getUrl());
+ assertNotNull(comment.getCreatedAt());
+ assertNotNull(comment.getUpdatedAt());
+ assertNotNull(comment.getUser());
+ }
+ }
+ }
+}
View
59 ...eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/IssueTest.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2011 GitHub Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Kevin Sawicki (GitHub Inc.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.egit.github.core.tests.live;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.egit.github.core.Issue;
+import org.eclipse.egit.github.core.service.IssueService;
+
+/**
+ *
+ */
+public class IssueTest extends LiveTest {
+
+ /**
+ * Test fetching an issue
+ *
+ * @throws IOException
+ */
+ public void testFetch() throws IOException {
+ IssueService service = new IssueService(client);
+ Issue issue = service.getIssue("schacon", "showoff", "1");
+ assertNotNull(issue);
+ assertNotNull(issue.getUpdatedAt());
+ assertNotNull(issue.getCreatedAt());
+ assertTrue(issue.getNumber() > 0);
+ assertNotNull(issue.getBody());
+ assertNotNull(issue.getTitle());
+ assertNotNull(issue.getHtmlUrl());
+ assertTrue(issue.getNumber() >= 0);
+ assertNotNull(issue.getUser());
+ }
+
+ /**
+ * Test fetching multiple issues
+ *
+ * @throws IOException
+ */
+ public void testFetchAll() throws IOException {
+ IssueService service = new IssueService(client);
+ List<Issue> issues = service.getIssues("schacon", "showoff",
+ Collections.singletonMap(IssueService.FILTER_STATE,
+ IssueService.STATE_OPEN));
+ assertFalse(issues.isEmpty());
+ for (Issue issue : issues)
+ assertNotNull(issue);
+ }
+
+}
View
71 org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/LiveTest.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2011 GitHub Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Kevin Sawicki (GitHub Inc.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.egit.github.core.tests.live;
+
+import java.io.IOException;
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.httpclient.HostConfiguration;
+import org.eclipse.egit.github.core.client.GitHubClient;
+
+/**
+ * Base live test class.
+ */
+public abstract class LiveTest extends TestCase {
+
+ /**
+ * Configured client
+ */
+ protected GitHubClient client;
+
+ /**
+ * Configure client
+ *
+ * @param client
+ * @return specified client
+ */
+ protected GitHubClient configure(GitHubClient client) {
+ String user = System.getProperty("github.test.user");
+ String password = System.getProperty("github.test.password");
+ client.setCredentials(user, password);
+ return client;
+ }
+
+ /**
+ * Create client for url
+ *
+ * @param url
+ * @return client
+ * @throws IOException
+ */
+ protected GitHubClient createClient(String url) throws IOException {
+ GitHubClient client = null;
+ if (url != null) {
+ HostConfiguration config = new HostConfiguration();
+ URL parsed = new URL(url);
+ config.setHost(parsed.getHost(), parsed.getPort(),
+ parsed.getProtocol());
+ client = new GitHubClient(config);
+ } else
+ client = new GitHubClient();
+ return configure(client);
+ }
+
+ /**
+ * @see junit.framework.TestCase#setUp()
+ */
+ public void setUp() throws Exception {
+ String testUrl = System.getProperty("github.test.url");
+ this.client = createClient(testUrl);
+ }
+}
View
24 .../github/internal/RepositoryContainer.java → ...git/github/core/tests/live/LiveTests.java
@@ -8,24 +8,18 @@
* Contributors:
* Kevin Sawicki (GitHub Inc.) - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core.tests.live;
-import java.util.List;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
/**
- * Repository container class.
- *
- * @author Kevin Sawicki (kevin@github.com)
+ * All tests against a live GitHub instance.
*/
-public class RepositoryContainer implements IResourceProvider<Repository> {
-
- private List<Repository> repositories;
-
- /**
- * @see org.eclipse.mylyn.github.internal.IResourceProvider#getResources()
- */
- public List<Repository> getResources() {
- return this.repositories;
- }
+@RunWith(Suite.class)
+@SuiteClasses({ GistTest.class, IssueTest.class, PullRequestTest.class,
+ RepositoryTest.class })
+public class LiveTests {
}
View
66 ...e.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/PullRequestTest.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2011 GitHub Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Kevin Sawicki (GitHub Inc.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.egit.github.core.tests.live;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.eclipse.egit.github.core.PullRequest;
+import org.eclipse.egit.github.core.PullRequestDiscussion;
+import org.eclipse.egit.github.core.PullRequestMarker;
+import org.eclipse.egit.github.core.Repository;
+import org.eclipse.egit.github.core.User;
+import org.eclipse.egit.github.core.client.IGitHubConstants;
+import org.eclipse.egit.github.core.service.PullRequestService;
+
+/**
+ * Live pull request tests
+ */
+public class PullRequestTest extends LiveTest {
+
+ private void checkMarker(PullRequestMarker marker) {
+ assertNotNull(marker);
+ assertNotNull(marker.getLabel());
+ assertNotNull(marker.getSha());
+ assertNotNull(marker.getRef());
+
+ User user = marker.getUser();
+ assertNotNull(user);
+ assertNotNull(user.getName());
+
+ Repository repo = marker.getRepository();
+ assertNotNull(repo);
+ assertNotNull(repo.getOwner());
+ assertNotNull(repo.getName());
+ }
+
+ /**
+ * Test fetching a pull request
+ *
+ * @throws IOException
+ */
+ public void testFetch() throws IOException {
+ PullRequestService service = new PullRequestService(
+ createClient(IGitHubConstants.URL_API_V2));
+ PullRequest request = service.getPullRequest(new Repository(
+ "technoweenie", "faraday"), "15");
+ assertNotNull(request);
+ assertNotNull(request.getHtmlUrl());
+ assertNotNull(request.getDiffUrl());
+ assertNotNull(request.getPatchUrl());
+ checkMarker(request.getHead());
+ checkMarker(request.getBase());
+
+ List<PullRequestDiscussion> discussion = request.getDiscussion();
+ assertNotNull(discussion);
+ assertFalse(discussion.isEmpty());
+ }
+}
View
50 ...se.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/RepositoryTest.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2011 GitHub Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Kevin Sawicki (GitHub Inc.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.egit.github.core.tests.live;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.eclipse.egit.github.core.Repository;
+import org.eclipse.egit.github.core.client.IGitHubConstants;
+import org.eclipse.egit.github.core.service.RepositoryService;
+
+/**
+ * Live repository test
+ */
+public class RepositoryTest extends LiveTest {
+
+ /**
+ * Test fetching a repository
+ *
+ * @throws IOException
+ */
+ public void testFetch() throws IOException {
+ RepositoryService service = new RepositoryService(
+ createClient(IGitHubConstants.URL_API_V2));
+ List<Repository> repos = service.getRepositories("defunkt");
+ assertNotNull(repos);
+ assertFalse(repos.isEmpty());
+ for (Repository repo : repos) {
+ assertNotNull(repo);
+ assertNotNull(repo.getName());
+ assertNotNull(repo.getOwner());
+ assertNotNull(repo.getId());
+ assertNotNull(repo.getUrl());
+ assertNotNull(repo.getCreatedAt());
+ assertTrue(repo.getSize() >= 0);
+ assertTrue(repo.getForks() >= 0);
+ assertTrue(repo.getOpenIssues() >= 0);
+ assertTrue(repo.getWatchers() >= 0);
+ }
+ }
+
+}
View
7 org.eclipse.egit.github.core/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
View
2 org.eclipse.egit.github.core/.gitignore
@@ -0,0 +1,2 @@
+bin
+target
View
28 org.eclipse.egit.github.core/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.egit.github.core</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
View
8 org.eclipse.egit.github.core/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Wed May 11 10:19:26 PDT 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
View
19 org.eclipse.egit.github.core/META-INF/MANIFEST.MF
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Bundle-Localization: plugin
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.egit.github.core
+Bundle-Version: 0.1.0.qualifier
+Bundle-Vendor: %providerName
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Import-Package: com.google.gson;version="1.6.0",
+ com.google.gson.annotations;version="1.6.0",
+ com.google.gson.reflect;version="1.6.0",
+ org.apache.commons.httpclient;version="3.1.0",
+ org.apache.commons.httpclient.auth;version="3.1.0",
+ org.apache.commons.httpclient.methods;version="3.1.0",
+ org.apache.commons.httpclient.protocol;version="3.1.0"
+Export-Package: org.eclipse.egit.github.core,
+ org.eclipse.egit.github.core.client,
+ org.eclipse.egit.github.core.service,
+ org.eclipse.egit.github.core.util
View
5 org.eclipse.egit.github.core/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.properties
View
2 org.eclipse.egit.github.core/plugin.properties
@@ -0,0 +1,2 @@
+pluginName=EGit GitHub API Core (Incubation)
+providerName=Eclipse EGit
View
26 org.eclipse.egit.github.core/pom.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2011, Chris Aniszczyk <caniszczyk@gmail.com>
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+-->
+<project
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <parent>
+ <groupId>org.eclipse.mylyn.github</groupId>
+ <artifactId>github-parent</artifactId>
+ <version>0.1.0-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>org.eclipse.egit.github.core</artifactId>
+ <packaging>eclipse-plugin</packaging>
+ <name>Eclipse EGit GitHub API Core (Incubation)</name>
+ <version>0.1.0-SNAPSHOT</version>
+</project>
View
69 org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/Assert.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2011 GitHub Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Kevin Sawicki (GitHub Inc.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.egit.github.core;
+
+/**
+ *
+ */
+public abstract class Assert {
+
+ /**
+ * Throw an {@link IllegalArgumentException} if the specified object is
+ * null.
+ *
+ * @param message
+ * @param object
+ * @throws IllegalArgumentException
+ */
+ public static void notNull(String message, Object object)
+ throws IllegalArgumentException {
+ if (object == null)
+ throw new IllegalArgumentException(message);
+ }
+
+ /**
+ * Throw an {@link IllegalArgumentException} if the specified object is
+ * null.
+ *
+ * @param object
+ * @throws IllegalArgumentException
+ */
+ public static void notNull(Object object) throws IllegalArgumentException {
+ notNull("Illegal null argument", object); //$NON-NLS-1$
+ }
+
+ /**
+ * Throw an {@link IllegalArgumentException} if the specified string is
+ * empty. This method does not check if the string is null.
+ * {@link #notNull(Object)} should be used to first assert the string is
+ * non-null if that is a requirement of the argument.
+ *
+ * @param message
+ * @param string
+ * @throws IllegalArgumentException
+ */
+ public static void notEmpty(String message, String string)
+ throws IllegalArgumentException {
+ if (string.length() == 0)
+ throw new IllegalArgumentException(message);
+ }
+
+ /**
+ * Throw an {@link IllegalArgumentException} if the specified string is null
+ * or empty.
+ *
+ * @param string
+ * @throws IllegalArgumentException
+ */
+ public static void notEmpty(String string) throws IllegalArgumentException {
+ notEmpty("Illegal empty string argument", string); //$NON-NLS-1$
+ }
+}
View
2 ...clipse/mylyn/github/internal/Comment.java → ...org/eclipse/egit/github/core/Comment.java
@@ -8,7 +8,7 @@
* Contributors:
* Kevin Sawicki (GitHub Inc.) - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core;
import java.util.Date;
View
24 ...pse/mylyn/github/internal/FieldError.java → .../eclipse/egit/github/core/FieldError.java
@@ -8,9 +8,8 @@
* Contributors:
* Kevin Sawicki (GitHub Inc.) - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core;
-import java.text.MessageFormat;
/**
* Field error
@@ -73,25 +72,4 @@ public String getValue() {
return this.value;
}
- /**
- * Format into human-readable error message
- *
- * @return error
- */
- public String format() {
- if (CODE_INVALID.equals(code))
- if (value != null)
- return MessageFormat
- .format(Messages.FieldError_InvalidFieldWithValue,
- value, field);
- else
- return MessageFormat.format(Messages.FieldError_InvalidField,
- field, value);
- else if (CODE_MISSING_FIELD.equals(code))
- return MessageFormat
- .format(Messages.FieldError_MissingField, field);
- else
- return MessageFormat.format(Messages.FieldError_ResourceError,
- field, resource);
- }
}
View
6 ...g/eclipse/mylyn/github/internal/Gist.java → ...rc/org/eclipse/egit/github/core/Gist.java
@@ -8,14 +8,14 @@
* Contributors:
* Kevin Sawicki (GitHub Inc.) - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core;
+
+import com.google.gson.annotations.SerializedName;
import java.util.Date;
import java.util.List;
import java.util.Map;
-import com.google.gson.annotations.SerializedName;
-
/**
* GitHub gist class.
*/
View
2 ...lyn/github/internal/GistChangeStatus.java → ...se/egit/github/core/GistChangeStatus.java
@@ -8,7 +8,7 @@
* Contributors:
* Kevin Sawicki (GitHub Inc.) - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core;
/**
* Gist change status class.
View
2 ...lipse/mylyn/github/internal/GistFile.java → ...rg/eclipse/egit/github/core/GistFile.java
@@ -8,7 +8,7 @@
* Contributors:
* Kevin Sawicki (GitHub Inc.) - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core;
/**
* Gist file class.
View
2 ...e/mylyn/github/internal/GistRevision.java → ...clipse/egit/github/core/GistRevision.java
@@ -8,7 +8,7 @@
* Contributors:
* Kevin Sawicki (GitHub Inc.) - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core;
import java.util.Date;
View
2 ...n/github/internal/IResourceCollector.java → .../egit/github/core/IResourceCollector.java
@@ -8,7 +8,7 @@
* Contributors:
* Kevin Sawicki (GitHub Inc.) - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core;
import java.util.Collection;
View
2 ...yn/github/internal/IResourceProvider.java → ...e/egit/github/core/IResourceProvider.java
@@ -8,7 +8,7 @@
* Contributors:
* Kevin Sawicki (GitHub Inc.) - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core;
import java.util.List;
View
2 ...org/eclipse/mylyn/github/internal/Id.java → .../src/org/eclipse/egit/github/core/Id.java
@@ -8,7 +8,7 @@
* Contributors:
* Kevin Sawicki (GitHub Inc.) - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core;
/**
* Id class.
View
2 .../eclipse/mylyn/github/internal/Issue.java → ...c/org/eclipse/egit/github/core/Issue.java
@@ -8,7 +8,7 @@
* Contributors:
* Kevin Sawicki (GitHub Inc.) - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core;
import java.util.Date;
import java.util.List;
View
2 .../eclipse/mylyn/github/internal/Label.java → ...c/org/eclipse/egit/github/core/Label.java
@@ -8,7 +8,7 @@
* Contributors:
* Kevin Sawicki (GitHub Inc.) - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core;
/**
* GitHub issue label class.
View
5 ...ithub/internal/ListResourceCollector.java → ...it/github/core/ListResourceCollector.java
@@ -8,12 +8,13 @@
* Contributors:
* Kevin Sawicki (GitHub Inc.) - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
+
/**
* {@link LinkedList} based resource collector
*
@@ -43,7 +44,7 @@
}
/**
- * @see org.eclipse.mylyn.github.internal.IResourceCollector#accept(int,
+ * @see org.eclipse.egit.github.core.IResourceCollector#accept(int,
* java.util.Collection)
*/
public boolean accept(int page, Collection<V> resources) {
View
2 ...ipse/mylyn/github/internal/Milestone.java → ...g/eclipse/egit/github/core/Milestone.java
@@ -8,7 +8,7 @@
* Contributors:
* Kevin Sawicki (GitHub Inc.) - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core;
import java.util.Date;
View
2 ...se/mylyn/github/internal/PullRequest.java → ...eclipse/egit/github/core/PullRequest.java
@@ -8,7 +8,7 @@
* Contributors:
* Kevin Sawicki (GitHub Inc.) - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core;
import java.util.Date;
import java.util.List;
View
2 ...ithub/internal/PullRequestDiscussion.java → ...it/github/core/PullRequestDiscussion.java
@@ -8,7 +8,7 @@
* Contributors:
* Kevin Sawicki (GitHub Inc.) - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core;
import java.util.Date;
import java.util.List;
View
3 ...yn/github/internal/PullRequestMarker.java → ...e/egit/github/core/PullRequestMarker.java
@@ -8,7 +8,8 @@
* Contributors:
* Kevin Sawicki (GitHub Inc.) - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core;
+
/**
* Pull request marker model class.
View
69 ...pse/mylyn/github/internal/Repository.java → .../eclipse/egit/github/core/Repository.java
@@ -8,21 +8,72 @@
* Contributors:
* Kevin Sawicki (GitHub Inc.) - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core;
import com.google.gson.annotations.SerializedName;
+import java.net.MalformedURLException;
+import java.net.URL;
import java.util.Date;
-import org.eclipse.core.runtime.Assert;
-
/**
* GitHub Repository class.
- *
- * @author Kevin Sawicki (kevin@github.com)
*/
public class Repository {
+ /**
+ * Create repository from url.
+ *
+ * @see Repository#createFromId(String)
+ * @param url
+ * @return repository or null if parsing fails
+ */
+ public static Repository createFromUrl(URL url) {
+ return url != null ? createFromId(url.getPath()) : null;
+ }
+
+ /**
+ * Create repository from id. The id is split on the '/' character and the
+ * last two non-empty segments are interpreted to be the repository owner
+ * and name.
+ *
+ * @param id
+ * @return repository
+ */
+ public static Repository createFromId(String id) {
+ if (id == null)
+ return null;
+ String owner = null;
+ String name = null;
+ String[] segments = id.split("/"); //$NON-NLS-1$
+ for (int i = segments.length - 1; i >= 0; i--)
+ if (segments[i].length() > 0)
+ if (name == null)
+ name = segments[i];
+ else if (owner == null)
+ owner = segments[i];
+ else
+ break;
+
+ return owner != null && name != null ? new Repository(owner, name)
+ : null;
+ }
+
+ /**
+ * Create from string url
+ *
+ * @see Repository#createFromUrl(URL)
+ * @param url
+ * @return repository or null if it could not be parsed from url path
+ */
+ public static Repository createFromUrl(String url) {
+ try {
+ return url != null ? createFromUrl(new URL(url)) : null;
+ } catch (MalformedURLException e) {
+ return null;
+ }
+ }
+
private boolean fork;
private boolean hasDownloads;
private boolean hasIssues;
@@ -52,10 +103,10 @@
* @param name
*/
public Repository(String owner, String name) {
- Assert.isNotNull(owner, "Owner cannot be null"); //$NON-NLS-1$
- Assert.isLegal(owner.length() > 0, "Owner cannot be empty"); //$NON-NLS-1$
- Assert.isNotNull(name, "Name cannot be null"); //$NON-NLS-1$
- Assert.isLegal(name.length() > 0, "Name cannot be empty"); //$NON-NLS-1$
+ Assert.notNull("Owner cannot be null", owner); //$NON-NLS-1$
+ Assert.notEmpty("Owner cannot be empty", owner); //$NON-NLS-1$
+ Assert.notNull("Name cannot be null", name); //$NON-NLS-1$
+ Assert.notEmpty("Name cannot be empty", name); //$NON-NLS-1$
this.owner = owner;
this.name = name;
View
3 ...e/mylyn/github/internal/RequestError.java → ...clipse/egit/github/core/RequestError.java
@@ -8,10 +8,11 @@
* Contributors:
* Kevin Sawicki (GitHub Inc.) - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core;
import java.util.List;
+
/**
* GitHub request error class
*
View
2 ...g/eclipse/mylyn/github/internal/User.java → ...rc/org/eclipse/egit/github/core/User.java
@@ -8,7 +8,7 @@
* Contributors:
* Kevin Sawicki (GitHub Inc.) - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core;
/**
* GitHub user class.
View
7 .../mylyn/github/internal/DateFormatter.java → ...git/github/core/client/DateFormatter.java
@@ -8,7 +8,7 @@
* Contributors:
* Kevin Sawicki (GitHub Inc.) - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core.client;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
@@ -24,10 +24,9 @@
import java.util.List;
import java.util.TimeZone;
+
/**
- * Date formatter for date format present in the GitHub v3 API.
- *
- * @author Kevin Sawicki (kevin@github.com)
+ * Formatter for date formats present in the GitHub v2 and v3 API.
*/
public class DateFormatter implements JsonDeserializer<Date> {
View
7 ...e/mylyn/github/internal/GitHubClient.java → ...egit/github/core/client/GitHubClient.java
@@ -8,7 +8,7 @@
* Contributors:
* Kevin Sawicki (GitHub Inc.) - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core.client;
import com.google.gson.FieldNamingPolicy;
import com.google.gson.Gson;
@@ -38,7 +38,8 @@
import org.apache.commons.httpclient.methods.PutMethod;
import org.apache.commons.httpclient.methods.StringRequestEntity;
import org.apache.commons.httpclient.protocol.Protocol;
-import org.eclipse.core.runtime.Assert;
+import org.eclipse.egit.github.core.Assert;
+import org.eclipse.egit.github.core.RequestError;
/**
* Client class for interacting with GitHub HTTP/JSON API.
@@ -77,7 +78,7 @@ public GitHubClient() {
* @param configuration
*/
public GitHubClient(HostConfiguration configuration) {
- Assert.isNotNull(configuration, "Configuration cannot be null"); //$NON-NLS-1$
+ Assert.notNull("Configuration cannot be null", configuration); //$NON-NLS-1$
this.hostConfig = configuration;
}
View
2 .../mylyn/github/internal/GitHubRequest.java → ...git/github/core/client/GitHubRequest.java
@@ -8,7 +8,7 @@
* Contributors:
* Kevin Sawicki (GitHub Inc.) - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core.client;
import java.lang.reflect.Type;
import java.util.Map;
View
2 ...mylyn/github/internal/GitHubResponse.java → ...it/github/core/client/GitHubResponse.java
@@ -8,7 +8,7 @@
* Contributors:
* Kevin Sawicki (GitHub Inc.) - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core.client;
import org.apache.commons.httpclient.HttpMethod;
View
12 ...lyn/github/internal/IGitHubConstants.java → .../github/core/client/IGitHubConstants.java
@@ -8,7 +8,7 @@
* Contributors:
* Kevin Sawicki (GitHub Inc.) - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.github.internal;
+package org.eclipse.egit.github.core.client;
/**
* G