Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2012-11-18 15:07:13 -0500
committerFrank Becker2012-11-18 15:07:13 -0500
commita12cda4438d58d49f1f490645b0219d569ea5ab8 (patch)
treeb063a2943876817805dfadb5e7a894c8cac1bb7b /org.eclipse.mylyn.bugzilla.tests
parente8f49283d766cd89db0fd47e5423fe6604fa62ab (diff)
downloadorg.eclipse.mylyn.tasks-a12cda4438d58d49f1f490645b0219d569ea5ab8.tar.gz
org.eclipse.mylyn.tasks-a12cda4438d58d49f1f490645b0219d569ea5ab8.tar.xz
org.eclipse.mylyn.tasks-a12cda4438d58d49f1f490645b0219d569ea5ab8.zip
Revert "372600: redesign of RepositoryConfiguration create new usage api Change-Id: Ieb5f1514ac88b9d32b529fdbe27b8f215d0873f6 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=372600"
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.tests')
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java4
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryReportFactoryTest.java4
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaClientTest.java56
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaConfigurationTest.java12
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaRepositoryConnectorStandaloneTest.java4
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaXmlRpcClientTest.java5
6 files changed, 41 insertions, 44 deletions
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java
index 54dda35ea..3995b8e66 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java
@@ -963,7 +963,7 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
// test anonymous update of configuration
RepositoryConfiguration config = connector.getRepositoryConfiguration(repository, false, null);
assertNotNull(config);
- assertTrue(config.getOptionValues(BugzillaAttribute.COMPONENT).size() > 0);
+ assertTrue(config.getComponents().size() > 0);
}
public void testTimeTracker() throws Exception {
@@ -1077,7 +1077,7 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
return;
}
RepositoryConfiguration repositoryConfiguration = connector.getRepositoryConfiguration(repository.getRepositoryUrl());
- List<String> priorities = repositoryConfiguration.getOptionValues(BugzillaAttribute.PRIORITY);
+ List<String> priorities = repositoryConfiguration.getPriorities();
String priority1 = priorities.get(0);
String priority2 = priorities.get(1);
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryReportFactoryTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryReportFactoryTest.java
index c66c4142b..78183a377 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryReportFactoryTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryReportFactoryTest.java
@@ -20,7 +20,6 @@ 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.BugzillaRepositoryConnector;
@@ -29,6 +28,7 @@ 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;
/**
* @author Rob Elves
@@ -78,7 +78,7 @@ public class RepositoryReportFactoryTest extends TestCase {
public void testPostingAndReadingAttributes() throws Exception {
RepositoryConfiguration repositoryConfiguration = connector.getRepositoryConfiguration(repository.getRepositoryUrl());
- List<String> priorities = repositoryConfiguration.getOptionValues(BugzillaAttribute.PRIORITY);
+ List<String> priorities = repositoryConfiguration.getPriorities();
String priority = priorities.get(priorities.size() > 0 ? priorities.size() - 1 : 0);
TaskData data = BugzillaFixture.current().createTask(PrivilegeLevel.USER, "testPostingAndReading() summary",
"testPostingAndReading() description");
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 770fc12c4..f15cca85e 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
@@ -74,30 +74,30 @@ public class BugzillaClientTest extends TestCase {
config.getInstallVersion().compareMajorMinorOnly(
new BugzillaVersion(BugzillaFixture.current().getVersion())));
if (BugzillaFixture.current() == BugzillaFixture.BUGS_3_6_CUSTOM_WF_AND_STATUS) {
- assertEquals(10, config.getOptionValues(BugzillaAttribute.BUG_STATUS).size());
+ assertEquals(10, config.getStatusValues().size());
} else if (BugzillaFixture.current().getBugzillaVersion().compareMajorMinorOnly(BugzillaVersion.BUGZILLA_4_0) < 0) {
- assertEquals(7, config.getOptionValues(BugzillaAttribute.BUG_STATUS).size());
+ assertEquals(7, config.getStatusValues().size());
} else {
- assertEquals(5, config.getOptionValues(BugzillaAttribute.BUG_STATUS).size());
+ assertEquals(5, config.getStatusValues().size());
}
- if (config.getOptionValues(BugzillaAttribute.RESOLUTION).contains("LATER")) {
- assertEquals(8, config.getOptionValues(BugzillaAttribute.RESOLUTION).size());
- assertEquals(8, config.getOptionValues(BugzillaAttribute.REP_PLATFORM).size());
- assertEquals(36, config.getOptionValues(BugzillaAttribute.OP_SYS).size());
- assertEquals(5, config.getOptionValues(BugzillaAttribute.PRIORITY).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 {
if (BugzillaVersion.BUGZILLA_4_0.compareMajorMinorOnly(new BugzillaVersion(BugzillaFixture.current()
.getVersion())) > 0) {
- assertEquals(6, config.getOptionValues(BugzillaAttribute.RESOLUTION).size());
+ assertEquals(6, config.getResolutions().size());
} else {
- assertEquals(5, config.getOptionValues(BugzillaAttribute.RESOLUTION).size());
+ assertEquals(5, config.getResolutions().size());
}
- assertEquals(4, config.getOptionValues(BugzillaAttribute.REP_PLATFORM).size());
- assertEquals(5, config.getOptionValues(BugzillaAttribute.OP_SYS).size());
- assertEquals(6, config.getOptionValues(BugzillaAttribute.PRIORITY).size());
+ assertEquals(4, config.getPlatforms().size());
+ assertEquals(5, config.getOSs().size());
+ assertEquals(6, config.getPriorities().size());
}
- assertEquals(7, config.getOptionValues(BugzillaAttribute.BUG_SEVERITY).size());
- assertEquals(3, config.getOptionValues(BugzillaAttribute.PRODUCT).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());
@@ -108,22 +108,22 @@ public class BugzillaClientTest extends TestCase {
assertEquals(3, config.getOpenStatusValues().size());
assertEquals(2, config.getClosedStatusValues().size());
}
- assertEquals(2, config.getOptionValues(BugzillaAttribute.KEYWORDS).size());
- assertEquals(2, config.getProductOptionValues(BugzillaAttribute.COMPONENT, "ManualTest").size());
- assertEquals(4, config.getProductOptionValues(BugzillaAttribute.VERSION, "ManualTest").size());
- assertEquals(4, config.getProductOptionValues(BugzillaAttribute.TARGET_MILESTONE, "ManualTest").size());
+ assertEquals(2, config.getKeywords().size());
+ assertEquals(2, config.getComponents("ManualTest").size());
+ assertEquals(4, config.getVersions("ManualTest").size());
+ assertEquals(4, config.getTargetMilestones("ManualTest").size());
if (BugzillaFixture.current().getRepositoryUrl().contains("localhost")) {
- assertEquals(1, config.getProductOptionValues(BugzillaAttribute.COMPONENT, "TestProduct").size());
- assertEquals(1, config.getProductOptionValues(BugzillaAttribute.VERSION, "TestProduct").size());
- assertEquals(1, config.getProductOptionValues(BugzillaAttribute.TARGET_MILESTONE, "TestProduct").size());
+ assertEquals(1, config.getComponents("TestProduct").size());
+ assertEquals(1, config.getVersions("TestProduct").size());
+ assertEquals(1, config.getTargetMilestones("TestProduct").size());
} else {
- assertEquals(2, config.getProductOptionValues(BugzillaAttribute.COMPONENT, "TestProduct").size());
- assertEquals(4, config.getProductOptionValues(BugzillaAttribute.VERSION, "TestProduct").size());
- assertEquals(4, config.getProductOptionValues(BugzillaAttribute.TARGET_MILESTONE, "TestProduct").size());
+ assertEquals(2, config.getComponents("TestProduct").size());
+ assertEquals(4, config.getVersions("TestProduct").size());
+ assertEquals(4, config.getTargetMilestones("TestProduct").size());
}
- assertEquals(2, config.getProductOptionValues(BugzillaAttribute.COMPONENT, "Product with Spaces").size());
- assertEquals(4, config.getProductOptionValues(BugzillaAttribute.VERSION, "Product with Spaces").size());
- assertEquals(4, config.getProductOptionValues(BugzillaAttribute.TARGET_MILESTONE, "Product with Spaces").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 {
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaConfigurationTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaConfigurationTest.java
index 4a233ae83..c733e4b0b 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaConfigurationTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaConfigurationTest.java
@@ -19,7 +19,6 @@ import java.io.InputStreamReader;
import junit.framework.TestCase;
import org.eclipse.mylyn.bugzilla.tests.support.BugzillaFixture;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector;
import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration;
import org.eclipse.mylyn.internal.bugzilla.core.SaxConfigurationContentHandler;
@@ -44,12 +43,12 @@ public class BugzillaConfigurationTest extends TestCase {
RepositoryConfiguration configuration1 = new RepositoryConfiguration();
configuration1.setRepositoryUrl("url1");
configuration1.addProduct("Test Product 1");
- assertEquals(1, configuration1.getOptionValues(BugzillaAttribute.PRODUCT).size());
+ assertEquals(1, configuration1.getProducts().size());
RepositoryConfiguration configuration2 = new RepositoryConfiguration();
configuration1.setRepositoryUrl("url2");
configuration2.addProduct("Test Product 2");
- assertEquals(1, configuration2.getOptionValues(BugzillaAttribute.PRODUCT).size());
+ assertEquals(1, configuration2.getProducts().size());
connector.addRepositoryConfiguration(configuration1);
connector.addRepositoryConfiguration(configuration2);
@@ -67,9 +66,8 @@ public class BugzillaConfigurationTest extends TestCase {
assertNotNull(connector.getRepositoryConfiguration(configuration1.getRepositoryUrl()));
assertNotNull(connector.getRepositoryConfiguration(configuration2.getRepositoryUrl()));
RepositoryConfiguration testLoadedConfig = connector.getRepositoryConfiguration(configuration1.getRepositoryUrl());
- assertEquals(1, testLoadedConfig.getOptionValues(BugzillaAttribute.PRODUCT).size());
- assertEquals(configuration1.getOptionValues(BugzillaAttribute.PRODUCT).get(0),
- testLoadedConfig.getOptionValues(BugzillaAttribute.PRODUCT).get(0));
+ assertEquals(1, testLoadedConfig.getProducts().size());
+ assertEquals(configuration1.getProducts().get(0), testLoadedConfig.getProducts().get(0));
}
public void testNullCacheFile() {
@@ -144,7 +142,7 @@ public class BugzillaConfigurationTest extends TestCase {
RepositoryConfiguration config = contentHandler.getConfiguration();
assertNotNull(config);
- assertTrue(config.getOptionValues(BugzillaAttribute.PRODUCT).contains(
+ assertTrue(config.getProducts().contains(
"Test-Long-Named-Product-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"));
// Add your additional checking for valid data here if necessary
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaRepositoryConnectorStandaloneTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaRepositoryConnectorStandaloneTest.java
index 7bdee2973..fddb8019b 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaRepositoryConnectorStandaloneTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaRepositoryConnectorStandaloneTest.java
@@ -25,7 +25,6 @@ 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.BugzillaRepositoryConnector;
@@ -43,6 +42,7 @@ import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.core.data.TaskDataCollector;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
/**
* @author Nathan Hapke
@@ -218,7 +218,7 @@ public class BugzillaRepositoryConnectorStandaloneTest extends TestCase {
// queries for bugs assigned to tests@mylyn.eclipse.org, updated in the last hour, trivial with P1
RepositoryConfiguration repositoryConfiguration = connector.getRepositoryConfiguration(repository.getRepositoryUrl());
- List<String> priorities = repositoryConfiguration.getOptionValues(BugzillaAttribute.PRIORITY);
+ List<String> priorities = repositoryConfiguration.getPriorities();
String priority = priorities.get(0);
String severity = "trivial";
String email = "tests%40mylyn.eclipse.org";
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 ec10dbe89..1e4fbc751 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
@@ -29,7 +29,6 @@ import org.eclipse.mylyn.bugzilla.tests.support.BugzillaFixture;
import org.eclipse.mylyn.commons.net.AuthenticationType;
import org.eclipse.mylyn.commons.net.WebLocation;
import org.eclipse.mylyn.internal.bugzilla.core.AbstractBugzillaOperation;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttributeMapper;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion;
import org.eclipse.mylyn.internal.bugzilla.core.CustomTransitionManager;
@@ -697,12 +696,12 @@ public class BugzillaXmlRpcClientTest extends AbstractBugzillaTest {
}
RepositoryConfiguration repositoryConfiguration = connector.getRepositoryConfiguration(repository.getRepositoryUrl());
- for (String product : repositoryConfiguration.getOptionValues(BugzillaAttribute.PRODUCT)) {
+ for (String product : repositoryConfiguration.getProducts()) {
repositoryConfiguration.setDefaultMilestone(product, null);
}
bugzillaClient.updateProductInfo(new NullProgressMonitor(), repositoryConfiguration);
- for (String product : repositoryConfiguration.getOptionValues(BugzillaAttribute.PRODUCT)) {
+ for (String product : repositoryConfiguration.getProducts()) {
if (product.equals("ManualTest") || product.equals("Product with Spaces") || product.equals("TestProduct")) {
assertEquals("---", repositoryConfiguration.getDefaultMilestones(product));
} else {

Back to the top