Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2010-06-09 21:11:49 -0400
committerspingel2010-06-09 21:11:49 -0400
commitadf60a6db172594777846de7121638451fff9cf8 (patch)
tree6947b696eee75e149df5513581059d4baeb8a2c0
parent6afbd8665a16bfafedee20d6ae71186096e80f2f (diff)
downloadorg.eclipse.mylyn.tasks-e_3_6_m_3_3_x.tar.gz
org.eclipse.mylyn.tasks-e_3_6_m_3_3_x.tar.xz
org.eclipse.mylyn.tasks-e_3_6_m_3_3_x.zip
fix failing 3_3_x testse_3_6_m_3_3_x
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepository32Test.java141
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java2
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracXmlRpcClientTest.java20
3 files changed, 82 insertions, 81 deletions
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepository32Test.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepository32Test.java
index 25f24734a..2c9493371 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepository32Test.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepository32Test.java
@@ -25,13 +25,11 @@ import org.eclipse.mylyn.bugzilla.tests.support.BugzillaFixture;
import org.eclipse.mylyn.commons.net.AuthenticationCredentials;
import org.eclipse.mylyn.commons.net.AuthenticationType;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
-import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery;
import org.eclipse.mylyn.internal.tasks.core.sync.SubmitTaskJob;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState;
-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;
@@ -68,75 +66,76 @@ public class BugzillaRepository32Test extends AbstractBugzillaTest {
}
- public void testSecondSubmit() throws Exception {
- init322();
- String taskNumber = "1";
- RepositoryQuery query = new RepositoryQuery("bugzilla", "blah");
- query.setRepositoryUrl(BugzillaTestConstants.TEST_BUGZILLA_322_URL);
- query.setUrl("?short_desc_type=allwordssubstr&short_desc=&product=TestProduct&long_desc_type=allwordssubstr&long_desc=&order=Importance&ctype=rdf");
- TasksUiInternal.getTaskList().addQuery(query);
- TasksUiInternal.synchronizeQuery(connector, query, null, true);
-
- ITask task = TasksUiInternal.getTask(BugzillaTestConstants.TEST_BUGZILLA_322_URL, taskNumber, "");
- assertNotNull(task);
- ITaskDataWorkingCopy taskDataState = TasksUi.getTaskDataManager().getWorkingCopy(task);//TasksUiPlugin.getTaskDataManager().getTaskData(task);
- assertNotNull(taskDataState);
- TaskDataModel model = new TaskDataModel(repository, task, taskDataState);
-
- TaskData taskData = model.getTaskData();
- //remove the token (i.e. unpatched Bugzilla 3.2.2)
- //taskData.getRoot().removeAttribute("token");
-
- TaskAttribute attrPriority = taskData.getRoot().getAttribute("priority");
- boolean p1 = false;
- if (attrPriority.getValue().equals("P1")) {
- p1 = true;
- attrPriority.setValue("P2");
- } else {
- attrPriority.setValue("P1");
- }
-
- model.attributeChanged(attrPriority);
- model.save(new NullProgressMonitor());
- submit(task, model);
-
- TasksUiInternal.synchronizeRepository(repository, false);
-
- task = TasksUiPlugin.getTaskList().getTask(BugzillaTestConstants.TEST_BUGZILLA_322_URL, taskNumber);
- assertNotNull(task);
- assertEquals(!p1, task.getPriority().equals("P1"));
-
- // Attempt 2
-
- taskDataState = TasksUi.getTaskDataManager().getWorkingCopy(task);//TasksUiPlugin.getTaskDataManager().getTaskData(task);
- assertNotNull(taskDataState);
- model = new TaskDataModel(repository, task, taskDataState);
-
- taskData = model.getTaskData();
- //remove the token (i.e. unpatched Bugzilla 3.2.2)
- //taskData.getRoot().removeAttribute("token");
-
- attrPriority = taskData.getRoot().getAttribute("priority");
- p1 = false;
- if (attrPriority.getValue().equals("P1")) {
- p1 = true;
- attrPriority.setValue("P2");
- } else {
- attrPriority.setValue("P1");
- }
-
- model.attributeChanged(attrPriority);
- model.save(new NullProgressMonitor());
- connector.getClientManager().repositoryRemoved(repository);
- submit(task, model);
-
- TasksUiInternal.synchronizeRepository(repository, false);
-
- task = TasksUiPlugin.getTaskList().getTask(BugzillaTestConstants.TEST_BUGZILLA_322_URL, taskNumber);
- assertNotNull(task);
- assertEquals(!p1, task.getPriority().equals("P1"));
-
- }
+ // 3.2.2 is no longer supported
+// public void testSecondSubmit() throws Exception {
+// init322();
+// String taskNumber = "1";
+// RepositoryQuery query = new RepositoryQuery("bugzilla", "blah");
+// query.setRepositoryUrl(BugzillaTestConstants.TEST_BUGZILLA_322_URL);
+// query.setUrl("?short_desc_type=allwordssubstr&short_desc=&product=TestProduct&long_desc_type=allwordssubstr&long_desc=&order=Importance&ctype=rdf");
+// TasksUiInternal.getTaskList().addQuery(query);
+// TasksUiInternal.synchronizeQuery(connector, query, null, true);
+//
+// ITask task = TasksUiInternal.getTask(BugzillaTestConstants.TEST_BUGZILLA_322_URL, taskNumber, "");
+// assertNotNull(task);
+// ITaskDataWorkingCopy taskDataState = TasksUi.getTaskDataManager().getWorkingCopy(task);//TasksUiPlugin.getTaskDataManager().getTaskData(task);
+// assertNotNull(taskDataState);
+// TaskDataModel model = new TaskDataModel(repository, task, taskDataState);
+//
+// TaskData taskData = model.getTaskData();
+// //remove the token (i.e. unpatched Bugzilla 3.2.2)
+// //taskData.getRoot().removeAttribute("token");
+//
+// TaskAttribute attrPriority = taskData.getRoot().getAttribute("priority");
+// boolean p1 = false;
+// if (attrPriority.getValue().equals("P1")) {
+// p1 = true;
+// attrPriority.setValue("P2");
+// } else {
+// attrPriority.setValue("P1");
+// }
+//
+// model.attributeChanged(attrPriority);
+// model.save(new NullProgressMonitor());
+// submit(task, model);
+//
+// TasksUiInternal.synchronizeRepository(repository, false);
+//
+// task = TasksUiPlugin.getTaskList().getTask(BugzillaTestConstants.TEST_BUGZILLA_322_URL, taskNumber);
+// assertNotNull(task);
+// assertEquals(!p1, task.getPriority().equals("P1"));
+//
+// // Attempt 2
+//
+// taskDataState = TasksUi.getTaskDataManager().getWorkingCopy(task);//TasksUiPlugin.getTaskDataManager().getTaskData(task);
+// assertNotNull(taskDataState);
+// model = new TaskDataModel(repository, task, taskDataState);
+//
+// taskData = model.getTaskData();
+// //remove the token (i.e. unpatched Bugzilla 3.2.2)
+// //taskData.getRoot().removeAttribute("token");
+//
+// attrPriority = taskData.getRoot().getAttribute("priority");
+// p1 = false;
+// if (attrPriority.getValue().equals("P1")) {
+// p1 = true;
+// attrPriority.setValue("P2");
+// } else {
+// attrPriority.setValue("P1");
+// }
+//
+// model.attributeChanged(attrPriority);
+// model.save(new NullProgressMonitor());
+// connector.getClientManager().repositoryRemoved(repository);
+// submit(task, model);
+//
+// TasksUiInternal.synchronizeRepository(repository, false);
+//
+// task = TasksUiPlugin.getTaskList().getTask(BugzillaTestConstants.TEST_BUGZILLA_322_URL, taskNumber);
+// assertNotNull(task);
+// assertEquals(!p1, task.getPriority().equals("P1"));
+//
+// }
protected void submit(ITask task, TaskDataModel model) throws Exception {
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 4eea6ec18..9dff65e4c 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
@@ -80,7 +80,7 @@ public class BugzillaFixture extends TestFixture {
"3.2.3", "");
public static BugzillaFixture BUGS_3_4 = new BugzillaFixture(BugzillaTestConstants.TEST_BUGZILLA_34_URL, //
- "3.4.4", "");
+ "3.4.6", "");
public static BugzillaFixture BUGS_HEAD = new BugzillaFixture(BugzillaTestConstants.TEST_BUGZILLA_HEAD_URL, //
"3.5.2+", "");
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracXmlRpcClientTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracXmlRpcClientTest.java
index 0c2752928..82d6e0860 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracXmlRpcClientTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracXmlRpcClientTest.java
@@ -184,10 +184,17 @@ public class TracXmlRpcClientTest extends TestCase {
+ " * {{{monospace}}} or `monospace`\n" + " * ~~strike-through~~\n" + " * ^superscript^ \n"
+ " * ,,subscript,,\n" + "= Heading =\n" + "== Subheading ==\n";
- String expectedHtml = "<h1 id=\"WikiFormattingTesting\"><a class=\"missing wiki\" href=\""
- + tracUrl
- + "/wiki/WikiFormattingTesting\" rel=\"nofollow\">WikiFormattingTesting?</a></h1>\n<ul><li><strong>bold</strong>, <strong>\'\'\' can be bold too</strong>, and <strong>! </strong>\n</li><li><i>italic</i>\n</li><li><strong><i>bold italic</i></strong>\n</li><li><span class=\"underline\">underline</span>\n</li><li><tt>monospace</tt> or <tt>monospace</tt>\n</li><li><del>strike-through</del>\n</li><li><sup>superscript</sup> \n</li><li><sub>subscript</sub>\n</li></ul><h1 id=\"Heading\">Heading</h1>\n<h2 id=\"Subheading\">Subheading</h2>\n";
-
+ String expectedHtml;
+ if (TracFixture.current().getVersion().compareTo("0.12") >= 0) {
+ // the output format has changed in Trac 0.12
+ expectedHtml = "<h1 id=\"WikiFormattingTesting\"><a class=\"missing wiki\" href=\""
+ + tracUrl
+ + "/wiki/WikiFormattingTesting\" rel=\"nofollow\">WikiFormattingTesting?</a></h1>\n<ul><li><strong>bold</strong>, <strong>\'\'\' can be bold too</strong>, and <strong>! </strong>\n</li><li><em>italic</em>\n</li><li><strong><em>bold italic</em></strong>\n</li><li><span class=\"underline\">underline</span>\n</li><li><tt>monospace</tt> or <tt>monospace</tt>\n</li><li><del>strike-through</del>\n</li><li><sup>superscript</sup> \n</li><li><sub>subscript</sub>\n</li></ul><h1 id=\"Heading\">Heading</h1>\n<h2 id=\"Subheading\">Subheading</h2>\n";
+ } else {
+ expectedHtml = "<h1 id=\"WikiFormattingTesting\"><a class=\"missing wiki\" href=\""
+ + tracUrl
+ + "/wiki/WikiFormattingTesting\" rel=\"nofollow\">WikiFormattingTesting?</a></h1>\n<ul><li><strong>bold</strong>, <strong>\'\'\' can be bold too</strong>, and <strong>! </strong>\n</li><li><i>italic</i>\n</li><li><strong><i>bold italic</i></strong>\n</li><li><span class=\"underline\">underline</span>\n</li><li><tt>monospace</tt> or <tt>monospace</tt>\n</li><li><del>strike-through</del>\n</li><li><sup>superscript</sup> \n</li><li><sub>subscript</sub>\n</li></ul><h1 id=\"Heading\">Heading</h1>\n<h2 id=\"Subheading\">Subheading</h2>\n";
+ }
html = ((TracXmlRpcClient) client).wikiToHtml(source, null);
assertEquals(expectedHtml, html);
}
@@ -334,11 +341,6 @@ public class TracXmlRpcClientTest extends TestCase {
}
public void testGetRecentWikiChanges() throws Exception {
- // FIXME 3.4 re-enable for trunk
- if (TracFixture.current() == TracFixture.TRAC_TRUNK_XML_RPC) {
- return;
- }
-
TracWikiPageInfo[] changes = ((TracXmlRpcClient) client).getRecentWikiChanges(new Date(0), null);
TracWikiPageInfo testPage = null;
for (TracWikiPageInfo item : changes) {

Back to the top