Remove previous generic version of Gitlab connector

This commit is contained in:
Mikhail Golubev
2014-02-03 15:38:52 +04:00
parent 9eae97504c
commit c8dda3a8ee
3 changed files with 1 additions and 212 deletions
@@ -61,8 +61,7 @@ public class GenericRepositoryType extends BaseRepositoryType<GenericRepository>
this,
new AsanaRepository(),
new AssemblaRepository(),
new SprintlyRepository(),
new GitlabRepository()
new SprintlyRepository()
);
}
@@ -127,10 +126,4 @@ public class GenericRepositoryType extends BaseRepositoryType<GenericRepository>
super("Sprintly", TasksIcons.Sprintly);
}
}
public final class GitlabRepository extends GenericSubtype {
public GitlabRepository() {
super("Gitlab", TasksIcons.Gitlab);
}
}
}
@@ -1,75 +0,0 @@
<Generic shared="false" url="">
<commitMessageFormat>{id} {summary}</commitMessageFormat>
<option name="downloadTasksInSeparateRequests" value="false" />
<password />
<option name="loginAnonymously" value="true" />
<option name="loginMethodType" value="GET" />
<option name="loginUrl" value="" />
<option name="responseHandlers">
<XPathResponseHandler>
<selectors>
<selector name="tasks" path="" />
<selector name="id" path="" />
<selector name="summary" path="" />
<selector name="description" path="" />
<selector name="updated" path="" />
<selector name="created" path="" />
<selector name="closed" path="" />
<selector name="issueUrl" path="" />
<selector name="singleTask-id" path="" />
<selector name="singleTask-summary" path="" />
<selector name="singleTask-description" path="" />
<selector name="singleTask-updated" path="" />
<selector name="singleTask-created" path="" />
<selector name="singleTask-closed" path="" />
<selector name="singleTask-issueUrl" path="" />
</selectors>
</XPathResponseHandler>
<JsonResponseHandler>
<selectors>
<selector name="tasks" path="[*]" />
<selector name="id" path="id" />
<selector name="summary" path="title" />
<selector name="description" path="description" />
<selector name="updated" path="updated_at" />
<selector name="created" path="created_at" />
<selector name="closed" path="" />
<selector name="issueUrl" path="" />
<selector name="singleTask-id" path="id" />
<selector name="singleTask-summary" path="title" />
<selector name="singleTask-description" path="description" />
<selector name="singleTask-updated" path="updated_at" />
<selector name="singleTask-created" path="created_at" />
<selector name="singleTask-closed" path="" />
<selector name="singleTask-issueUrl" path="" />
</selectors>
</JsonResponseHandler>
<RegExResponseHandler>
<option name="taskRegex" value="" />
</RegExResponseHandler>
</option>
<option name="responseType" value="JSON" />
<option name="shouldFormatCommitMessage" value="false" />
<option name="singleTaskMethodType" value="GET" />
<option name="singleTaskUrl" value="{serverUrl}/api/v3/projects/{project_ID}/issues?private_token={token}" />
<option name="subtypeName" />
<option name="tasksListMethodType" value="GET" />
<option name="tasksListUrl" value="{serverUrl}/api/v3/projects/{project_ID}/issues?private_token={token}" />
<option name="templateVariables">
<list>
<TemplateVariable hidden="true" readOnly="false" shownOnFirstTab="true">
<option name="description" value="" />
<option name="name" value="token" />
<option name="value" value="" />
</TemplateVariable>
<TemplateVariable hidden="false" readOnly="false" shownOnFirstTab="true">
<option name="description" value="" />
<option name="name" value="project_ID" />
<option name="value" value="" />
</TemplateVariable>
</list>
</option>
<option name="useHttpAuthentication" value="false" />
<option name="useProxy" value="false" />
<username />
</Generic>
@@ -1,129 +0,0 @@
package com.intellij.tasks.integration;
import com.intellij.tasks.Task;
import com.intellij.tasks.TaskTestUtil;
import com.intellij.tasks.generic.GenericRepository;
import com.intellij.tasks.generic.GenericRepositoryType;
import org.jetbrains.annotations.NotNull;
/**
* @author Mikhail Golubev
*/
public class GitlabIntegrationTest extends GenericSubtypeTestCase {
private static final String TASK_LIST_RESPONSE = "[\n" +
" {\n" +
" \"id\": 2,\n" +
" \"iid\": 2,\n" +
" \"project_id\": 1,\n" +
" \"title\": \"Drink more tea\",\n" +
" \"description\": \"It\\u0027s healthy.\",\n" +
" \"labels\": [],\n" +
" \"assignee\": {\n" +
" \"id\": 4,\n" +
" \"username\": \"deva\",\n" +
" \"email\": \"deva@somemail.com\",\n" +
" \"name\": \"John Smith\",\n" +
" \"state\": \"active\",\n" +
" \"created_at\": \"2013-11-14T12:34:37Z\"\n" +
" },\n" +
" \"author\": {\n" +
" \"id\": 1,\n" +
" \"username\": \"root\",\n" +
" \"email\": \"admin@local.host\",\n" +
" \"name\": \"Administrator\",\n" +
" \"state\": \"active\",\n" +
" \"created_at\": \"2013-11-14T12:19:43Z\"\n" +
" },\n" +
" \"state\": \"opened\",\n" +
" \"updated_at\": \"2013-11-14T12:38:51Z\",\n" +
" \"created_at\": \"2013-11-14T12:33:07Z\"\n" +
" },\n" +
" {\n" +
" \"id\": 1,\n" +
" \"iid\": 1,\n" +
" \"project_id\": 1,\n" +
" \"title\": \"Eat more bananas\",\n" +
" \"description\": \"They're tasty.\",\n" +
" \"labels\": [\n" +
" \"spam\"\n" +
" ],\n" +
" \"assignee\": {\n" +
" \"id\": 1,\n" +
" \"username\": \"root\",\n" +
" \"email\": \"admin@local.host\",\n" +
" \"name\": \"Administrator\",\n" +
" \"state\": \"active\",\n" +
" \"created_at\": \"2013-11-14T12:19:43Z\"\n" +
" },\n" +
" \"author\": {\n" +
" \"id\": 1,\n" +
" \"username\": \"root\",\n" +
" \"email\": \"admin@local.host\",\n" +
" \"name\": \"Administrator\",\n" +
" \"state\": \"active\",\n" +
" \"created_at\": \"2013-11-14T12:19:43Z\"\n" +
" },\n" +
" \"state\": \"opened\",\n" +
" \"updated_at\": \"2013-11-14T12:30:39Z\",\n" +
" \"created_at\": \"2013-11-14T12:30:39Z\"\n" +
" }\n" +
"] ";
private static final String SINGLE_TASK_RESPONSE = "{\n" +
" \"id\": 2,\n" +
" \"iid\": 2,\n" +
" \"project_id\": 1,\n" +
" \"title\": \"Drink more tea\",\n" +
" \"description\": \"It\\u0027s healthy.\",\n" +
" \"labels\": [],\n" +
" \"assignee\": {\n" +
" \"id\": 4,\n" +
" \"username\": \"deva\",\n" +
" \"email\": \"deva@somemail.com\",\n" +
" \"name\": \"John Smith\",\n" +
" \"state\": \"active\",\n" +
" \"created_at\": \"2013-11-14T12:34:37Z\"\n" +
" },\n" +
" \"author\": {\n" +
" \"id\": 1,\n" +
" \"username\": \"root\",\n" +
" \"email\": \"admin@local.host\",\n" +
" \"name\": \"Administrator\",\n" +
" \"state\": \"active\",\n" +
" \"created_at\": \"2013-11-14T12:19:43Z\"\n" +
" },\n" +
" \"state\": \"opened\",\n" +
" \"updated_at\": \"2013-11-14T12:38:51Z\",\n" +
" \"created_at\": \"2013-11-14T12:33:07Z\"\n" +
"}";
private Task getTask1() {
return new TaskTestUtil.TaskBuilder("1", "Eat more bananas", myRepository)
.withDescription("They're tasty.")
.withUpdated("2013-11-14T12:30:39Z")
.withCreated("2013-11-14T12:30:39Z");
}
private Task getTask2() {
return new TaskTestUtil.TaskBuilder("2", "Drink more tea", myRepository)
.withDescription("It's healthy.")
.withUpdated("2013-11-14T12:38:51Z")
.withCreated("2013-11-14T12:33:07Z");
}
@NotNull
@Override
protected GenericRepository createRepository(GenericRepositoryType genericType) {
return (GenericRepository)genericType.new GitlabRepository().createRepository();
}
public void testParsingTaskList() throws Exception {
Task[] tasks = myRepository.getActiveResponseHandler().parseIssues(TASK_LIST_RESPONSE, 50);
TaskTestUtil.assertTasksEqual(new Task[]{getTask2(), getTask1()}, tasks);
}
public void testParsingSingleTask() throws Exception {
Task task = myRepository.getActiveResponseHandler().parseIssue(SINGLE_TASK_RESPONSE);
TaskTestUtil.assertTasksEqual(getTask2(), task);
}
}