Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2016-05-27 19:07:14 +0000
committerGerrit Code Review @ Eclipse.org2016-06-15 18:41:44 +0000
commit7b6c8404b6eaa24858337cf04ba4d05aa0f4cb3b (patch)
tree4def5e386f47c812562dc167eda9e8a8741afbdd /org.eclipse.mylyn.bugzilla.tests/src
parent58364eba5fc175eb77d98c96f30976bd60b22b39 (diff)
downloadorg.eclipse.mylyn.tasks-7b6c8404b6eaa24858337cf04ba4d05aa0f4cb3b.tar.gz
org.eclipse.mylyn.tasks-7b6c8404b6eaa24858337cf04ba4d05aa0f4cb3b.tar.xz
org.eclipse.mylyn.tasks-7b6c8404b6eaa24858337cf04ba4d05aa0f4cb3b.zip
494233: Release of Bugzilla 5.0.3, 4.4.12, and 5.1.1
Change-Id: Ib475e0653404b403db54cb27e391945ca7618caf Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=494233
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.tests/src')
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXmlRpcClientTest.java30
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java16
2 files changed, 28 insertions, 18 deletions
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 539a3e649..ce92050d4 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
@@ -302,10 +302,8 @@ public class BugzillaXmlRpcClientTest extends AbstractBugzillaTest {
} else {
IProgressMonitor monitor = new NullProgressMonitor();
String version = bugzillaClient.getVersion(monitor);
- assertEquals(
- 0,
- new BugzillaVersion(BugzillaFixture.current().getVersion()).compareMajorMinorOnly(new BugzillaVersion(
- version)));
+ assertEquals(0, new BugzillaVersion(BugzillaFixture.current().getVersion())
+ .compareMajorMinorOnly(new BugzillaVersion(version)));
}
}
@@ -315,6 +313,7 @@ public class BugzillaXmlRpcClientTest extends AbstractBugzillaTest {
return;
} else {
IProgressMonitor monitor = new NullProgressMonitor();
+ BugzillaVersion version = BugzillaFixture.current().getBugzillaVersion();
bugzillaClient.logout(monitor);
int uID = bugzillaClient.login(monitor);
assertEquals(2, uID);
@@ -322,13 +321,17 @@ public class BugzillaXmlRpcClientTest extends AbstractBugzillaTest {
assertNotNull(userList0);
assertEquals(2, userList0.length);
assertEquals(((Integer) 1), ((HashMap<String, Integer>) userList0[0]).get("id"));
- assertEquals("admin@mylyn.eclipse.org", ((HashMap<String, String>) userList0[0]).get("email"));
+ if (BugzillaFixture.current().isBugzilla51OrGreater()) {
+ assertEquals("admin@mylyn.eclipse.org", ((HashMap<String, String>) userList0[0]).get("email"));
+ }
assertEquals("admin@mylyn.eclipse.org", ((HashMap<String, String>) userList0[0]).get("name"));
assertEquals("Mylyn Admin", ((HashMap<String, String>) userList0[0]).get("real_name"));
assertEquals(((Boolean) true), ((HashMap<String, Boolean>) userList0[0]).get("can_login"));
assertEquals(((Integer) 2), ((HashMap<String, Integer>) userList0[1]).get("id"));
- assertEquals("tests@mylyn.eclipse.org", ((HashMap<String, String>) userList0[1]).get("email"));
+ if (BugzillaFixture.current().isBugzilla51OrGreater()) {
+ assertEquals("tests@mylyn.eclipse.org", ((HashMap<String, String>) userList0[1]).get("email"));
+ }
assertEquals("tests@mylyn.eclipse.org", ((HashMap<String, String>) userList0[1]).get("name"));
assertEquals("Mylyn Test", ((HashMap<String, String>) userList0[1]).get("real_name"));
assertEquals(((Boolean) true), ((HashMap<String, Boolean>) userList0[1]).get("can_login"));
@@ -338,7 +341,9 @@ public class BugzillaXmlRpcClientTest extends AbstractBugzillaTest {
assertNotNull(userList1);
assertEquals(1, userList1.length);
assertEquals(((Integer) 2), ((HashMap<String, Integer>) userList1[0]).get("id"));
- assertEquals("tests@mylyn.eclipse.org", ((HashMap<String, String>) userList1[0]).get("email"));
+ if (version.compareTo(BugzillaVersion.BUGZILLA_5_1) < 0) {
+ assertEquals("tests@mylyn.eclipse.org", ((HashMap<String, String>) userList1[0]).get("email"));
+ }
assertEquals("tests@mylyn.eclipse.org", ((HashMap<String, String>) userList1[0]).get("name"));
assertEquals("Mylyn Test", ((HashMap<String, String>) userList1[0]).get("real_name"));
assertEquals(((Boolean) true), ((HashMap<String, Boolean>) userList1[0]).get("can_login"));
@@ -383,7 +388,6 @@ public class BugzillaXmlRpcClientTest extends AbstractBugzillaTest {
}
}
- @SuppressWarnings("unused")
public void testXmlRpcInstalled() throws Exception {
int uID = -1;
IProgressMonitor monitor = new NullProgressMonitor();
@@ -496,8 +500,8 @@ public class BugzillaXmlRpcClientTest extends AbstractBugzillaTest {
public void accept(TaskData taskData) {
try {
AbstractTaskDataHandler taskDataHandler = connector.getTaskDataHandler();
- taskDataHandler.initializeTaskData(repository, taskData, null, new SubProgressMonitor(monitor2,
- 1));
+ taskDataHandler.initializeTaskData(repository, taskData, null,
+ new SubProgressMonitor(monitor2, 1));
} catch (CoreException e) {
// this info CoreException is only used internal
if (e.getStatus().getCode() == IStatus.INFO && e.getMessage().contains("Update Config")) { //$NON-NLS-1$
@@ -620,7 +624,8 @@ public class BugzillaXmlRpcClientTest extends AbstractBugzillaTest {
if (!BugzillaFixture.current().isXmlRpcEnabled()) {
return;
}
- RepositoryConfiguration repositoryConfiguration = connector.getRepositoryConfiguration(repository.getRepositoryUrl());
+ RepositoryConfiguration repositoryConfiguration = connector
+ .getRepositoryConfiguration(repository.getRepositoryUrl());
for (String product : repositoryConfiguration.getOptionValues(BugzillaAttribute.PRODUCT)) {
repositoryConfiguration.setDefaultMilestone(product, null);
@@ -628,7 +633,8 @@ public class BugzillaXmlRpcClientTest extends AbstractBugzillaTest {
bugzillaClient.updateProductInfo(new NullProgressMonitor(), repositoryConfiguration);
for (String product : repositoryConfiguration.getOptionValues(BugzillaAttribute.PRODUCT)) {
- if (product.equals("ManualTest") || product.equals("Product with Spaces") || product.equals("TestProduct")) {
+ if (product.equals("ManualTest") || product.equals("Product with Spaces")
+ || product.equals("TestProduct")) {
assertEquals("---", repositoryConfiguration.getDefaultMilestones(product));
} else {
fail("never reach this");
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 6420c36a6..e7430947a 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
@@ -18,8 +18,6 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
-import junit.framework.AssertionFailedError;
-
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -49,6 +47,8 @@ import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.core.data.TaskDataCollector;
import org.eclipse.mylyn.tests.util.TestFixture;
+import junit.framework.AssertionFailedError;
+
/**
* @author Steffen Pingel
* @author Thomas Ehrnhoefer
@@ -130,8 +130,8 @@ public class BugzillaFixture extends TestFixture {
return client(getRepositoryUrl(), credentials.getUserName(), credentials.getPassword(), "", "", "UTF-8");
}
- public BugzillaClient client(String hostUrl, String username, String password, String htAuthUser,
- String htAuthPass, String encoding) throws CoreException, IOException {
+ public BugzillaClient client(String hostUrl, String username, String password, String htAuthUser, String htAuthPass,
+ String encoding) throws CoreException, IOException {
WebLocation location = new WebLocation(hostUrl);
location.setCredentials(AuthenticationType.REPOSITORY, username, password);
location.setCredentials(AuthenticationType.HTTP, htAuthUser, htAuthPass);
@@ -187,7 +187,7 @@ public class BugzillaFixture extends TestFixture {
/**
* Create and returns a minimal task.
- *
+ *
* @param summary
* may be <code>null</code>
* @param description
@@ -243,7 +243,7 @@ public class BugzillaFixture extends TestFixture {
/**
* Retrieve task data for given task id
- *
+ *
* @param id
* @param client
* @return The taskData retrieved
@@ -305,4 +305,8 @@ public class BugzillaFixture extends TestFixture {
public BugzillaHarness createHarness() {
return new BugzillaHarness(this);
}
+
+ public boolean isBugzilla51OrGreater() {
+ return bugzillaVersion.compareTo(BugzillaVersion.BUGZILLA_5_1) < 0;
+ }
}

Back to the top