diff options
author | fbecker | 2010-10-27 21:06:51 +0000 |
---|---|---|
committer | fbecker | 2010-10-27 21:06:51 +0000 |
commit | 3bc597cbf2bf9c77adf24572373ab84208875534 (patch) | |
tree | 830d19d4286eb1a2bc86bf3e8ff78a7328ad59b9 /org.eclipse.mylyn.bugzilla.tests | |
parent | 45dff7f882a95fa15234ca32f7a29de8772521b1 (diff) | |
download | org.eclipse.mylyn.tasks-3bc597cbf2bf9c77adf24572373ab84208875534.tar.gz org.eclipse.mylyn.tasks-3bc597cbf2bf9c77adf24572373ab84208875534.tar.xz org.eclipse.mylyn.tasks-3bc597cbf2bf9c77adf24572373ab84208875534.zip |
ASSIGNED - bug 321066: fix Bugzilla tests for 3.5
https://bugs.eclipse.org/bugs/show_bug.cgi?id=321066
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.tests')
5 files changed, 46 insertions, 15 deletions
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaAttachmentHandlerTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaAttachmentHandlerTest.java index c863f4636..bdd8ddc8f 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaAttachmentHandlerTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaAttachmentHandlerTest.java @@ -73,6 +73,8 @@ public class BugzillaAttachmentHandlerTest extends AbstractBugzillaTest { TaskAttribute attrAttachment = taskData.getAttributeMapper().createTaskAttachment(taskData); TaskAttachmentMapper attachmentMapper = TaskAttachmentMapper.createFrom(attrAttachment); + attachmentMapper.setComment("test Update AttachmentFlags"); + /* Test uploading a proper file */ String fileName = "test-attach-1.txt"; File attachFile = new File(fileName); @@ -443,24 +445,25 @@ public class BugzillaAttachmentHandlerTest extends AbstractBugzillaTest { * Ensure obsoletes and patches are marked as such by the parser. */ public void testAttachmentAttributes() throws Exception { - String taskNumber = "19"; + String taskNumber = "3"; TaskData taskData = BugzillaFixture.current().getTask(taskNumber, client); assertNotNull(taskData); - - boolean isPatch[] = { false, true, false, false, false, false, false, true, false, false, false }; - boolean isObsolete[] = { false, true, false, true, false, false, false, false, false, false, false }; + ITask task = TasksUi.getRepositoryModel().createTask(repository, taskData.getTaskId()); + boolean isPatch[] = { false, false, true, true }; + boolean isObsolete[] = { false, true, false, true }; int index = 0; for (TaskAttribute attribute : taskData.getAttributeMapper().getAttributesByType(taskData, TaskAttribute.TYPE_ATTACHMENT)) { - assertTrue(validateAttachmentAttributes(taskData, attribute, isPatch[index], isObsolete[index])); + assertTrue(validateAttachmentAttributes(taskData, attribute, isPatch[index], isObsolete[index], task)); index++; } + assertEquals(4, index); } private boolean validateAttachmentAttributes(TaskData data, TaskAttribute taskAttribute, boolean isPatch, - boolean isObsolete) { - TaskAttachment taskAttachment = new TaskAttachment(BugzillaFixture.current().repository(), null, taskAttribute); + boolean isObsolete, ITask task) { + TaskAttachment taskAttachment = new TaskAttachment(BugzillaFixture.current().repository(), task, taskAttribute); data.getAttributeMapper().updateTaskAttachment(taskAttachment, taskAttribute); return (taskAttachment.isPatch() == isPatch) && (taskAttachment.isDeprecated() == isObsolete); } diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaCustomRepositoryTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaCustomRepositoryTest.java index 5bd85de89..c6a96543e 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaCustomRepositoryTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaCustomRepositoryTest.java @@ -20,8 +20,8 @@ import org.eclipse.mylyn.internal.tasks.core.AbstractTask; import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal; import org.eclipse.mylyn.tasks.core.ITask; import org.eclipse.mylyn.tasks.core.RepositoryResponse; -import org.eclipse.mylyn.tasks.core.TaskMapping; import org.eclipse.mylyn.tasks.core.RepositoryResponse.ResponseKind; +import org.eclipse.mylyn.tasks.core.TaskMapping; import org.eclipse.mylyn.tasks.core.data.ITaskDataWorkingCopy; import org.eclipse.mylyn.tasks.core.data.TaskAttribute; import org.eclipse.mylyn.tasks.core.data.TaskData; diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java index 2d5946545..df79c7940 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java @@ -92,25 +92,25 @@ public class BugzillaFixture extends TestFixture { "3.0.11", ""); public static BugzillaFixture BUGS_3_2 = new BugzillaFixture(BugzillaFixture.TEST_BUGZILLA_32_URL, // - "3.2.7", ""); + "3.2.8", ""); public static BugzillaFixture BUGS_3_4 = new BugzillaFixture(BugzillaFixture.TEST_BUGZILLA_34_URL, // - "3.4.7", ""); + "3.4.8", ""); public static BugzillaFixture BUGS_3_6 = new BugzillaFixture(BugzillaFixture.TEST_BUGZILLA_36_URL, // - "3.6.1", ""); + "3.6.2", ""); public static BugzillaFixture BUGS_3_6_CUSTOM_WF = new BugzillaFixture(BugzillaFixture.TEST_BUGZILLA_36_URL - + "-custom-wf", "3.6.1", "Custom Workflow"); + + "-custom-wf", "3.6.2", "Custom Workflow"); public static BugzillaFixture BUGS_3_6_CUSTOM_WF_AND_STATUS = new BugzillaFixture( - BugzillaFixture.TEST_BUGZILLA_36_URL + "-custom-wf-and-status", "3.6.1", "Custom Workflow and Status"); + BugzillaFixture.TEST_BUGZILLA_36_URL + "-custom-wf-and-status", "3.6.2", "Custom Workflow and Status"); public static BugzillaFixture BUGS_3_6_XML_RPC_DISABLED = new BugzillaFixture(BugzillaFixture.TEST_BUGZILLA_36_URL - + "-xml-rpc-disabled", "3.6.1", "XML-RPC disabled"); + + "-xml-rpc-disabled", "3.6.2", "XML-RPC disabled"); public static BugzillaFixture BUGS_HEAD = new BugzillaFixture(BugzillaFixture.TEST_BUGZILLA_HEAD_URL, // - "3.7.1+", ""); + "4.1", ""); public static BugzillaFixture DEFAULT = BUGS_3_6; diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/descriptor/Bugzilla_3.6.2/Custom_WorkflowTransition.txt b/org.eclipse.mylyn.bugzilla.tests/testdata/descriptor/Bugzilla_3.6.2/Custom_WorkflowTransition.txt new file mode 100644 index 000000000..bdbd77b37 --- /dev/null +++ b/org.eclipse.mylyn.bugzilla.tests/testdata/descriptor/Bugzilla_3.6.2/Custom_WorkflowTransition.txt @@ -0,0 +1,14 @@ +CustomStatusNames=true +DuplicateStatus=CLOSED +ClosedCustomStatus=POST +<transitions> +name :UNCONFIRMED:, can_change_to :NEW,ASSIGNED,RESOLVED,MODIFIED,ON_DEV,ON_QA,VERIFIED,RELEASE_PENDING,POST,CLOSED: +name :NEW:, can_change_to :ASSIGNED,RESOLVED,MODIFIED,ON_DEV,ON_QA,VERIFIED,RELEASE_PENDING,POST,CLOSED: +name :ASSIGNED:, can_change_to :MODIFIED,ON_DEV,ON_QA,VERIFIED,RELEASE_PENDING,POST,CLOSED: +name :MODIFIED:, can_change_to :NEW,ASSIGNED,ON_DEV,ON_QA,VERIFIED,RELEASE_PENDING,POST,CLOSED: +name :ON_DEV:, can_change_to :NEW,ASSIGNED,MODIFIED,ON_QA,VERIFIED,RELEASE_PENDING,POST,CLOSED: +name :ON_QA:, can_change_to :NEW,ASSIGNED,MODIFIED,ON_DEV,VERIFIED,RELEASE_PENDING,POST,CLOSED: +name :RELEASE_PENDING:, can_change_to :NEW,ASSIGNED,MODIFIED,ON_DEV,ON_QA,VERIFIED,POST,CLOSED: +name :VERIFIED:, can_change_to :NEW,ASSIGNED,MODIFIED,ON_DEV,ON_QA,RELEASE_PENDING,POST,CLOSED: +name :POST:, can_change_to :NEW,ASSIGNED,MODIFIED,ON_DEV,ON_QA,VERIFIED,RELEASE_PENDING,CLOSED: +name :CLOSED:, can_change_to :ASSIGNED,VERIFIED: diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/descriptor/Bugzilla_3.6.2/Custom_Workflow_and_StatusTransition.txt b/org.eclipse.mylyn.bugzilla.tests/testdata/descriptor/Bugzilla_3.6.2/Custom_Workflow_and_StatusTransition.txt new file mode 100644 index 000000000..bdbd77b37 --- /dev/null +++ b/org.eclipse.mylyn.bugzilla.tests/testdata/descriptor/Bugzilla_3.6.2/Custom_Workflow_and_StatusTransition.txt @@ -0,0 +1,14 @@ +CustomStatusNames=true +DuplicateStatus=CLOSED +ClosedCustomStatus=POST +<transitions> +name :UNCONFIRMED:, can_change_to :NEW,ASSIGNED,RESOLVED,MODIFIED,ON_DEV,ON_QA,VERIFIED,RELEASE_PENDING,POST,CLOSED: +name :NEW:, can_change_to :ASSIGNED,RESOLVED,MODIFIED,ON_DEV,ON_QA,VERIFIED,RELEASE_PENDING,POST,CLOSED: +name :ASSIGNED:, can_change_to :MODIFIED,ON_DEV,ON_QA,VERIFIED,RELEASE_PENDING,POST,CLOSED: +name :MODIFIED:, can_change_to :NEW,ASSIGNED,ON_DEV,ON_QA,VERIFIED,RELEASE_PENDING,POST,CLOSED: +name :ON_DEV:, can_change_to :NEW,ASSIGNED,MODIFIED,ON_QA,VERIFIED,RELEASE_PENDING,POST,CLOSED: +name :ON_QA:, can_change_to :NEW,ASSIGNED,MODIFIED,ON_DEV,VERIFIED,RELEASE_PENDING,POST,CLOSED: +name :RELEASE_PENDING:, can_change_to :NEW,ASSIGNED,MODIFIED,ON_DEV,ON_QA,VERIFIED,POST,CLOSED: +name :VERIFIED:, can_change_to :NEW,ASSIGNED,MODIFIED,ON_DEV,ON_QA,RELEASE_PENDING,POST,CLOSED: +name :POST:, can_change_to :NEW,ASSIGNED,MODIFIED,ON_DEV,ON_QA,VERIFIED,RELEASE_PENDING,CLOSED: +name :CLOSED:, can_change_to :ASSIGNED,VERIFIED: |