summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2013-04-29 13:16:42 (EDT)
committer Steffen Pingel2013-04-29 17:31:45 (EDT)
commitcf25c35dfc8fc8d280d649be3f770dd8b36907f0 (patch)
tree1fef82de81edcebee4102f39ea39701d5a56c8f4
parent58243ff3cad073116c0dc140ec580d99ea635344 (diff)
downloadorg.eclipse.mylyn.tasks-cf25c35dfc8fc8d280d649be3f770dd8b36907f0.zip
org.eclipse.mylyn.tasks-cf25c35dfc8fc8d280d649be3f770dd8b36907f0.tar.gz
org.eclipse.mylyn.tasks-cf25c35dfc8fc8d280d649be3f770dd8b36907f0.tar.bz2
update test fixture URLs and disable obsolete testsR_3_8_4refs/changes/55/12355/3
* The test data that tests expect is no longer present in the repository. Change-Id: I0688b49b4be05ca921d068dc39dbc014d73e4126
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaAttachmentHandlerTest.java34
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaClientTest.java181
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaCustomFieldsTest.java153
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java8
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracHeadlessStandaloneTests.java2
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracClientTest.java144
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracXmlRpcClientTest.java281
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracAttachmentHandlerTest.java66
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracClientManagerTest.java2
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorTest.java71
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracFixture.java2
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestConstants.java10
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/ui/TracRepositorySettingsPageTest.java8
13 files changed, 471 insertions, 491 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 c66e548..0079aec 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
@@ -22,6 +22,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
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.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaStatus;
@@ -37,7 +38,6 @@ import org.eclipse.mylyn.tasks.core.data.TaskAttachmentMapper;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.ui.TasksUi;
-import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
/**
* @author Robert Elves
@@ -446,22 +446,22 @@ public class BugzillaAttachmentHandlerTest extends AbstractBugzillaTest {
/**
* Ensure obsoletes and patches are marked as such by the parser.
*/
- public void testAttachmentAttributes() throws Exception {
- String taskNumber = "3";
- TaskData taskData = BugzillaFixture.current().getTask(taskNumber, client);
- assertNotNull(taskData);
- 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], task));
- index++;
- }
- assertEquals(4, index);
- }
+// public void testAttachmentAttributes() throws Exception {
+// String taskNumber = "3";
+// TaskData taskData = BugzillaFixture.current().getTask(taskNumber, client);
+// assertNotNull(taskData);
+// 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], task));
+// index++;
+// }
+// assertEquals(4, index);
+// }
private boolean validateAttachmentAttributes(TaskData data, TaskAttribute taskAttribute, boolean isPatch,
boolean isObsolete, ITask task) {
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaClientTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaClientTest.java
index 1019471..4feaae3 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaClientTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaClientTest.java
@@ -26,15 +26,10 @@ import org.eclipse.mylyn.commons.net.AuthenticationCredentials;
import org.eclipse.mylyn.commons.net.AuthenticationType;
import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttributeMapper;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion;
-import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration;
import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery;
import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryLocation;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
-import org.eclipse.mylyn.tasks.core.RepositoryResponse;
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
@@ -61,54 +56,54 @@ public class BugzillaClientTest extends TestCase {
client = BugzillaFixture.current().client();
}
- public void testRDFProductConfig() throws Exception {
- RepositoryConfiguration config = client.getRepositoryConfiguration();
- assertNotNull(config);
- assertEquals(
- 0,
- config.getInstallVersion().compareMajorMinorOnly(
- new BugzillaVersion(BugzillaFixture.current().getVersion())));
- if (BugzillaFixture.current() == BugzillaFixture.BUGS_3_6_CUSTOM_WF_AND_STATUS) {
- assertEquals(10, config.getStatusValues().size());
- } else if (BugzillaFixture.current().getBugzillaVersion().compareMajorMinorOnly(BugzillaVersion.BUGZILLA_4_0) < 0) {
- assertEquals(7, config.getStatusValues().size());
- } else {
- assertEquals(5, config.getStatusValues().size());
- }
- if (config.getResolutions().contains("LATER")) {
- assertEquals(8, config.getResolutions().size());
- assertEquals(8, config.getPlatforms().size());
- assertEquals(36, config.getOSs().size());
- assertEquals(5, config.getPriorities().size());
- } else {
- assertEquals(6, config.getResolutions().size());
- assertEquals(4, config.getPlatforms().size());
- assertEquals(5, config.getOSs().size());
- assertEquals(6, config.getPriorities().size());
- }
- assertEquals(7, config.getSeverities().size());
- assertEquals(3, config.getProducts().size());
- if (BugzillaFixture.current() == BugzillaFixture.BUGS_3_6_CUSTOM_WF_AND_STATUS) {
- assertEquals(6, config.getOpenStatusValues().size());
- assertEquals(1, config.getClosedStatusValues().size());
- } else if (BugzillaFixture.current().getBugzillaVersion().compareMajorMinorOnly(BugzillaVersion.BUGZILLA_4_0) < 0) {
- assertEquals(4, config.getOpenStatusValues().size());
- assertEquals(3, config.getClosedStatusValues().size());
- } else {
- assertEquals(3, config.getOpenStatusValues().size());
- assertEquals(2, config.getClosedStatusValues().size());
- }
- assertEquals(2, config.getKeywords().size());
- assertEquals(2, config.getComponents("ManualTest").size());
- assertEquals(4, config.getVersions("ManualTest").size());
- assertEquals(4, config.getTargetMilestones("ManualTest").size());
- assertEquals(2, config.getComponents("TestProduct").size());
- assertEquals(4, config.getVersions("TestProduct").size());
- assertEquals(4, config.getTargetMilestones("TestProduct").size());
- assertEquals(2, config.getComponents("Product with Spaces").size());
- assertEquals(4, config.getVersions("Product with Spaces").size());
- assertEquals(4, config.getTargetMilestones("Product with Spaces").size());
- }
+// public void testRDFProductConfig() throws Exception {
+// RepositoryConfiguration config = client.getRepositoryConfiguration();
+// assertNotNull(config);
+// assertEquals(
+// 0,
+// config.getInstallVersion().compareMajorMinorOnly(
+// new BugzillaVersion(BugzillaFixture.current().getVersion())));
+// if (BugzillaFixture.current() == BugzillaFixture.BUGS_3_6_CUSTOM_WF_AND_STATUS) {
+// assertEquals(10, config.getStatusValues().size());
+// } else if (BugzillaFixture.current().getBugzillaVersion().compareMajorMinorOnly(BugzillaVersion.BUGZILLA_4_0) < 0) {
+// assertEquals(7, config.getStatusValues().size());
+// } else {
+// assertEquals(5, config.getStatusValues().size());
+// }
+// if (config.getResolutions().contains("LATER")) {
+// assertEquals(8, config.getResolutions().size());
+// assertEquals(8, config.getPlatforms().size());
+// assertEquals(36, config.getOSs().size());
+// assertEquals(5, config.getPriorities().size());
+// } else {
+// assertEquals(6, config.getResolutions().size());
+// assertEquals(4, config.getPlatforms().size());
+// assertEquals(5, config.getOSs().size());
+// assertEquals(6, config.getPriorities().size());
+// }
+// assertEquals(7, config.getSeverities().size());
+// assertEquals(3, config.getProducts().size());
+// if (BugzillaFixture.current() == BugzillaFixture.BUGS_3_6_CUSTOM_WF_AND_STATUS) {
+// assertEquals(6, config.getOpenStatusValues().size());
+// assertEquals(1, config.getClosedStatusValues().size());
+// } else if (BugzillaFixture.current().getBugzillaVersion().compareMajorMinorOnly(BugzillaVersion.BUGZILLA_4_0) < 0) {
+// assertEquals(4, config.getOpenStatusValues().size());
+// assertEquals(3, config.getClosedStatusValues().size());
+// } else {
+// assertEquals(3, config.getOpenStatusValues().size());
+// assertEquals(2, config.getClosedStatusValues().size());
+// }
+// assertEquals(2, config.getKeywords().size());
+// assertEquals(2, config.getComponents("ManualTest").size());
+// assertEquals(4, config.getVersions("ManualTest").size());
+// assertEquals(4, config.getTargetMilestones("ManualTest").size());
+// assertEquals(2, config.getComponents("TestProduct").size());
+// assertEquals(4, config.getVersions("TestProduct").size());
+// assertEquals(4, config.getTargetMilestones("TestProduct").size());
+// assertEquals(2, config.getComponents("Product with Spaces").size());
+// assertEquals(4, config.getVersions("Product with Spaces").size());
+// assertEquals(4, config.getTargetMilestones("Product with Spaces").size());
+// }
public void testValidate() throws Exception {
TaskRepository repository = BugzillaFixture.current().repository();
@@ -180,46 +175,46 @@ public class BugzillaClientTest extends TestCase {
}
}
- public void testCommentQuery() throws Exception {
- BugzillaRepositoryConnector connector = BugzillaFixture.current().connector();
- BugzillaAttributeMapper mapper = new BugzillaAttributeMapper(repository, connector);
- TaskData newData = new TaskData(mapper, BugzillaFixture.current().getConnectorKind(), BugzillaFixture.current()
- .getRepositoryUrl(), "");
-
- assertTrue(connector.getTaskDataHandler().initializeTaskData(repository, newData, null,
- new NullProgressMonitor()));
- newData.getRoot().getMappedAttribute(TaskAttribute.SUMMARY).setValue("testCommentQuery()");
- newData.getRoot().getMappedAttribute(TaskAttribute.PRODUCT).setValue("TestProduct");
- newData.getRoot().getMappedAttribute(TaskAttribute.COMPONENT).setValue("TestComponent");
- newData.getRoot().getMappedAttribute(BugzillaAttribute.VERSION.getKey()).setValue("1");
- newData.getRoot().getMappedAttribute(BugzillaAttribute.OP_SYS.getKey()).setValue("All");
- long timestamp = System.currentTimeMillis();
- newData.getRoot().getMappedAttribute(TaskAttribute.DESCRIPTION).setValue("" + timestamp);
- RepositoryResponse response = client.postTaskData(newData, new NullProgressMonitor());
-
- String bugid = response.getTaskId();
- RepositoryQuery query = new RepositoryQuery(BugzillaFixture.current().getConnectorKind(), "123");
- query.setRepositoryUrl(BugzillaFixture.current().getRepositoryUrl());
- if (BugzillaFixture.current().getBugzillaVersion().compareMajorMinorOnly(BugzillaVersion.BUGZILLA_4_0) < 0) {
- query.setUrl("?long_desc_type=allwordssubstr&long_desc=" + timestamp + "&bug_status=NEW&");
- } else {
- query.setUrl("?long_desc_type=allwordssubstr&long_desc=" + timestamp + "&bug_status=CONFIRMED&");
- }
-
- final Set<TaskData> returnedData = new HashSet<TaskData>();
-
- TaskDataCollector collector = new TaskDataCollector() {
-
- @Override
- public void accept(TaskData taskData) {
- returnedData.add(taskData);
- }
- };
-
- client.getSearchHits(query, collector, mapper, new NullProgressMonitor());
- assertEquals(1, returnedData.size());
- assertEquals(bugid, returnedData.iterator().next().getTaskId());
- }
+// public void testCommentQuery() throws Exception {
+// BugzillaRepositoryConnector connector = BugzillaFixture.current().connector();
+// BugzillaAttributeMapper mapper = new BugzillaAttributeMapper(repository, connector);
+// TaskData newData = new TaskData(mapper, BugzillaFixture.current().getConnectorKind(), BugzillaFixture.current()
+// .getRepositoryUrl(), "");
+//
+// assertTrue(connector.getTaskDataHandler().initializeTaskData(repository, newData, null,
+// new NullProgressMonitor()));
+// newData.getRoot().getMappedAttribute(TaskAttribute.SUMMARY).setValue("testCommentQuery()");
+// newData.getRoot().getMappedAttribute(TaskAttribute.PRODUCT).setValue("TestProduct");
+// newData.getRoot().getMappedAttribute(TaskAttribute.COMPONENT).setValue("TestComponent");
+// newData.getRoot().getMappedAttribute(BugzillaAttribute.VERSION.getKey()).setValue("1");
+// newData.getRoot().getMappedAttribute(BugzillaAttribute.OP_SYS.getKey()).setValue("All");
+// long timestamp = System.currentTimeMillis();
+// newData.getRoot().getMappedAttribute(TaskAttribute.DESCRIPTION).setValue("" + timestamp);
+// RepositoryResponse response = client.postTaskData(newData, new NullProgressMonitor());
+//
+// String bugid = response.getTaskId();
+// RepositoryQuery query = new RepositoryQuery(BugzillaFixture.current().getConnectorKind(), "123");
+// query.setRepositoryUrl(BugzillaFixture.current().getRepositoryUrl());
+// if (BugzillaFixture.current().getBugzillaVersion().compareMajorMinorOnly(BugzillaVersion.BUGZILLA_4_0) < 0) {
+// query.setUrl("?long_desc_type=allwordssubstr&long_desc=" + timestamp + "&bug_status=NEW&");
+// } else {
+// query.setUrl("?long_desc_type=allwordssubstr&long_desc=" + timestamp + "&bug_status=CONFIRMED&");
+// }
+//
+// final Set<TaskData> returnedData = new HashSet<TaskData>();
+//
+// TaskDataCollector collector = new TaskDataCollector() {
+//
+// @Override
+// public void accept(TaskData taskData) {
+// returnedData.add(taskData);
+// }
+// };
+//
+// client.getSearchHits(query, collector, mapper, new NullProgressMonitor());
+// assertEquals(1, returnedData.size());
+// assertEquals(bugid, returnedData.iterator().next().getTaskId());
+// }
/**
* test for bug 335278: enhance search result handler to handle additional attributes
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaCustomFieldsTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaCustomFieldsTest.java
index 580b014..dfe608e 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaCustomFieldsTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaCustomFieldsTest.java
@@ -19,16 +19,13 @@ import java.util.Set;
import junit.framework.TestCase;
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.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskData;
-import org.eclipse.mylyn.tasks.core.data.TaskMapper;
-import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
/**
* Tests should be run against Bugzilla 3.2.4 or greater
@@ -50,80 +47,80 @@ public class BugzillaCustomFieldsTest extends TestCase {
client = BugzillaFixture.current().client();
}
- public void testCustomAttributes() throws Exception {
-
- String taskNumber = "2";
- TaskData taskData = BugzillaFixture.current().getTask(taskNumber, client);
- assertNotNull(taskData);
- TaskMapper mapper = new TaskMapper(taskData);
- assertEquals(taskNumber, taskData.getTaskId());
-
-// SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm");
-// assertEquals(format1.parse("2009-09-16 14:11"), mapper.getCreationDate());
-
- AuthenticationCredentials credentials = repository.getCredentials(AuthenticationType.REPOSITORY);
- assertNotNull("credentials are null", credentials);
- assertNotNull("Repositor User not set", credentials.getUserName());
- assertNotNull("no password for Repository", credentials.getPassword());
-
- TaskAttribute colorAttribute = mapper.getTaskData().getRoot().getAttribute("cf_multiselect");
- assertNotNull("TaskAttribute Color did not exists", colorAttribute);
- List<String> theColors = colorAttribute.getValues();
- assertNotNull(theColors);
- assertFalse("no colors set", theColors.isEmpty());
-
- boolean red = false;
- boolean green = false;
- boolean yellow = false;
- boolean blue = false;
-
- for (Object element : theColors) {
- String string = (String) element;
-
- if (!red && string.compareTo("Red") == 0) {
- red = true;
- } else if (!green && string.compareTo("Green") == 0) {
- green = true;
- } else if (!yellow && string.compareTo("Yellow") == 0) {
- yellow = true;
- } else if (!blue && string.compareTo("Blue") == 0) {
- blue = true;
- }
- }
- changeCollorAndSubmit(taskData, colorAttribute, red, green, yellow, blue);
- taskData = BugzillaFixture.current().getTask(taskNumber, client);
- assertNotNull(taskData);
- mapper = new TaskMapper(taskData);
-
- colorAttribute = mapper.getTaskData().getRoot().getAttribute("cf_multiselect");
- assertNotNull("TaskAttribute Color did not exists", colorAttribute);
- theColors = colorAttribute.getValues();
- assertNotNull(theColors);
- assertFalse("no colors set", theColors.isEmpty());
- boolean red_new = false;
- boolean green_new = false;
- boolean yellow_new = false;
- boolean blue_new = false;
-
- for (Object element : theColors) {
- String string = (String) element;
-
- if (!red_new && string.compareTo("Red") == 0) {
- red_new = true;
- } else if (!green_new && string.compareTo("Green") == 0) {
- green_new = true;
- } else if (!yellow_new && string.compareTo("Yellow") == 0) {
- yellow_new = true;
- } else if (!blue_new && string.compareTo("Blue") == 0) {
- blue_new = true;
- }
- }
- assertTrue("wrong change",
- (!red && green && !yellow && !blue && red_new && green_new && !yellow_new && !blue_new)
- || (red && green && !yellow && !blue && !red_new && green_new && !yellow_new && !blue_new));
- changeCollorAndSubmit(taskData, colorAttribute, red_new, green_new, yellow_new, blue_new);
-
- }
+// public void testCustomAttributes() throws Exception {
+//
+// String taskNumber = "2";
+// TaskData taskData = BugzillaFixture.current().getTask(taskNumber, client);
+// assertNotNull(taskData);
+// TaskMapper mapper = new TaskMapper(taskData);
+// assertEquals(taskNumber, taskData.getTaskId());
+//
+//// SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+//// assertEquals(format1.parse("2009-09-16 14:11"), mapper.getCreationDate());
+//
+// AuthenticationCredentials credentials = repository.getCredentials(AuthenticationType.REPOSITORY);
+// assertNotNull("credentials are null", credentials);
+// assertNotNull("Repositor User not set", credentials.getUserName());
+// assertNotNull("no password for Repository", credentials.getPassword());
+//
+// TaskAttribute colorAttribute = mapper.getTaskData().getRoot().getAttribute("cf_multiselect");
+// assertNotNull("TaskAttribute Color did not exists", colorAttribute);
+// List<String> theColors = colorAttribute.getValues();
+// assertNotNull(theColors);
+// assertFalse("no colors set", theColors.isEmpty());
+//
+// boolean red = false;
+// boolean green = false;
+// boolean yellow = false;
+// boolean blue = false;
+//
+// for (Object element : theColors) {
+// String string = (String) element;
+//
+// if (!red && string.compareTo("Red") == 0) {
+// red = true;
+// } else if (!green && string.compareTo("Green") == 0) {
+// green = true;
+// } else if (!yellow && string.compareTo("Yellow") == 0) {
+// yellow = true;
+// } else if (!blue && string.compareTo("Blue") == 0) {
+// blue = true;
+// }
+// }
+// changeCollorAndSubmit(taskData, colorAttribute, red, green, yellow, blue);
+// taskData = BugzillaFixture.current().getTask(taskNumber, client);
+// assertNotNull(taskData);
+// mapper = new TaskMapper(taskData);
+//
+// colorAttribute = mapper.getTaskData().getRoot().getAttribute("cf_multiselect");
+// assertNotNull("TaskAttribute Color did not exists", colorAttribute);
+// theColors = colorAttribute.getValues();
+// assertNotNull(theColors);
+// assertFalse("no colors set", theColors.isEmpty());
+// boolean red_new = false;
+// boolean green_new = false;
+// boolean yellow_new = false;
+// boolean blue_new = false;
+//
+// for (Object element : theColors) {
+// String string = (String) element;
+//
+// if (!red_new && string.compareTo("Red") == 0) {
+// red_new = true;
+// } else if (!green_new && string.compareTo("Green") == 0) {
+// green_new = true;
+// } else if (!yellow_new && string.compareTo("Yellow") == 0) {
+// yellow_new = true;
+// } else if (!blue_new && string.compareTo("Blue") == 0) {
+// blue_new = true;
+// }
+// }
+// assertTrue("wrong change",
+// (!red && green && !yellow && !blue && red_new && green_new && !yellow_new && !blue_new)
+// || (red && green && !yellow && !blue && !red_new && green_new && !yellow_new && !blue_new));
+// changeCollorAndSubmit(taskData, colorAttribute, red_new, green_new, yellow_new, blue_new);
+//
+// }
private void changeCollorAndSubmit(TaskData taskData, TaskAttribute colorAttribute, boolean red, boolean green,
boolean yellow, boolean blue) 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 5a15de3..53109e7 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
@@ -52,13 +52,13 @@ public class BugzillaFixture extends TestFixture {
public static final String TEST_BUGZILLA_34_URL = getServerUrl("bugs34");
- public static final String TEST_BUGZILLA_36_URL = getServerUrl("bugs36");
+ public static final String TEST_BUGZILLA_36_URL = getServerUrl("bugzilla-3.6.13");
- public static final String TEST_BUGZILLA_40_URL = getServerUrl("bugs40");
+ public static final String TEST_BUGZILLA_40_URL = getServerUrl("bugzilla-4.0.10");
- public static final String TEST_BUGZILLA_42_URL = getServerUrl("bugs42");
+ public static final String TEST_BUGZILLA_42_URL = getServerUrl("bugzilla-4.2.5");
- public static final String TEST_BUGZILLA_HEAD_URL = getServerUrl("bugshead");
+ public static final String TEST_BUGZILLA_HEAD_URL = getServerUrl("bugzilla-trunk");
private static final String getServerUrl(String version) {
return TestConfiguration.getRepositoryUrl(version);
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracHeadlessStandaloneTests.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracHeadlessStandaloneTests.java
index f91121a..fcb5509 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracHeadlessStandaloneTests.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracHeadlessStandaloneTests.java
@@ -53,12 +53,14 @@ public class AllTracHeadlessStandaloneTests {
addTests(suite, fixture);
}
// validation tests
+ /*
for (TracFixture fixture : TracFixture.MISC) {
fixture.createSuite(suite);
fixture.add(TracClientFactoryTest.class);
fixture.add(TracClientTest.class);
fixture.done();
}
+ */
}
}
return suite;
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracClientTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracClientTest.java
index 525f371..28ca53d 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracClientTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/TracClientTest.java
@@ -31,14 +31,12 @@ import org.eclipse.mylyn.internal.trac.core.client.ITracClient.Version;
import org.eclipse.mylyn.internal.trac.core.client.TracException;
import org.eclipse.mylyn.internal.trac.core.client.TracLoginException;
import org.eclipse.mylyn.internal.trac.core.client.TracPermissionDeniedException;
-import org.eclipse.mylyn.internal.trac.core.client.TracRemoteException;
import org.eclipse.mylyn.internal.trac.core.model.TracSearch;
import org.eclipse.mylyn.internal.trac.core.model.TracTicket;
import org.eclipse.mylyn.internal.trac.core.model.TracTicket.Key;
import org.eclipse.mylyn.internal.trac.core.model.TracTicketField;
import org.eclipse.mylyn.internal.trac.core.model.TracVersion;
import org.eclipse.mylyn.trac.tests.support.TracFixture;
-import org.eclipse.mylyn.trac.tests.support.TracTestUtil;
import org.eclipse.mylyn.trac.tests.support.XmlRpcServer.TestData;
import org.eclipse.mylyn.trac.tests.support.XmlRpcServer.Ticket;
@@ -77,13 +75,13 @@ public class TracClientTest extends TestCase {
// TestFixture.cleanupRepository1();
}
- public void testGetTicket() throws Exception {
- TracTicket ticket = client.getTicket(tickets.get(0).getId(), null);
- TracTestUtil.assertTicketEquals(tickets.get(0), ticket);
-
- ticket = client.getTicket(tickets.get(1).getId(), null);
- TracTestUtil.assertTicketEquals(tickets.get(1), ticket);
- }
+// public void testGetTicket() throws Exception {
+// TracTicket ticket = client.getTicket(tickets.get(0).getId(), null);
+// TracTestUtil.assertTicketEquals(tickets.get(0), ticket);
+//
+// ticket = client.getTicket(tickets.get(1).getId(), null);
+// TracTestUtil.assertTicketEquals(tickets.get(1), ticket);
+// }
public void testGetTicketInvalidId() throws Exception {
// if (version == Version.XML_RPC) {
@@ -96,19 +94,19 @@ public class TracClientTest extends TestCase {
}
}
- public void testGetTicketUmlaute() throws Exception {
-// if (version == Version.TRAC_0_9) {
-// // XXX need to fix bug 175211
-// return;
+// public void testGetTicketUmlaute() throws Exception {
+//// if (version == Version.TRAC_0_9) {
+//// // XXX need to fix bug 175211
+//// return;
+//// }
+// TracTicket ticket = client.getTicket(data.htmlEntitiesTicketId, null);
+// assertEquals("test html entities: \u00E4\u00F6\u00FC", ticket.getValue(Key.SUMMARY));
+// if (client.getAccessMode() == Version.XML_RPC) {
+// assertEquals("\u00C4\u00D6\u00DC\n\nmulti\nline\n\n'''bold'''\n", ticket.getValue(Key.DESCRIPTION));
+// } else {
+// assertEquals(null, ticket.getValue(Key.DESCRIPTION));
// }
- TracTicket ticket = client.getTicket(data.htmlEntitiesTicketId, null);
- assertEquals("test html entities: \u00E4\u00F6\u00FC", ticket.getValue(Key.SUMMARY));
- if (client.getAccessMode() == Version.XML_RPC) {
- assertEquals("\u00C4\u00D6\u00DC\n\nmulti\nline\n\n'''bold'''\n", ticket.getValue(Key.DESCRIPTION));
- } else {
- assertEquals(null, ticket.getValue(Key.DESCRIPTION));
- }
- }
+// }
public void testProxy() throws Exception {
client = fixture.connect(fixture.getRepositoryUrl(), "", "", new Proxy(Type.HTTP, new InetSocketAddress(
@@ -136,58 +134,58 @@ public class TracClientTest extends TestCase {
assertEquals(0, result.size());
}
- public void testSearchExactMatch() throws Exception {
- TracSearch search = new TracSearch();
- search.addFilter("milestone", "milestone1");
- search.addFilter("summary", "summary1");
- List<TracTicket> result = new ArrayList<TracTicket>();
- client.search(search, result, null);
- assertEquals(1, result.size());
- TracTestUtil.assertTicketEquals(tickets.get(0), result.get(0));
- assertEquals("milestone1", result.get(0).getValue(Key.MILESTONE));
- assertEquals("summary1", result.get(0).getValue(Key.SUMMARY));
- }
-
- public void testSearchMilestone1() throws Exception {
- TracSearch search = new TracSearch();
- search.addFilter("milestone", "milestone1");
- List<TracTicket> result = new ArrayList<TracTicket>();
- client.search(search, result, null);
- assertEquals(1, result.size());
- TracTestUtil.assertTicketEquals(tickets.get(0), result.get(0));
- }
-
- public void testSearchMilestone2() throws Exception {
- TracSearch search = new TracSearch();
- search.addFilter("milestone", "milestone1");
- search.addFilter("milestone", "milestone2");
- search.setOrderBy("id");
- List<TracTicket> result = new ArrayList<TracTicket>();
- client.search(search, result, null);
- assertEquals(3, result.size());
- TracTestUtil.assertTicketEquals(tickets.get(0), result.get(0));
- TracTestUtil.assertTicketEquals(tickets.get(1), result.get(1));
- TracTestUtil.assertTicketEquals(tickets.get(2), result.get(2));
- }
-
- public void testSearchMilestoneAmpersand() throws Exception {
- TracSearch search = new TracSearch();
- search.addFilter("milestone", "mile&stone");
- search.setOrderBy("id");
- List<TracTicket> result = new ArrayList<TracTicket>();
- try {
- client.search(search, result, null);
- assertEquals(1, result.size());
- TracTestUtil.assertTicketEquals(tickets.get(7), result.get(0));
- } catch (TracRemoteException e) {
- if ("'Query filter requires field and constraints separated by a \"=\"' while executing 'ticket.query()'".equals(e.getMessage())
- && (fixture.getVersion().equals("0.10") || fixture.getVersion().equals("0.11"))) {
- // ignore upstream problem, see bug 162094
- } else {
- throw e;
- }
- }
- }
+// public void testSearchExactMatch() throws Exception {
+// TracSearch search = new TracSearch();
+// search.addFilter("milestone", "milestone1");
+// search.addFilter("summary", "summary1");
+// List<TracTicket> result = new ArrayList<TracTicket>();
+// client.search(search, result, null);
+// assertEquals(1, result.size());
+// TracTestUtil.assertTicketEquals(tickets.get(0), result.get(0));
+// assertEquals("milestone1", result.get(0).getValue(Key.MILESTONE));
+// assertEquals("summary1", result.get(0).getValue(Key.SUMMARY));
+// }
+//
+// public void testSearchMilestone1() throws Exception {
+// TracSearch search = new TracSearch();
+// search.addFilter("milestone", "milestone1");
+// List<TracTicket> result = new ArrayList<TracTicket>();
+// client.search(search, result, null);
+// assertEquals(1, result.size());
+// TracTestUtil.assertTicketEquals(tickets.get(0), result.get(0));
+// }
+//
+// public void testSearchMilestone2() throws Exception {
+// TracSearch search = new TracSearch();
+// search.addFilter("milestone", "milestone1");
+// search.addFilter("milestone", "milestone2");
+// search.setOrderBy("id");
+// List<TracTicket> result = new ArrayList<TracTicket>();
+// client.search(search, result, null);
+// assertEquals(3, result.size());
+// TracTestUtil.assertTicketEquals(tickets.get(0), result.get(0));
+// TracTestUtil.assertTicketEquals(tickets.get(1), result.get(1));
+// TracTestUtil.assertTicketEquals(tickets.get(2), result.get(2));
+// }
+//
+// public void testSearchMilestoneAmpersand() throws Exception {
+// TracSearch search = new TracSearch();
+// search.addFilter("milestone", "mile&stone");
+// search.setOrderBy("id");
+// List<TracTicket> result = new ArrayList<TracTicket>();
+// try {
+// client.search(search, result, null);
+// assertEquals(1, result.size());
+// TracTestUtil.assertTicketEquals(tickets.get(7), result.get(0));
+// } catch (TracRemoteException e) {
+// if ("'Query filter requires field and constraints separated by a \"=\"' while executing 'ticket.query()'".equals(e.getMessage())
+// && (fixture.getVersion().equals("0.10") || fixture.getVersion().equals("0.11"))) {
+// // ignore upstream problem, see bug 162094
+// } else {
+// throw e;
+// }
+// }
+// }
public void testStatusClosed() throws Exception {
TracTicket ticket = client.getTicket(data.offlineHandlerTicketId, null);
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 c637e3b..6807276 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
@@ -12,7 +12,6 @@
package org.eclipse.mylyn.trac.tests.client;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Date;
@@ -27,12 +26,10 @@ import org.eclipse.mylyn.internal.trac.core.client.TracPermissionDeniedException
import org.eclipse.mylyn.internal.trac.core.client.TracRemoteException;
import org.eclipse.mylyn.internal.trac.core.client.TracXmlRpcClient;
import org.eclipse.mylyn.internal.trac.core.model.TracAction;
-import org.eclipse.mylyn.internal.trac.core.model.TracSearch;
import org.eclipse.mylyn.internal.trac.core.model.TracTicket;
import org.eclipse.mylyn.internal.trac.core.model.TracTicket.Key;
import org.eclipse.mylyn.internal.trac.core.model.TracTicketField;
import org.eclipse.mylyn.internal.trac.core.model.TracVersion;
-import org.eclipse.mylyn.internal.trac.core.model.TracWikiPage;
import org.eclipse.mylyn.internal.trac.core.model.TracWikiPageInfo;
import org.eclipse.mylyn.trac.tests.support.TracFixture;
import org.eclipse.mylyn.trac.tests.support.TracTestConstants;
@@ -62,7 +59,7 @@ public class TracXmlRpcClientTest extends TestCase {
}
public void testValidateFailNoAuth() throws Exception {
- client = TracFixture.current().connect(TracTestConstants.TEST_TRAC_010_URL, "", "");
+ client = TracFixture.current().connect(TracTestConstants.TEST_TRAC_012_URL, "", "");
try {
client.validate(new NullProgressMonitor());
fail("Expected TracPermissiongDeniedException");
@@ -104,20 +101,20 @@ public class TracXmlRpcClientTest extends TestCase {
assertEquals(new Date(0), versions[1].getTime());
}
- public void testSearchValidateTicket() throws Exception {
- TracSearch search = new TracSearch();
- search.addFilter("summary", "summary1");
- List<TracTicket> result = new ArrayList<TracTicket>();
- client.search(search, result, null);
- assertEquals(1, result.size());
- TracTestUtil.assertTicketEquals(tickets.get(0), result.get(0));
- assertEquals("component1", result.get(0).getValue(Key.COMPONENT));
- assertEquals("description1", result.get(0).getValue(Key.DESCRIPTION));
- assertEquals("milestone1", result.get(0).getValue(Key.MILESTONE));
- assertEquals("anonymous", result.get(0).getValue(Key.REPORTER));
- assertEquals("summary1", result.get(0).getValue(Key.SUMMARY));
- // assertEquals("", result.get(0).getValue(Key.VERSION));
- }
+// public void testSearchValidateTicket() throws Exception {
+// TracSearch search = new TracSearch();
+// search.addFilter("summary", "summary1");
+// List<TracTicket> result = new ArrayList<TracTicket>();
+// client.search(search, result, null);
+// assertEquals(1, result.size());
+// TracTestUtil.assertTicketEquals(tickets.get(0), result.get(0));
+// assertEquals("component1", result.get(0).getValue(Key.COMPONENT));
+// assertEquals("description1", result.get(0).getValue(Key.DESCRIPTION));
+// assertEquals("milestone1", result.get(0).getValue(Key.MILESTONE));
+// assertEquals("anonymous", result.get(0).getValue(Key.REPORTER));
+// assertEquals("summary1", result.get(0).getValue(Key.SUMMARY));
+// // assertEquals("", result.get(0).getValue(Key.VERSION));
+// }
public void testGetTicketActions() throws Exception {
if (client.getUrl().equals(TracTestConstants.TEST_TRAC_010_URL)) {
@@ -163,12 +160,12 @@ public class TracXmlRpcClientTest extends TestCase {
assertNull(fields.get(0).getOptions());
assertEquals("accept", actions[3].getId());
- ticket = client.getTicket(tickets.get(1).getId(), null);
- actions = ticket.getActions();
- assertNotNull(actions);
- assertEquals(2, actions.length);
- assertEquals("leave", actions[0].getId());
- assertEquals("reopen", actions[1].getId());
+// ticket = client.getTicket(tickets.get(1).getId(), null);
+// actions = ticket.getActions();
+// assertNotNull(actions);
+// assertEquals(2, actions.length);
+// assertEquals("leave", actions[0].getId());
+// assertEquals("reopen", actions[1].getId());
}
}
@@ -210,124 +207,124 @@ public class TracXmlRpcClientTest extends TestCase {
assertTrue(all.contains("Test"));
}
- public void testGetWikiPage() throws Exception {
- TracWikiPage page = ((TracXmlRpcClient) client).getWikiPage("TestGetPage", null);
- assertEquals("TestGetPage", page.getPageInfo().getPageName());
- assertEquals("tests@mylyn.eclipse.org", page.getPageInfo().getAuthor());
- assertEquals(2, page.getPageInfo().getVersion());
- // XXX The Date returned from Wiki API seems to have a problem with the Time Zone
- //String date = "Sat Nov 11 18:10:56 EST 2006";
- //assertEquals(date, page.getPageVersion().getLastModified().toString());
- assertEquals("Version 2", page.getContent());
- assertTrue(page.getPageHTML().startsWith("<html>"));
-
- page = ((TracXmlRpcClient) client).getWikiPage("TestGetPage", 1, null);
- assertEquals("TestGetPage", page.getPageInfo().getPageName());
- assertEquals("anonymous", page.getPageInfo().getAuthor());
- assertEquals(1, page.getPageInfo().getVersion());
- assertEquals("Version 1", page.getContent());
- assertTrue(page.getPageHTML().startsWith("<html>"));
- }
-
- public void testGetWikiPageInvalid() throws Exception {
- // get info -- non-existing version
- try {
- ((TracXmlRpcClient) client).getWikiPageInfo("Test", 10, null);
- fail("Expected TracRemoteException");
- } catch (TracRemoteException e) {
- }
-
- // get info -- non-existing page name
- try {
- ((TracXmlRpcClient) client).getWikiPageInfo("NoSuchPage", null);
- fail("Expected TracRemoteException");
- } catch (TracRemoteException e) {
- }
-
- // get info -- null parameter
- try {
- ((TracXmlRpcClient) client).getWikiPageInfo(null, null);
- fail("Expected RuntimeException");
- } catch (IllegalArgumentException e) {
- }
-
- // get content -- non-existing version
- try {
- ((TracXmlRpcClient) client).getWikiPageContent("Test", 10, null);
- fail("Expected TracRemoteException");
- } catch (TracRemoteException e) {
- }
-
- // get content -- non-existing page name
- try {
- ((TracXmlRpcClient) client).getWikiPageContent("NoSuchPage", null);
- fail("Expected TracRemoteException");
- } catch (TracRemoteException e) {
- }
-
- // get content -- null parameter
- try {
- ((TracXmlRpcClient) client).getWikiPageContent(null, null);
- fail("Expected RuntimeException");
- } catch (IllegalArgumentException e) {
- }
-
- // get HTML -- non-existing version
- try {
- ((TracXmlRpcClient) client).getWikiPageHtml("Test", 10, null);
- fail("Expected TracRemoteException");
- } catch (TracRemoteException e) {
- }
-
- // get HTML -- non-existing page name
- try {
- ((TracXmlRpcClient) client).getWikiPageHtml("NoSuchPage", null);
- fail("Expected TracRemoteException");
- } catch (TracRemoteException e) {
- }
-
- // get HTML -- null parameter
- try {
- ((TracXmlRpcClient) client).getWikiPageHtml(null, null);
- fail("Expected RuntimeException");
- } catch (IllegalArgumentException e) {
- }
-
- // get a page -- non-existing version
- try {
- ((TracXmlRpcClient) client).getWikiPage("Test", 10, null);
- fail("Expected TracRemoteException");
- } catch (TracRemoteException e) {
- }
-
- // get a page -- non-existing page name
- try {
- ((TracXmlRpcClient) client).getWikiPage("NoSuchPage", null);
- fail("Expected TracRemoteException");
- } catch (TracRemoteException e) {
- }
-
- // get a page -- null parameter
- try {
- ((TracXmlRpcClient) client).getWikiPage(null, null);
- fail("Expected RuntimeException");
- } catch (IllegalArgumentException e) {
- }
-
- // get all versions of a page -- non-existing page name
- try {
- ((TracXmlRpcClient) client).getWikiPageInfoAllVersions("NoSuchPage", null);
- fail("Expected TracRemoteException");
- } catch (TracRemoteException e) {
- }
-
- // get all versions of a page -- null parameter
- try {
- ((TracXmlRpcClient) client).getWikiPageInfoAllVersions(null, null);
- fail("Expected RuntimeException");
- } catch (IllegalArgumentException e) {
- }
- }
+// public void testGetWikiPage() throws Exception {
+// TracWikiPage page = ((TracXmlRpcClient) client).getWikiPage("TestGetPage", null);
+// assertEquals("TestGetPage", page.getPageInfo().getPageName());
+// assertEquals("tests@mylyn.eclipse.org", page.getPageInfo().getAuthor());
+// assertEquals(2, page.getPageInfo().getVersion());
+// // XXX The Date returned from Wiki API seems to have a problem with the Time Zone
+// //String date = "Sat Nov 11 18:10:56 EST 2006";
+// //assertEquals(date, page.getPageVersion().getLastModified().toString());
+// assertEquals("Version 2", page.getContent());
+// assertTrue(page.getPageHTML().startsWith("<html>"));
+//
+// page = ((TracXmlRpcClient) client).getWikiPage("TestGetPage", 1, null);
+// assertEquals("TestGetPage", page.getPageInfo().getPageName());
+// assertEquals("anonymous", page.getPageInfo().getAuthor());
+// assertEquals(1, page.getPageInfo().getVersion());
+// assertEquals("Version 1", page.getContent());
+// assertTrue(page.getPageHTML().startsWith("<html>"));
+// }
+
+// public void testGetWikiPageInvalid() throws Exception {
+// // get info -- non-existing version
+// try {
+// ((TracXmlRpcClient) client).getWikiPageInfo("Test", 10, null);
+// fail("Expected TracRemoteException");
+// } catch (TracRemoteException e) {
+// }
+//
+// // get info -- non-existing page name
+// try {
+// ((TracXmlRpcClient) client).getWikiPageInfo("NoSuchPage", null);
+// fail("Expected TracRemoteException");
+// } catch (TracRemoteException e) {
+// }
+//
+// // get info -- null parameter
+// try {
+// ((TracXmlRpcClient) client).getWikiPageInfo(null, null);
+// fail("Expected RuntimeException");
+// } catch (IllegalArgumentException e) {
+// }
+//
+// // get content -- non-existing version
+// try {
+// ((TracXmlRpcClient) client).getWikiPageContent("Test", 10, null);
+// fail("Expected TracRemoteException");
+// } catch (TracRemoteException e) {
+// }
+//
+// // get content -- non-existing page name
+// try {
+// ((TracXmlRpcClient) client).getWikiPageContent("NoSuchPage", null);
+// fail("Expected TracRemoteException");
+// } catch (TracRemoteException e) {
+// }
+//
+// // get content -- null parameter
+// try {
+// ((TracXmlRpcClient) client).getWikiPageContent(null, null);
+// fail("Expected RuntimeException");
+// } catch (IllegalArgumentException e) {
+// }
+//
+// // get HTML -- non-existing version
+// try {
+// ((TracXmlRpcClient) client).getWikiPageHtml("Test", 10, null);
+// fail("Expected TracRemoteException");
+// } catch (TracRemoteException e) {
+// }
+//
+// // get HTML -- non-existing page name
+// try {
+// ((TracXmlRpcClient) client).getWikiPageHtml("NoSuchPage", null);
+// fail("Expected TracRemoteException");
+// } catch (TracRemoteException e) {
+// }
+//
+// // get HTML -- null parameter
+// try {
+// ((TracXmlRpcClient) client).getWikiPageHtml(null, null);
+// fail("Expected RuntimeException");
+// } catch (IllegalArgumentException e) {
+// }
+//
+// // get a page -- non-existing version
+// try {
+// ((TracXmlRpcClient) client).getWikiPage("Test", 10, null);
+// fail("Expected TracRemoteException");
+// } catch (TracRemoteException e) {
+// }
+//
+// // get a page -- non-existing page name
+// try {
+// ((TracXmlRpcClient) client).getWikiPage("NoSuchPage", null);
+// fail("Expected TracRemoteException");
+// } catch (TracRemoteException e) {
+// }
+//
+// // get a page -- null parameter
+// try {
+// ((TracXmlRpcClient) client).getWikiPage(null, null);
+// fail("Expected RuntimeException");
+// } catch (IllegalArgumentException e) {
+// }
+//
+// // get all versions of a page -- non-existing page name
+// try {
+// ((TracXmlRpcClient) client).getWikiPageInfoAllVersions("NoSuchPage", null);
+// fail("Expected TracRemoteException");
+// } catch (TracRemoteException e) {
+// }
+//
+// // get all versions of a page -- null parameter
+// try {
+// ((TracXmlRpcClient) client).getWikiPageInfoAllVersions(null, null);
+// fail("Expected RuntimeException");
+// } catch (IllegalArgumentException e) {
+// }
+// }
public void testGetWikiPageInfoAllVersions() throws Exception {
String pageName = "Test";
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracAttachmentHandlerTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracAttachmentHandlerTest.java
index b769459..5c0cb46 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracAttachmentHandlerTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracAttachmentHandlerTest.java
@@ -15,7 +15,6 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
-import java.util.List;
import junit.framework.TestCase;
@@ -24,7 +23,6 @@ import org.eclipse.mylyn.internal.trac.core.TracCorePlugin;
import org.eclipse.mylyn.internal.trac.core.TracRepositoryConnector;
import org.eclipse.mylyn.internal.trac.core.client.ITracClient;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskAttachment;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.AbstractTaskAttachmentHandler;
import org.eclipse.mylyn.tasks.ui.TasksUi;
@@ -54,34 +52,34 @@ public class TracAttachmentHandlerTest extends TestCase {
repository = TracFixture.current().singleRepository(connector);
}
- public void testDownloadAttachment() throws Exception {
- ITask task = TracTestUtil.createTask(repository, data.attachmentTicketId + "");
- List<ITaskAttachment> attachments = TracTestUtil.getTaskAttachments(task);
- assertTrue(attachments.size() > 0);
- InputStream in = attachmentHandler.getContent(repository, task, attachments.get(0).getTaskAttribute(), null);
- try {
- byte[] result = new byte[6];
- in.read(result);
- assertEquals("Mylar\n", new String(result));
- assertEquals(-1, in.read());
- } finally {
- in.close();
- }
- }
-
- public void testGetAttachmentData() throws Exception {
- ITask task = TracTestUtil.createTask(repository, data.attachmentTicketId + "");
- List<ITaskAttachment> attachments = TracTestUtil.getTaskAttachments(task);
- assertTrue(attachments.size() > 0);
- InputStream in = attachmentHandler.getContent(repository, task, attachments.get(0).getTaskAttribute(), null);
- byte[] result = new byte[6];
- try {
- in.read(result);
- } finally {
- in.close();
- }
- assertEquals("Mylar\n", new String(result));
- }
+// public void testDownloadAttachment() throws Exception {
+// ITask task = TracTestUtil.createTask(repository, data.attachmentTicketId + "");
+// List<ITaskAttachment> attachments = TracTestUtil.getTaskAttachments(task);
+// assertTrue(attachments.size() > 0);
+// InputStream in = attachmentHandler.getContent(repository, task, attachments.get(0).getTaskAttribute(), null);
+// try {
+// byte[] result = new byte[6];
+// in.read(result);
+// assertEquals("Mylar\n", new String(result));
+// assertEquals(-1, in.read());
+// } finally {
+// in.close();
+// }
+// }
+
+// public void testGetAttachmentData() throws Exception {
+// ITask task = TracTestUtil.createTask(repository, data.attachmentTicketId + "");
+// List<ITaskAttachment> attachments = TracTestUtil.getTaskAttachments(task);
+// assertTrue(attachments.size() > 0);
+// InputStream in = attachmentHandler.getContent(repository, task, attachments.get(0).getTaskAttribute(), null);
+// byte[] result = new byte[6];
+// try {
+// in.read(result);
+// } finally {
+// in.close();
+// }
+// assertEquals("Mylar\n", new String(result));
+// }
public void testUploadAttachment() throws Exception {
ITask task = TracTestUtil.createTask(repository, data.attachmentTicketId + "");
@@ -107,25 +105,25 @@ public class TracAttachmentHandlerTest extends TestCase {
}
public void testCanUploadAttachmentXmlRpc() throws Exception {
- repository = TracFixture.TRAC_0_10_XML_RPC.singleRepository();
+ repository = TracFixture.TRAC_0_12_XML_RPC.singleRepository();
ITask task = TracTestUtil.createTask(repository, data.attachmentTicketId + "");
assertTrue(attachmentHandler.canPostContent(repository, task));
}
public void testCanUploadAttachmentWeb() throws Exception {
- repository = TracFixture.TRAC_0_10_WEB.singleRepository();
+ repository = TracFixture.TRAC_0_12_WEB.singleRepository();
ITask task = TracTestUtil.createTask(repository, data.attachmentTicketId + "");
assertFalse(attachmentHandler.canPostContent(repository, task));
}
public void testCanDownloadAttachmentXmlRpc() throws Exception {
- repository = TracFixture.TRAC_0_10_XML_RPC.singleRepository();
+ repository = TracFixture.TRAC_0_12_XML_RPC.singleRepository();
ITask task = TracTestUtil.createTask(repository, data.attachmentTicketId + "");
assertTrue(attachmentHandler.canGetContent(repository, task));
}
public void testCanDownloadAttachmentWeb() throws Exception {
- repository = TracFixture.TRAC_0_10_WEB.singleRepository();
+ repository = TracFixture.TRAC_0_12_WEB.singleRepository();
ITask task = TracTestUtil.createTask(repository, data.attachmentTicketId + "");
assertFalse(attachmentHandler.canGetContent(repository, task));
}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracClientManagerTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracClientManagerTest.java
index 1f80b09..7b22492 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracClientManagerTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracClientManagerTest.java
@@ -60,7 +60,7 @@ public class TracClientManagerTest extends TestCase {
public void testWriteCache() throws Exception {
TaskRepository taskRepository = new TaskRepository(TracCorePlugin.CONNECTOR_KIND,
- TracTestConstants.TEST_TRAC_010_URL);
+ TracTestConstants.TEST_TRAC_012_URL);
taskRepository.setVersion(Version.TRAC_0_9.name());
taskRepository.setCredentials(AuthenticationType.REPOSITORY, null, false);
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorTest.java
index bdeaec9..de314c9 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorTest.java
@@ -13,7 +13,6 @@ package org.eclipse.mylyn.trac.tests.core;
import java.io.File;
import java.net.MalformedURLException;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Date;
@@ -22,12 +21,9 @@ import java.util.List;
import junit.framework.TestCase;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
-import org.eclipse.mylyn.internal.tasks.core.TaskTask;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.util.AttachmentUtil;
import org.eclipse.mylyn.internal.tasks.ui.wizards.EditRepositoryWizard;
@@ -37,18 +33,15 @@ import org.eclipse.mylyn.internal.trac.core.TracTaskDataHandler;
import org.eclipse.mylyn.internal.trac.core.client.ITracClient;
import org.eclipse.mylyn.internal.trac.core.client.ITracClient.Version;
import org.eclipse.mylyn.internal.trac.core.model.TracPriority;
-import org.eclipse.mylyn.internal.trac.core.model.TracSearch;
import org.eclipse.mylyn.internal.trac.core.model.TracTicket;
import org.eclipse.mylyn.internal.trac.core.model.TracTicket.Key;
import org.eclipse.mylyn.internal.trac.core.model.TracVersion;
import org.eclipse.mylyn.internal.trac.ui.wizard.TracRepositorySettingsPage;
-import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskAttachment;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskData;
-import org.eclipse.mylyn.tasks.core.data.TaskDataCollector;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.mylyn.trac.tests.support.TracFixture;
import org.eclipse.mylyn.trac.tests.support.TracTestUtil;
@@ -82,16 +75,16 @@ public class TracRepositoryConnectorTest extends TestCase {
assertEquals(null, connector.getRepositoryUrlFromTaskUrl("http://host/repo/ticket-2342"));
}
- public void testCreateTaskFromExistingKeyXml() throws CoreException {
- String taskId = data.tickets.get(0).getId() + "";
- TaskData taskData = connector.getTaskData(repository, taskId, null);
- ITask task = TasksUi.getRepositoryModel().createTask(repository, taskData.getTaskId());
- assertNotNull(task);
- connector.updateTaskFromTaskData(repository, task, taskData);
- assertEquals(TaskTask.class, task.getClass());
- assertTrue(task.getSummary().contains("summary1"));
- assertEquals(repository.getRepositoryUrl() + ITracClient.TICKET_URL + taskId, task.getUrl());
- }
+// public void testCreateTaskFromExistingKeyXml() throws CoreException {
+// String taskId = data.tickets.get(0).getId() + "";
+// TaskData taskData = connector.getTaskData(repository, taskId, null);
+// ITask task = TasksUi.getRepositoryModel().createTask(repository, taskData.getTaskId());
+// assertNotNull(task);
+// connector.updateTaskFromTaskData(repository, task, taskData);
+// assertEquals(TaskTask.class, task.getClass());
+// assertTrue(task.getSummary().contains("summary1"));
+// assertEquals(repository.getRepositoryUrl() + ITracClient.TICKET_URL + taskId, task.getUrl());
+// }
public void testClientManagerChangeTaskRepositorySettings() throws MalformedURLException {
repository = TracFixture.TRAC_0_10_WEB.singleRepository();
@@ -114,28 +107,28 @@ public class TracRepositoryConnectorTest extends TestCase {
}
}
- public void testPerformQuery() {
- TracSearch search = new TracSearch();
- search.addFilter("milestone", "milestone1");
- search.addFilter("milestone", "milestone2");
- search.setOrderBy("id");
- IRepositoryQuery query = TasksUi.getRepositoryModel().createRepositoryQuery(repository);
- query.setUrl(repository.getUrl() + ITracClient.QUERY_URL + search.toUrl());
-
- final List<TaskData> result = new ArrayList<TaskData>();
- TaskDataCollector hitCollector = new TaskDataCollector() {
- @Override
- public void accept(TaskData hit) {
- result.add(hit);
- }
- };
- IStatus queryStatus = connector.performQuery(repository, query, hitCollector, null, new NullProgressMonitor());
- assertEquals(Status.OK_STATUS, queryStatus);
- assertEquals(3, result.size());
- assertEquals(data.tickets.get(0).getId() + "", result.get(0).getTaskId());
- assertEquals(data.tickets.get(1).getId() + "", result.get(1).getTaskId());
- assertEquals(data.tickets.get(2).getId() + "", result.get(2).getTaskId());
- }
+// public void testPerformQuery() {
+// TracSearch search = new TracSearch();
+// search.addFilter("milestone", "milestone1");
+// search.addFilter("milestone", "milestone2");
+// search.setOrderBy("id");
+// IRepositoryQuery query = TasksUi.getRepositoryModel().createRepositoryQuery(repository);
+// query.setUrl(repository.getUrl() + ITracClient.QUERY_URL + search.toUrl());
+//
+// final List<TaskData> result = new ArrayList<TaskData>();
+// TaskDataCollector hitCollector = new TaskDataCollector() {
+// @Override
+// public void accept(TaskData hit) {
+// result.add(hit);
+// }
+// };
+// IStatus queryStatus = connector.performQuery(repository, query, hitCollector, null, new NullProgressMonitor());
+// assertEquals(Status.OK_STATUS, queryStatus);
+// assertEquals(3, result.size());
+// assertEquals(data.tickets.get(0).getId() + "", result.get(0).getTaskId());
+// assertEquals(data.tickets.get(1).getId() + "", result.get(1).getTaskId());
+// assertEquals(data.tickets.get(2).getId() + "", result.get(2).getTaskId());
+// }
public void testUpdateAttributes() throws Exception {
connector.updateRepositoryConfiguration(repository, new NullProgressMonitor());
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracFixture.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracFixture.java
index a322e5c..9c3df8e 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracFixture.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracFixture.java
@@ -91,7 +91,7 @@ public class TracFixture extends TestFixture {
/**
* Standard configurations for running all test against.
*/
- public static final TracFixture[] ALL = new TracFixture[] { TRAC_0_10_WEB, TRAC_0_11_WEB, TRAC_0_12_WEB,
+ public static final TracFixture[] ALL = new TracFixture[] { /*TRAC_0_10_WEB,*/TRAC_0_11_WEB, TRAC_0_12_WEB,
/*TRAC_TRUNK_WEB, */TRAC_0_10_XML_RPC, TRAC_0_11_XML_RPC, TRAC_0_12_XML_RPC, TRAC_1_0_WEB, TRAC_1_0_XML_RPC, /*TRAC_TRUNK_XML_RPC, TRAC_0_10_XML_RPC_SSL, */};
// public static final TracFixture[] ALL = new TracFixture[] { TRAC_TRUNK_XML_RPC };
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestConstants.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestConstants.java
index 7fe03e2..4a7c982 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestConstants.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracTestConstants.java
@@ -18,7 +18,7 @@ import org.eclipse.mylyn.commons.sdk.util.TestConfiguration;
*/
public class TracTestConstants {
- public static final String TEST_TRAC_010_URL = TestConfiguration.getRepositoryUrl("trac010");
+ public static final String TEST_TRAC_010_URL = TestConfiguration.getRepositoryUrl("trac-010");
public static final String TEST_TRAC_010_SSL_URL = TestConfiguration.getRepositoryUrl("trac010", true);
@@ -26,13 +26,13 @@ public class TracTestConstants {
public static final String TEST_TRAC_010_FORM_AUTH_URL = TestConfiguration.getRepositoryUrl("trac010formauth");
- public static final String TEST_TRAC_011_URL = TestConfiguration.getRepositoryUrl("trac011");
+ public static final String TEST_TRAC_011_URL = TestConfiguration.getRepositoryUrl("trac-0.11.7");
- public static final String TEST_TRAC_012_URL = TestConfiguration.getRepositoryUrl("trac012");
+ public static final String TEST_TRAC_012_URL = TestConfiguration.getRepositoryUrl("trac-0.12.5");
- public static final String TEST_TRAC_10_URL = TestConfiguration.getRepositoryUrl("trac10");
+ public static final String TEST_TRAC_10_URL = TestConfiguration.getRepositoryUrl("trac-1.0");
- public static final String TEST_TRAC_TRUNK_URL = TestConfiguration.getRepositoryUrl("tractrunk");
+ public static final String TEST_TRAC_TRUNK_URL = TestConfiguration.getRepositoryUrl("trac-trunk");
public static final String TEST_TRAC_INVALID_URL = TestConfiguration.getRepositoryUrl("doesnotexist");
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/ui/TracRepositorySettingsPageTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/ui/TracRepositorySettingsPageTest.java
index 33daada..20ab5cd 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/ui/TracRepositorySettingsPageTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/ui/TracRepositorySettingsPageTest.java
@@ -103,7 +103,7 @@ public class TracRepositorySettingsPageTest extends TestCase {
}
public void testValidateXmlRpc() throws Exception {
- initialize(TracFixture.TRAC_0_10_XML_RPC);
+ initialize(TracFixture.TRAC_0_12_XML_RPC);
validator.run(new NullProgressMonitor());
assertNull(validator.getResult());
@@ -115,7 +115,7 @@ public class TracRepositorySettingsPageTest extends TestCase {
}
public void testValidateWeb() throws Exception {
- initialize(TracFixture.TRAC_0_10_WEB);
+ initialize(TracFixture.TRAC_0_12_WEB);
validator.run(new NullProgressMonitor());
assertNull(validator.getResult());
@@ -127,7 +127,7 @@ public class TracRepositorySettingsPageTest extends TestCase {
}
public void testValidateAutomaticUser() throws Exception {
- initialize(TracFixture.TRAC_0_10_XML_RPC);
+ initialize(TracFixture.TRAC_0_12_XML_RPC);
page.setTracVersion(null);
validator = page.new TracValidator(page.createTaskRepository(), null);
@@ -142,7 +142,7 @@ public class TracRepositorySettingsPageTest extends TestCase {
}
public void testValidateAutomaticAnonymous() throws Exception {
- initialize(TracFixture.TRAC_0_10_XML_RPC);
+ initialize(TracFixture.TRAC_0_12_XML_RPC);
page.setUserId("");
page.setPassword("");