Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Trutz2011-04-29 13:51:28 +0000
committerChris Aniszczyk2011-05-06 00:32:03 +0000
commit84c7ade8ea08be53cc97e396f8ab326002916586 (patch)
tree417956afb4a911ce3fb2adbc3debcf5654731f34 /org.eclipse.mylyn.github.tests
parenta50b21285bb3f65956b5edf756f3f65d1a16e394 (diff)
downloadegit-github-84c7ade8ea08be53cc97e396f8ab326002916586.tar.gz
egit-github-84c7ade8ea08be53cc97e396f8ab326002916586.tar.xz
egit-github-84c7ade8ea08be53cc97e396f8ab326002916586.zip
Unit tests (headless) cleanup.
Change-Id: Ief5253b945fb41800603e1526deb2361d02e26fb Signed-off-by: Christian Trutz <christian.trutz@gmail.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
Diffstat (limited to 'org.eclipse.mylyn.github.tests')
-rw-r--r--org.eclipse.mylyn.github.tests/pom.xml2
-rw-r--r--org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/tests/resources/issues.json1
-rw-r--r--org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/tests/ui/GitHubRepositoryConnectorUITest.java41
-rw-r--r--org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositoryConnectorUIHeadlessTest.java58
4 files changed, 59 insertions, 43 deletions
diff --git a/org.eclipse.mylyn.github.tests/pom.xml b/org.eclipse.mylyn.github.tests/pom.xml
index 5ce2941f..8cddc404 100644
--- a/org.eclipse.mylyn.github.tests/pom.xml
+++ b/org.eclipse.mylyn.github.tests/pom.xml
@@ -22,7 +22,7 @@
<artifactId>org.eclipse.mylyn.github.tests</artifactId>
<packaging>eclipse-test-plugin</packaging>
- <name>Mylyn GitHub Test Plug-in (Incubation)</name>
+ <name>Eclipse EGit Mylyn GitHub Test Plug-in (Incubation)</name>
<build>
<plugins>
diff --git a/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/tests/resources/issues.json b/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/tests/resources/issues.json
deleted file mode 100644
index d99eb9f3..00000000
--- a/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/tests/resources/issues.json
+++ /dev/null
@@ -1 +0,0 @@
-{"issues":[{"number":1,"votes":0,"created_at":"2010/02/02 22:58:39 -0800","body":"","title":"Test objective-c marshaling code","updated_at":"2010/02/02 22:58:39 -0800","closed_at":null,"user":"dgreen99","labels":[],"state":"open"},{"number":2,"votes":0,"created_at":"2010/02/02 22:59:02 -0800","body":"","title":"Provide instructions for use","updated_at":"2010/02/02 22:59:02 -0800","closed_at":null,"user":"dgreen99","labels":[],"state":"open"},{"number":3,"votes":0,"created_at":"2010/02/02 22:59:26 -0800","body":"","title":"add support for JSON marshalling","updated_at":"2010/02/04 17:56:02 -0800","closed_at":null,"user":"dgreen99","labels":[],"state":"open"},{"number":4,"votes":0,"created_at":"2010/02/02 22:59:45 -0800","body":"","title":"provide working sample project","updated_at":"2010/02/02 22:59:45 -0800","closed_at":null,"user":"dgreen99","labels":[],"state":"open"},{"number":5,"votes":0,"created_at":"2010/02/02 23:00:19 -0800","body":"","title":"support object inheritance","updated_at":"2010/02/02 23:00:19 -0800","closed_at":null,"user":"dgreen99","labels":[],"state":"open"},{"number":6,"votes":0,"created_at":"2010/02/02 23:00:37 -0800","body":"","title":"provide support for nested types","updated_at":"2010/02/02 23:00:37 -0800","closed_at":null,"user":"dgreen99","labels":[],"state":"open"},{"number":7,"votes":0,"created_at":"2010/02/02 23:00:49 -0800","body":"","title":"client enum support","updated_at":"2010/02/02 23:00:49 -0800","closed_at":null,"user":"dgreen99","labels":[],"state":"open"},{"number":8,"votes":0,"created_at":"2010/02/02 23:01:09 -0800","body":"","title":"refactor templates to use field iterator","updated_at":"2010/02/02 23:01:09 -0800","closed_at":null,"user":"dgreen99","labels":[],"state":"open"},{"number":9,"votes":0,"created_at":"2010/02/02 23:01:35 -0800","body":"","title":"wiki should explain target architecture","updated_at":"2010/02/02 23:01:35 -0800","closed_at":null,"user":"dgreen99","labels":[],"state":"open"},{"number":10,"votes":0,"created_at":"2010/02/04 21:03:54 -0800","body":"test description 2 ","title":"test issue for testing mylyn github connector2","updated_at":"2010/02/04 21:09:37 -0800","closed_at":null,"user":"dgreen99","labels":[],"state":"open"}]} \ No newline at end of file
diff --git a/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/tests/ui/GitHubRepositoryConnectorUITest.java b/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/tests/ui/GitHubRepositoryConnectorUITest.java
deleted file mode 100644
index fe58f09e..00000000
--- a/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/tests/ui/GitHubRepositoryConnectorUITest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package org.eclipse.mylyn.github.tests.ui;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
-import junit.framework.Assert;
-
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.mylyn.github.internal.GitHub;
-import org.eclipse.mylyn.github.ui.internal.GitHubRepositoryConnectorUI;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.eclipse.mylyn.tasks.ui.TaskHyperlink;
-import org.junit.Before;
-import org.junit.Test;
-
-public class GitHubRepositoryConnectorUITest {
-
- private GitHubRepositoryConnectorUI connectorUI;
- private TaskRepository repository;
-
- @Before
- public void before() {
- connectorUI = new GitHubRepositoryConnectorUI();
- repository = new TaskRepository(GitHub.CONNECTOR_KIND, GitHub.createGitHubUrl("foo", "bar"));
- }
-
- @Test
- public void testFindHyperlinksTaskRepositoryStringIntInt() {
- IHyperlink[] hyperlinks = connectorUI.findHyperlinks(repository, "one #2 three", -1, 0);
- assertNotNull(hyperlinks);
- assertEquals(1,hyperlinks.length);
- assertEquals(new Region(4,2),hyperlinks[0].getHyperlinkRegion());
-
- hyperlinks = connectorUI.findHyperlinks(repository, "one #2 three", -1, 4);
- assertNotNull(hyperlinks);
- assertEquals(1,hyperlinks.length);
- assertEquals(new Region(8,2),hyperlinks[0].getHyperlinkRegion());
- }
-
-}
diff --git a/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositoryConnectorUIHeadlessTest.java b/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositoryConnectorUIHeadlessTest.java
new file mode 100644
index 00000000..a42a5ce3
--- /dev/null
+++ b/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositoryConnectorUIHeadlessTest.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Christian Trutz and others.
+ * 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:
+ * David Green <david.green@tasktop.com> - initial contribution
+ * Christian Trutz <christian.trutz@gmail.com> - initial contribution
+ *******************************************************************************/
+package org.eclipse.mylyn.github.ui.internal;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertNotNull;
+
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.mylyn.github.internal.GitHub;
+import org.eclipse.mylyn.tasks.core.TaskRepository;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Headless test for {@link GitHubRepositoryConnectorUI}
+ *
+ * @author Christian Trutz <christian.trutz@gmail.com>
+ */
+@SuppressWarnings("restriction")
+public class GitHubRepositoryConnectorUIHeadlessTest {
+
+ private GitHubRepositoryConnectorUI connectorUI;
+
+ private TaskRepository repository;
+
+ @Before
+ public void before() {
+ connectorUI = new GitHubRepositoryConnectorUI();
+ repository = new TaskRepository(GitHub.CONNECTOR_KIND,
+ GitHub.createGitHubUrl("foo", "bar"));
+ }
+
+ @Test
+ public void testFindHyperlinksTaskRepositoryStringIntInt() {
+ IHyperlink[] hyperlinks = connectorUI.findHyperlinks(repository,
+ "one #2 three", -1, 0);
+ assertNotNull(hyperlinks);
+ assertEquals(1, hyperlinks.length);
+ assertEquals(new Region(4, 2), hyperlinks[0].getHyperlinkRegion());
+
+ hyperlinks = connectorUI.findHyperlinks(repository, "one #2 three", -1,
+ 4);
+ assertNotNull(hyperlinks);
+ assertEquals(1, hyperlinks.length);
+ assertEquals(new Region(8, 2), hyperlinks[0].getHyperlinkRegion());
+ }
+
+}

Back to the top