diff options
author | Chris Aniszczyk | 2011-04-14 16:05:44 +0000 |
---|---|---|
committer | Chris Aniszczyk | 2011-04-14 16:05:44 +0000 |
commit | fc988e45af4d043d3a545c6b9efbd961b1a3c378 (patch) | |
tree | 3f696ce59e1e1de9f659d57b51ae7f812150a7c4 /org.eclipse.mylyn.github.tests/src | |
parent | 1af5ee3d37d23942c6515efaa8de36267a3619d6 (diff) | |
download | egit-github-fc988e45af4d043d3a545c6b9efbd961b1a3c378.tar.gz egit-github-fc988e45af4d043d3a545c6b9efbd961b1a3c378.tar.xz egit-github-fc988e45af4d043d3a545c6b9efbd961b1a3c378.zip |
Clean up org.eclipse.mylyn.github.tests
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
Diffstat (limited to 'org.eclipse.mylyn.github.tests/src')
3 files changed, 3 insertions, 90 deletions
diff --git a/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/internal/IssueServiceTest.java b/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/internal/IssueServiceTest.java index a69265e1..2e76bd4e 100644 --- a/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/internal/IssueServiceTest.java +++ b/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/internal/IssueServiceTest.java @@ -20,9 +20,7 @@ import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; /** - * Unit tests for {@link IssueService}. - * - * @author Christian Trutz (christian.trutz@gmail.com) + * Unit tests for {@link IssueService} */ @SuppressWarnings("restriction") @RunWith(MockitoJUnitRunner.class) diff --git a/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/tests/AllHeadlessTests.java b/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/tests/AllHeadlessTests.java index c5630ed5..d8b8eaeb 100644 --- a/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/tests/AllHeadlessTests.java +++ b/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/tests/AllHeadlessTests.java @@ -12,13 +12,14 @@ *******************************************************************************/ package org.eclipse.mylyn.github.tests; +import org.eclipse.mylyn.github.internal.IssueServiceTest; import org.junit.runner.RunWith; import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; @RunWith(Suite.class) @SuiteClasses( { // - MarshalingTest.class + IssueServiceTest.class }) public class AllHeadlessTests { diff --git a/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/tests/MarshalingTest.java b/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/tests/MarshalingTest.java deleted file mode 100644 index e6c80fe9..00000000 --- a/org.eclipse.mylyn.github.tests/src/org/eclipse/mylyn/github/tests/MarshalingTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 Red Hat 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 - * Chris Aniszczyk <caniszczyk@gmail.com> - initial contribution - *******************************************************************************/ -package org.eclipse.mylyn.github.tests; - -import static junit.framework.Assert.assertNull; -import static junit.framework.Assert.assertTrue; -import static org.junit.Assert.assertEquals; - -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.io.StringWriter; - -import org.eclipse.mylyn.github.internal.GitHubIssue; -import org.eclipse.mylyn.github.internal.GitHubIssues; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -import com.google.gson.Gson; - -@SuppressWarnings("restriction") -@RunWith(JUnit4.class) -public class MarshalingTest { - - private Gson gson; - - @Before - public void beforeTest() { - gson = new Gson(); - } - - @Test - public void unmarshalIssues() { - GitHubIssues issues = gson.fromJson( - getResource("resources/issues.json"), GitHubIssues.class); - - assertTrue(issues != null); - assertTrue(issues.getIssues() != null); - - assertEquals(10,issues.getIssues().length); - - GitHubIssue issue = issues.getIssues()[9]; - //{"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"}]} - assertEquals("10",issue.getNumber()); - assertEquals("2010/02/04 21:03:54 -0800",issue.getCreated_at()); - assertEquals("test description 2 ",issue.getBody()); - assertEquals("test issue for testing mylyn github connector2",issue.getTitle()); - assertEquals("2010/02/04 21:09:37 -0800",issue.getUpdated_at()); - assertNull(issue.getClosed_at()); - assertEquals("dgreen99",issue.getUser()); - assertEquals("open",issue.getState()); - } - - private String getResource(String resource) { - try { - InputStream stream = MarshalingTest.class - .getResourceAsStream(resource); - try { - StringWriter writer = new StringWriter(); - Reader reader = new InputStreamReader(stream); - int c; - while ((c = reader.read()) != -1) { - writer.write(c); - } - return writer.toString(); - } finally { - stream.close(); - } - } catch (Throwable t) { - throw new IllegalStateException(t); - } - } -} |