Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2014-11-22 04:32:04 -0500
committerFrank Becker2014-11-27 13:53:59 -0500
commitf342436e4adb9a34a62247fabca4a629c83ce6b0 (patch)
treed4fe228c7ee289a5ff44288fa46ea2b94ca3bb23
parent098f65b7d49ae7a6c413c8706d5fd2777ae8e857 (diff)
downloadorg.eclipse.mylyn.tasks-f342436e4adb9a34a62247fabca4a629c83ce6b0.tar.gz
org.eclipse.mylyn.tasks-f342436e4adb9a34a62247fabca4a629c83ce6b0.tar.xz
org.eclipse.mylyn.tasks-f342436e4adb9a34a62247fabca4a629c83ce6b0.zip
448429: end support for Bugzilla 3
Change-Id: I7ec71b76c9de4d685b9929105754fbe98025ca01 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=448429
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/CustomTransitionManager.java12
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java44
-rw-r--r--org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/defaultsites.pp30
-rw-r--r--org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb33
-rw-r--r--org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/answers.erb2
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaTests.java5
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaCustomRepositoryTest.java290
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXmlRpcClientTest.java114
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/testdata/repository/DescriptorFile-custom-wf-and-status.txt14
9 files changed, 78 insertions, 466 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/CustomTransitionManager.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/CustomTransitionManager.java
index 48023040f..c9725b830 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/CustomTransitionManager.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/CustomTransitionManager.java
@@ -76,7 +76,7 @@ public class CustomTransitionManager implements Serializable {
/**
* Searches for a valid transition description file. Returns true if a file exists and was sucessfully parsed, false
* otherwise
- *
+ *
* @param filePath
* @return true if anything was changed, false otherwise.
* @throws CoreException
@@ -204,7 +204,7 @@ public class CustomTransitionManager implements Serializable {
operationMapByEndStatus.put("REOPENED", list); //$NON-NLS-1$
list = new ArrayList<AbstractBugzillaOperation>();
- list.add(BugzillaOperation.reopen);
+ list.add(BugzillaOperation.unconfirmed);
operationMapByEndStatus.put("UNCONFIRMED", list); //$NON-NLS-1$
list = new ArrayList<AbstractBugzillaOperation>();
@@ -240,7 +240,7 @@ public class CustomTransitionManager implements Serializable {
/**
* Sets whether or not this class is valid. If set to false, the filePath will be set to "" so that subsequent calls
* to parse(filePath) will work.
- *
+ *
* @param val
*/
public void setValid(boolean val) {
@@ -258,7 +258,7 @@ public class CustomTransitionManager implements Serializable {
* Returns the duplicate status. Standard Bugzilla installations will have a duplicate status of RESOLVED, VERIFIED
* or CLOSED. <br>
* By default, the duplicate status will be RESOLVED.
- *
+ *
* @return The status to send if a bug is set to Duplicate
*/
public String getDuplicateStatus() {
@@ -274,7 +274,7 @@ public class CustomTransitionManager implements Serializable {
* permissions setting currently cannot be accessed, so this function does not try to guess and returns either the
* default status (NEW) or whichever status was set by a transition file. <br>
* Fix for bug #318128, set startStatus to NEW if startStatus is somehow null at this point.
- *
+ *
* @return The valid start status. Default value is NEW.
*/
public String getStartStatus() {
@@ -380,7 +380,7 @@ public class CustomTransitionManager implements Serializable {
/**
* Creates a new status with a single operation with the same name as the status itself. Does nothing if a status of
* that name already exists.
- *
+ *
* @param status
*/
private void addNewStatus(String status) {
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java
index c06f7bb9b..087da5b2a 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java
@@ -34,7 +34,7 @@ import org.eclipse.mylyn.tasks.core.data.TaskOperation;
/**
* Class describing the configuration of products and components for a given Bugzilla installation.
- *
+ *
* @author Rob Elves
* @author Charley Wang
* @author Frank Becker
@@ -354,7 +354,7 @@ public class RepositoryConfiguration implements Serializable {
/**
* Create a custom transition manager. If fileName is invalid, the resulting transition manager will also be
* invalid.
- *
+ *
* @param fileName
* @throws CoreException
*/
@@ -727,7 +727,7 @@ public class RepositoryConfiguration implements Serializable {
} else {
addOperation(bugReport, BugzillaOperation.none);
for (AbstractBugzillaOperation b : validTransitions.getValidTransitions(attributeStatus.getValue())) {
- //Special case: the CLOSED status needs a Resolution input.
+ //Special case: the CLOSED status needs a Resolution input.
//This happens automatically if current status is RESOLVED, else we need to supply one
if (b.toString().equals(BugzillaOperation.close.toString())) {
if (attributeStatus.getValue().equals("RESOLVED") && b.getInputId() != null) { //$NON-NLS-1$
@@ -806,11 +806,11 @@ public class RepositoryConfiguration implements Serializable {
if (operationAttribute == null) {
operationAttribute = bugReport.getRoot().createAttribute(key.getKey());
operationAttribute.getMetaData()
- .defaults()
- .setReadOnly(key.isReadOnly())
- .setKind(key.getKind())
- .setLabel(key.toString())
- .setType(key.getType());
+ .defaults()
+ .setReadOnly(key.isReadOnly())
+ .setKind(key.getKind())
+ .setLabel(key.toString())
+ .setType(key.getType());
operationAttribute.setValue("0"); //$NON-NLS-1$
}
operationAttribute = bugReport.getRoot().getMappedAttribute(TaskAttribute.USER_ASSIGNED);
@@ -840,7 +840,7 @@ public class RepositoryConfiguration implements Serializable {
//Handle custom operations. Currently only tuned for transitions based on default status names
addOperation(bugReport, BugzillaOperation.none);
for (AbstractBugzillaOperation b : validTransitions.getValidTransitions(attributeStatus.getValue())) {
- //Special case: the CLOSED status needs a Resolution input.
+ //Special case: the CLOSED status needs a Resolution input.
//This happens automatically if current status is RESOLVED, else we need to supply one
if (b.toString().equals(BugzillaOperation.close.toString())) {
if (attributeStatus.getValue().equals("RESOLVED") && b.getInputId() != null) { //$NON-NLS-1$
@@ -855,7 +855,7 @@ public class RepositoryConfiguration implements Serializable {
}
} else {
// Eclipse Bugzilla State transitions
-// UNCONFIRMED
+// UNCONFIRMED
// NEW ASSIGNED RESOLVED# CLOSED#
// ASSIGNED NEW RESOLVED# CLOSED#
// REOPENED NEW ASSIGNED RESOLVED# CLOSED#
@@ -868,7 +868,7 @@ public class RepositoryConfiguration implements Serializable {
addOperation(bugReport, BugzillaOperation.none);
addOperation(bugReport, BugzillaOperation.accept);
addOperation(bugReport, BugzillaOperation.resolve);
- // This is not the standard workflow add with bug 326216 to support eclipse.org
+ // This is not the standard workflow add with bug 326216 to support eclipse.org
if (bugzillaVersion.compareMajorMinorOnly(BugzillaVersion.BUGZILLA_3_2) >= 0) {
addOperation(bugReport, BugzillaOperation.close_with_resolution);
}
@@ -879,7 +879,7 @@ public class RepositoryConfiguration implements Serializable {
addOperation(bugReport, BugzillaOperation.none);
addOperation(bugReport, BugzillaOperation.accept);
addOperation(bugReport, BugzillaOperation.resolve);
- // This is not the standard workflow add with bug 326216 to support eclipse.org
+ // This is not the standard workflow add with bug 326216 to support eclipse.org
if (bugzillaVersion.compareMajorMinorOnly(BugzillaVersion.BUGZILLA_3_2) >= 0) {
addOperation(bugReport, BugzillaOperation.close_with_resolution);
}
@@ -891,7 +891,7 @@ public class RepositoryConfiguration implements Serializable {
case ASSIGNED:
addOperation(bugReport, BugzillaOperation.none);
addOperation(bugReport, BugzillaOperation.resolve);
- // This is not the standard workflow add with bug 326216 to support eclipse.org
+ // This is not the standard workflow add with bug 326216 to support eclipse.org
if (bugzillaVersion.compareMajorMinorOnly(BugzillaVersion.BUGZILLA_3_2) >= 0) {
addOperation(bugReport, BugzillaOperation.close_with_resolution);
}
@@ -948,11 +948,11 @@ public class RepositoryConfiguration implements Serializable {
if (operationAttribute == null) {
operationAttribute = bugReport.getRoot().createAttribute(key.getKey());
operationAttribute.getMetaData()
- .defaults()
- .setReadOnly(key.isReadOnly())
- .setKind(key.getKind())
- .setLabel(key.toString())
- .setType(key.getType());
+ .defaults()
+ .setReadOnly(key.isReadOnly())
+ .setKind(key.getKind())
+ .setLabel(key.toString())
+ .setType(key.getType());
operationAttribute.setValue("0"); //$NON-NLS-1$
}
operationAttribute = bugReport.getRoot().getMappedAttribute(TaskAttribute.USER_ASSIGNED);
@@ -1227,7 +1227,7 @@ public class RepositoryConfiguration implements Serializable {
public String getDuplicateStatus() {
return validTransitions == null
? IBugzillaConstants.BUGZILLA_REPORT_STATUS.RESOLVED.toString()
- : validTransitions.getDuplicateStatus();
+ : validTransitions.getDuplicateStatus();
}
public String getStartStatus() {
@@ -1235,9 +1235,9 @@ public class RepositoryConfiguration implements Serializable {
return version.compareMajorMinorOnly(BugzillaVersion.BUGZILLA_4_0) < 0
|| !(getOptionValues(BugzillaAttribute.BUG_STATUS).contains(
BUGZILLA_REPORT_STATUS_4_0.IN_PROGRESS.toString()) || getOptionValues(
- BugzillaAttribute.BUG_STATUS).contains(BUGZILLA_REPORT_STATUS_4_0.CONFIRMED.toString()))
- ? IBugzillaConstants.BUGZILLA_REPORT_STATUS.NEW.toString()
- : IBugzillaConstants.BUGZILLA_REPORT_STATUS_4_0.CONFIRMED.toString();
+ BugzillaAttribute.BUG_STATUS).contains(BUGZILLA_REPORT_STATUS_4_0.CONFIRMED.toString()))
+ ? IBugzillaConstants.BUGZILLA_REPORT_STATUS.NEW.toString()
+ : IBugzillaConstants.BUGZILLA_REPORT_STATUS_4_0.CONFIRMED.toString();
} else {
return validTransitions.getStartStatus();
}
diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/defaultsites.pp b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/defaultsites.pp
index cacaccc5e..4d8304f22 100644
--- a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/defaultsites.pp
+++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/defaultsites.pp
@@ -23,22 +23,6 @@ define bugzilla::defaultsites($base = $bugzilla::bugzillaBase, $userOwner = $bug
/* Sites */
- bugzilla::site { "bugzilla-3.6.13-custom-wf":
- major => "3",
- minor => "6",
- branchTag => "bugzilla-3.6.13",
- custom_wf => true,
- }
-
- bugzilla::site { "bugzilla-3.6.13-custom-wf-and-status":
- major => "3",
- minor => "6",
- branchTag => "bugzilla-3.6.13",
- custom_wf_and_status => true,
- xmlrpc_enabled => false,
- desciptorfile => "DescriptorFile-custom-wf-and-status.txt"
- }
-
bugzilla::site { "bugzilla-4.0.15":
major => "4",
minor => "0",
@@ -62,6 +46,20 @@ define bugzilla::defaultsites($base = $bugzilla::bugzillaBase, $userOwner = $bug
envdefault => true,
}
+ bugzilla::site { "bugzilla-4.4.6-custom-wf":
+ major => "4",
+ minor => "4",
+ branchTag => "bugzilla-4.4.6",
+ custom_wf => true,
+ }
+
+ bugzilla::site { "bugzilla-4.4.6-custom-wf-and-status":
+ major => "4",
+ minor => "4",
+ branchTag => "bugzilla-4.4.6",
+ custom_wf_and_status => true,
+ }
+
/*
bugzilla::site { "bugzilla-master":
major => "5",
diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb
index 162f90380..f3b12b369 100644
--- a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb
+++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb
@@ -28,15 +28,11 @@ our $VERSION = '0.01';
<% if @custom_wf %>
use constant STATUS_WORKFLOW => (
- ['REOPENED','UNCONFIRMED'],
- ['REOPENED','VERIFIED'],
- ['REOPENED','CLOSED'],
- ['NEW','CLOSED'],
+ ['IN_PROGRESS','UNCONFIRMED'],
+ ['CONFIRMED','VERIFIED'],
);
use constant STATUS_WORKFLOW_DELETE => (
- ['CLOSED','UNCONFIRMED'],
- ['CLOSED','REOPENED'],
- ['ASSIGNED','NEW'],
+ ['IN_PROGRESS','CONFIRMED'],
);
<% end %>
<% if @custom_wf_and_status %>
@@ -44,26 +40,11 @@ use constant STATUS_WORKFLOW => (
['VERIFIED','MODIFIED'],
['ON_DEV','POST'],
['MODIFIED','ON_DEV'],
- ['CLOSED','VERIFIED'],
- ['NEW','UNCONFIRMED'],
);
use constant STATUS_WORKFLOW_DELETE => (
['UNCONFIRMED','ASSIGNED'],
['RESOLVED','UNCONFIRMED'],
['VERIFIED','UNCONFIRMED'],
- ['CLOSED','UNCONFIRMED'],
- ['ASSIGNED','NEW'],
- ['REOPENED','NEW'],
- ['REOPENED','ASSIGNED'],
- ['RESOLVED','REOPENED'],
- ['VERIFIED','REOPENED'],
- ['CLOSED','REOPENED'],
- ['UNCONFIRMED','RESOLVED'],
- ['NEW','RESOLVED'],
- ['ASSIGNED','RESOLVED'],
- ['REOPENED','RESOLVED'],
- ['RESOLVED','VERIFIED'],
-
);
<% end %>
@@ -384,9 +365,9 @@ sub install_before_final_checks {
<% if @custom_wf %>
my %status_ids = @{ $dbh->selectcol_arrayref(
'SELECT value, id FROM bug_status', {Columns=>[1,2]}) };
- my $old_id = $status_ids{'REOPENED'};
+ my $old_id = $status_ids{'IN_PROGRESS'};
my $new_id = $status_ids{'UNCONFIRMED'};
- if (!$dbh->selectrow_array('SELECT 1 FROM status_workflow where old_status ='. $old_id . ' and new_status ='.$new_id)) {
+ if (!$dbh->selectrow_array('SELECT 1 FROM status_workflow where old_status = '. $old_id . ' and new_status = '.$new_id)) {
print "create additional status_workflow...\n" unless $args->{silent};
my $sth_insert = $dbh->prepare('INSERT INTO status_workflow (old_status, new_status)
VALUES (?, ?)');
@@ -414,9 +395,9 @@ sub install_before_final_checks {
}
my %status_ids = @{ $dbh->selectcol_arrayref(
'SELECT value, id FROM bug_status', {Columns=>[1,2]}) };
- my $old_id = $status_ids{'REOPENED'};
+ my $old_id = $status_ids{'IN_PROGRESS'};
my $new_id = $status_ids{'UNCONFIRMED'};
- if (!$dbh->selectrow_array('SELECT 1 FROM status_workflow where old_status ='. $old_id . ' and new_status ='.$new_id)) {
+ if (!$dbh->selectrow_array('SELECT 1 FROM status_workflow where old_status = '. $old_id . ' and new_status = '.$new_id)) {
print "create additional status_workflow...\n" unless $args->{silent};
my $sth_insert = $dbh->prepare('INSERT INTO status_workflow (old_status, new_status)
VALUES (?, ?)');
diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/answers.erb b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/answers.erb
index b5b219985..eca2ac51a 100644
--- a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/answers.erb
+++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/answers.erb
@@ -18,6 +18,6 @@ $answer{'usestatuswhiteboard'} = '1';
$answer{'maintainer'} = 'admin@mylyn.eclipse.org';
$answer{'insidergroup'} = 'bz_canusewhineatothers';
-<% if @custom_wf_and_status %>$answer{'duplicate_or_move_bug_status'} = 'CLOSED';<% end %>
+<% if @custom_wf_and_status %>$answer{'duplicate_or_move_bug_status'} = 'VERIFIED';<% end %>
<% if @usebugaliases %>$answer{'usebugaliases'} = '1';<% end %>
$answer{'NO_PAUSE'} = 1
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaTests.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaTests.java
index 1f26f87c6..4c3102292 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaTests.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaTests.java
@@ -85,11 +85,6 @@ public class AllBugzillaTests {
fixture.add(BugzillaRepositoryConnectorTest.class);
fixture.add(BugzillaAttachmentHandlerTest.class);
- // Only run this if we have custom status and Workflow
- if (fixture.isCustomWorkflowAndStatus()) {
- fixture.add(BugzillaCustomRepositoryTest.class);
- }
-
fixture.done();
}
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
deleted file mode 100644
index 52e02d8bf..000000000
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaCustomRepositoryTest.java
+++ /dev/null
@@ -1,290 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat Inc. 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:
- * Red Hat Inc. - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.bugzilla.tests;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.mylyn.bugzilla.tests.support.BugzillaFixture;
-import org.eclipse.mylyn.internal.bugzilla.core.Messages;
-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.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;
-import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
-import org.eclipse.mylyn.tasks.core.data.TaskOperation;
-import org.eclipse.mylyn.tasks.ui.TasksUi;
-import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
-
-/**
- * @author Charley Wang
- */
-public class BugzillaCustomRepositoryTest extends AbstractBugzillaTest {
-
- public void testWorkflow() throws Exception {
- String taskId = harness.taskCfBugIdExists();
- if (taskId == null) {
- taskId = harness.createCfBugIdTask();
- }
- doCustomWorkflow(taskId);
- }
-
- private void doCustomWorkflow(String DupBugID) throws Exception {
- final TaskMapping taskMappingInit = new TaskMapping() {
-
- @Override
- public String getProduct() {
- return "TestProduct";
- }
- };
- final TaskMapping taskMappingSelect = new TaskMapping() {
- @Override
- public String getComponent() {
- return "TestComponent";
- }
-
- @Override
- public String getSummary() {
- return "test the custom workflow";
- }
-
- @Override
- public String getDescription() {
- return "The Description of the custom workflow task";
- }
-
- };
-
- final TaskData[] taskDataNew = new TaskData[1];
- // create Task
- taskDataNew[0] = TasksUiInternal.createTaskData(repository, taskMappingInit, taskMappingSelect, null);
- ITask taskNew = TasksUiUtil.createOutgoingNewTask(taskDataNew[0].getConnectorKind(),
- taskDataNew[0].getRepositoryUrl());
-
- ITaskDataWorkingCopy workingCopy = TasksUi.getTaskDataManager().createWorkingCopy(taskNew, taskDataNew[0]);
- Set<TaskAttribute> changed = new HashSet<TaskAttribute>();
- workingCopy.save(changed, null);
-
- RepositoryResponse response = BugzillaFixture.current().submitTask(taskDataNew[0], client);
- ((AbstractTask) taskNew).setSubmitting(true);
-
- assertNotNull(response);
- assertEquals(ResponseKind.TASK_CREATED.toString(), response.getReposonseKind().toString());
- String taskId = response.getTaskId();
-
- // change Status from NEW -> ASSIGNED
- ITask task = generateLocalTaskAndDownload(taskId);
- assertNotNull(task);
- TaskDataModel model = createModel(task);
- TaskData taskData = model.getTaskData();
- assertNotNull(taskData);
- TaskAttribute statusAttribute = taskData.getRoot().getMappedAttribute(TaskAttribute.STATUS);
- assertEquals("NEW", statusAttribute.getValue());
- TaskAttribute selectedOperationAttribute = taskData.getRoot().getMappedAttribute(TaskAttribute.OPERATION);
- TaskOperation.applyTo(selectedOperationAttribute, "accept", Messages.BugzillaOperation_Accept_to_ASSIGNED);
- model.attributeChanged(selectedOperationAttribute);
- changed.clear();
- changed.add(selectedOperationAttribute);
- workingCopy.save(changed, null);
- response = BugzillaFixture.current().submitTask(taskData, client);
-// response = submit(taskNew, taskData, changed);
-// assertNotNull(response);
- assertEquals(ResponseKind.TASK_UPDATED.toString(), response.getReposonseKind().toString());
-
- // Customization case 1: Change workflow for standard statuses
- // change Status from ASSIGNED -> NEW should not work and should not throw an error
- task = generateLocalTaskAndDownload(taskId);
- assertNotNull(task);
- model = createModel(task);
- taskData = model.getTaskData();
- assertNotNull(taskData);
- statusAttribute = taskData.getRoot().getMappedAttribute(TaskAttribute.STATUS);
- assertEquals("ASSIGNED", statusAttribute.getValue());
- selectedOperationAttribute = taskData.getRoot().getMappedAttribute(TaskAttribute.OPERATION);
- TaskOperation.applyTo(selectedOperationAttribute, "markNew", Messages.BugzillaOperation_Mark_as_NEW);
- model.attributeChanged(selectedOperationAttribute);
- changed.clear();
- changed.add(selectedOperationAttribute);
- workingCopy.save(changed, null);
- response = BugzillaFixture.current().submitTask(taskData, client);
- assertNotNull(response);
- assertEquals(ResponseKind.TASK_UPDATED.toString(), response.getReposonseKind().toString());
-
- // Customization case 3: Special Bugzilla information (duplicateStatus)
- // change Status from ASSIGNED -> DUPLICATE
- task = generateLocalTaskAndDownload(taskId);
- assertNotNull(task);
- model = createModel(task);
- taskData = model.getTaskData();
- assertNotNull(taskData);
- statusAttribute = taskData.getRoot().getMappedAttribute(TaskAttribute.STATUS);
- assertEquals("ASSIGNED", statusAttribute.getValue());
- selectedOperationAttribute = taskData.getRoot().getMappedAttribute(TaskAttribute.OPERATION);
- TaskOperation.applyTo(selectedOperationAttribute, "duplicate", Messages.BugzillaOperation_Duplicate_of);
- TaskAttribute duplicateAttribute = taskData.getRoot().getAttribute("dup_id");
- duplicateAttribute.setValue(DupBugID);
- model.attributeChanged(selectedOperationAttribute);
- model.attributeChanged(duplicateAttribute);
- changed.clear();
- changed.add(selectedOperationAttribute);
- changed.add(duplicateAttribute);
- workingCopy.save(changed, null);
- response = BugzillaFixture.current().submitTask(taskData, client);
- assertNotNull(response);
- assertEquals(ResponseKind.TASK_UPDATED.toString(), response.getReposonseKind().toString());
-
- // Customization case 3: Special Bugzilla information (duplicateStatus)
- // change Status from [CLOSED] DUPLICATE -> VERIFIED
- task = generateLocalTaskAndDownload(taskId);
- assertNotNull(task);
- model = createModel(task);
- taskData = model.getTaskData();
- assertNotNull(taskData);
- statusAttribute = taskData.getRoot().getMappedAttribute(TaskAttribute.STATUS);
- assertEquals("CLOSED", statusAttribute.getValue());
- TaskAttribute resolution = taskData.getRoot().getMappedAttribute(TaskAttribute.RESOLUTION);
- assertEquals("DUPLICATE", resolution.getValue());
- selectedOperationAttribute = taskData.getRoot().getMappedAttribute(TaskAttribute.OPERATION);
- TaskOperation.applyTo(selectedOperationAttribute, "verify", Messages.BugzillaOperation_Mark_as_VERIFIED);
- model.attributeChanged(selectedOperationAttribute);
- changed.clear();
- changed.add(selectedOperationAttribute);
- workingCopy.save(changed, null);
- response = BugzillaFixture.current().submitTask(taskData, client);
- assertNotNull(response);
- assertEquals(ResponseKind.TASK_UPDATED.toString(), response.getReposonseKind().toString());
-
- // Customization case 2: Custom name, open bug_status
- // change Status from VERIFIED -> MODIFIED
- task = generateLocalTaskAndDownload(taskId);
- assertNotNull(task);
- model = createModel(task);
- taskData = model.getTaskData();
- assertNotNull(taskData);
- statusAttribute = taskData.getRoot().getMappedAttribute(TaskAttribute.STATUS);
- assertEquals("VERIFIED", statusAttribute.getValue());
- selectedOperationAttribute = taskData.getRoot().getMappedAttribute(TaskAttribute.OPERATION);
- TaskOperation.applyTo(selectedOperationAttribute, "MODIFIED", Messages.BugzillaOperation_Reopen_bug);
- model.attributeChanged(selectedOperationAttribute);
- changed.clear();
- changed.add(selectedOperationAttribute);
- workingCopy.save(changed, null);
- response = BugzillaFixture.current().submitTask(taskData, client);
- assertNotNull(response);
- assertEquals(ResponseKind.TASK_UPDATED.toString(), response.getReposonseKind().toString());
-
- // Customization case 2: Custom name, open bug_status
- // change Status from MODIFIED -> ON_DEV
- task = generateLocalTaskAndDownload(taskId);
- assertNotNull(task);
- model = createModel(task);
- taskData = model.getTaskData();
- assertNotNull(taskData);
- statusAttribute = taskData.getRoot().getMappedAttribute(TaskAttribute.STATUS);
- assertEquals("MODIFIED", statusAttribute.getValue());
- selectedOperationAttribute = taskData.getRoot().getMappedAttribute(TaskAttribute.OPERATION);
- TaskOperation.applyTo(selectedOperationAttribute, "ON_DEV", Messages.BugzillaOperation_Reopen_bug);
- model.attributeChanged(selectedOperationAttribute);
- changed.clear();
- changed.add(selectedOperationAttribute);
- workingCopy.save(changed, null);
- response = BugzillaFixture.current().submitTask(taskData, client);
- assertNotNull(response);
- assertEquals(ResponseKind.TASK_UPDATED.toString(), response.getReposonseKind().toString());
-
- // Customization case 2: Custom name, closed bug_status
- // change Status from ON_DEV -> POST FIXED
- task = generateLocalTaskAndDownload(taskId);
- assertNotNull(task);
- model = createModel(task);
- taskData = model.getTaskData();
- assertNotNull(taskData);
- statusAttribute = taskData.getRoot().getMappedAttribute(TaskAttribute.STATUS);
- assertEquals("ON_DEV", statusAttribute.getValue());
- selectedOperationAttribute = taskData.getRoot().getMappedAttribute(TaskAttribute.OPERATION);
- TaskOperation.applyTo(selectedOperationAttribute, "POST", Messages.BugzillaOperation_Resolve_as);
- resolution = taskData.getRoot().getMappedAttribute(TaskAttribute.RESOLUTION);
- resolution.setValue("FIXED");
- model.attributeChanged(selectedOperationAttribute);
- model.attributeChanged(resolution);
- changed.clear();
- changed.add(selectedOperationAttribute);
- changed.add(resolution);
- workingCopy.save(changed, null);
- response = BugzillaFixture.current().submitTask(taskData, client);
- assertNotNull(response);
- assertEquals(ResponseKind.TASK_UPDATED.toString(), response.getReposonseKind().toString());
-
- // Customization case 2: Custom name, closing bug
- // change Status from POST FIXED -> CLOSED FIXED
- task = generateLocalTaskAndDownload(taskId);
- assertNotNull(task);
- model = createModel(task);
- taskData = model.getTaskData();
- assertNotNull(taskData);
- statusAttribute = taskData.getRoot().getMappedAttribute(TaskAttribute.STATUS);
- assertEquals("POST", statusAttribute.getValue());
- resolution = taskData.getRoot().getMappedAttribute(TaskAttribute.RESOLUTION);
- assertEquals("FIXED", resolution.getValue());
- selectedOperationAttribute = taskData.getRoot().getMappedAttribute(TaskAttribute.OPERATION);
- TaskOperation.applyTo(selectedOperationAttribute, "close", Messages.BugzillaOperation_Resolve_as);
- resolution = taskData.getRoot().getMappedAttribute(TaskAttribute.RESOLUTION);
- resolution.setValue("FIXED");
- model.attributeChanged(selectedOperationAttribute);
- model.attributeChanged(resolution);
- changed.clear();
- changed.add(selectedOperationAttribute);
- changed.add(resolution);
- workingCopy.save(changed, null);
- response = BugzillaFixture.current().submitTask(taskData, client);
- assertNotNull(response);
- assertEquals(ResponseKind.TASK_UPDATED.toString(), response.getReposonseKind().toString());
-
- // Customization case 1: Change workflow for standard statuses
- // change Status from CLOSE -> REOPENED should not work
- task = generateLocalTaskAndDownload(taskId);
- assertNotNull(task);
- model = createModel(task);
- taskData = model.getTaskData();
- assertNotNull(taskData);
- statusAttribute = taskData.getRoot().getMappedAttribute(TaskAttribute.STATUS);
- assertEquals("CLOSED", statusAttribute.getValue());
- resolution = taskData.getRoot().getMappedAttribute(TaskAttribute.RESOLUTION);
- assertEquals("FIXED", resolution.getValue());
- selectedOperationAttribute = taskData.getRoot().getMappedAttribute(TaskAttribute.OPERATION);
- TaskOperation.applyTo(selectedOperationAttribute, "reopen", Messages.BugzillaOperation_Reopen_bug);
- model.attributeChanged(selectedOperationAttribute);
- changed.clear();
- changed.add(selectedOperationAttribute);
- workingCopy.save(changed, null);
- response = BugzillaFixture.current().submitTask(taskData, client);
- assertNotNull(response);
- assertEquals(ResponseKind.TASK_UPDATED.toString(), response.getReposonseKind().toString());
-
- // test last state has not changed
- task = generateLocalTaskAndDownload(taskId);
- assertNotNull(task);
- model = createModel(task);
- taskData = model.getTaskData();
- assertNotNull(taskData);
- statusAttribute = taskData.getRoot().getMappedAttribute(TaskAttribute.STATUS);
- assertEquals("CLOSED", statusAttribute.getValue());
- resolution = taskData.getRoot().getMappedAttribute(TaskAttribute.RESOLUTION);
- assertEquals("FIXED", resolution.getValue());
- }
-
-}
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXmlRpcClientTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXmlRpcClientTest.java
index f67d02d69..213858a76 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXmlRpcClientTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXmlRpcClientTest.java
@@ -147,15 +147,13 @@ public class BugzillaXmlRpcClientTest extends AbstractBugzillaTest {
put("RESOLVED", new ArrayList<String>() {
{
add("verify");
- add("reopen");
+ add("unconfirmed");
add("CONFIRMED");
}
});
put("VERIFIED", new ArrayList<String>() {
{
- add("reopen");
- add("resolve");
- add("duplicate");
+ add("unconfirmed");
add("CONFIRMED");
}
});
@@ -163,140 +161,99 @@ public class BugzillaXmlRpcClientTest extends AbstractBugzillaTest {
});
put(BugzillaFixture.CUSTOM_WF, new HashMap<String, ArrayList<String>>() {
{
- put("NEW", new ArrayList<String>() {
- {
- add("resolve");
- add("accept");
- add("duplicate");
- add("close");
- }
- });
put("UNCONFIRMED", new ArrayList<String>() {
{
add("resolve");
- add("accept");
+ add("CONFIRMED");
+ add("IN_PROGRESS");
add("duplicate");
- add("markNew");
}
});
- put("ASSIGNED", new ArrayList<String>() {
+ put("CONFIRMED", new ArrayList<String>() {
{
add("resolve");
+ add("verify");
+ add("IN_PROGRESS");
add("duplicate");
- add("markNew");
}
});
- put("REOPENED", new ArrayList<String>() {
+ put("IN_PROGRESS", new ArrayList<String>() {
{
+ add("unconfirmed");
add("resolve");
- add("accept");
add("duplicate");
- add("markNew");
- add("reopen");
- add("close");
- add("verify");
}
});
put("RESOLVED", new ArrayList<String>() {
{
+ add("unconfirmed");
+ add("CONFIRMED");
add("verify");
- add("reopen");
- add("close");
}
});
put("VERIFIED", new ArrayList<String>() {
{
- add("reopen");
- add("resolve");
- add("duplicate");
- add("close");
- }
- });
- put("CLOSED", new ArrayList<String>() {
- {
- add("reopen");
+ add("unconfirmed");
+ add("CONFIRMED");
add("resolve");
- add("duplicate");
}
});
}
});
put(BugzillaFixture.CUSTOM_WF_AND_STATUS, new HashMap<String, ArrayList<String>>() {
{
- put("NEW", new ArrayList<String>() {
- {
- add("resolve");
- add("accept");
- add("duplicate");
- add("close");
- add("reopen");
- }
- });
put("UNCONFIRMED", new ArrayList<String>() {
{
add("resolve");
- add("accept");
+ add("CONFIRMED");
+ add("IN_PROGRESS");
add("duplicate");
- add("markNew");
- add("close");
+ add("verify");
}
});
- put("ASSIGNED", new ArrayList<String>() {
+ put("CONFIRMED", new ArrayList<String>() {
{
add("resolve");
+ add("verify");
+ add("IN_PROGRESS");
add("duplicate");
- add("markNew");
- add("close");
}
});
- put("REOPENED", new ArrayList<String>() {
+ put("IN_PROGRESS", new ArrayList<String>() {
{
+ add("CONFIRMED");
add("resolve");
- add("accept");
add("duplicate");
- add("markNew");
- add("reopen");
- add("close");
+ add("verify");
}
});
put("RESOLVED", new ArrayList<String>() {
{
+ add("unconfirmed");
+ add("CONFIRMED");
add("verify");
- add("reopen");
- add("close");
}
});
put("VERIFIED", new ArrayList<String>() {
{
- add("reopen");
- add("resolve");
- add("duplicate");
- add("close");
add("MODIFIED");
- }
- });
- put("CLOSED", new ArrayList<String>() {
- {
- add("reopen");
- add("resolve");
- add("duplicate");
- add("verify");
+ add("CONFIRMED");
}
});
put("ON_DEV", new ArrayList<String>() {
{
- add("close");
+ add("verify");
add("POST");
}
});
put("POST", new ArrayList<String>() {
{
- add("close");
+ add("verify");
}
});
put("MODIFIED", new ArrayList<String>() {
{
- add("close");
+ add("verify");
add("ON_DEV");
}
});
@@ -339,21 +296,6 @@ public class BugzillaXmlRpcClientTest extends AbstractBugzillaTest {
}
}
-// @SuppressWarnings("unused")
-// only for local development work
-// public void testXmlRpc() throws Exception {
-// if (!BugzillaFixture.current().getDescription().equals(BugzillaFixture.XML_RPC_DISABLED)) {
-// IProgressMonitor monitor = new NullProgressMonitor();
-// HashMap<?, ?> x1 = bugzillaClient.getTime(monitor);
-// Date x2 = bugzillaClient.getDBTime(monitor);
-// Date x3 = bugzillaClient.getWebTime(monitor);
-// if (BugzillaVersion.BUGZILLA_3_4.compareTo(BugzillaFixture.current().getBugzillaVersion()) == 0) {
-// Object[] xx3 = bugzillaClient.getAllFields(monitor);
-// Object[] xx4 = bugzillaClient.getFieldsWithNames(monitor, new String[] { "qa_contact" });
-// Object[] xx5 = bugzillaClient.getFieldsWithIDs(monitor, new Integer[] { 12, 18 });
-// }
-// }
-// }
public void testGetVersion() throws Exception {
if (!BugzillaFixture.current().isXmlRpcEnabled()) {
return;
diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/repository/DescriptorFile-custom-wf-and-status.txt b/org.eclipse.mylyn.bugzilla.tests/testdata/repository/DescriptorFile-custom-wf-and-status.txt
deleted file mode 100644
index bdbd77b37..000000000
--- a/org.eclipse.mylyn.bugzilla.tests/testdata/repository/DescriptorFile-custom-wf-and-status.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-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:

Back to the top