Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2013-03-08 14:43:24 -0500
committerSteffen Pingel2013-05-07 04:45:39 -0400
commit79a78a92923d2692c688bc85a6b241a8e21e37cb (patch)
treecfe03e3376162b9884698fc14d176ac1d09c4fd4 /org.eclipse.mylyn.bugzilla.tests/src
parent1fa9a69e17888572af3135bae8fcbe3336864487 (diff)
downloadorg.eclipse.mylyn.tasks-79a78a92923d2692c688bc85a6b241a8e21e37cb.tar.gz
org.eclipse.mylyn.tasks-79a78a92923d2692c688bc85a6b241a8e21e37cb.tar.xz
org.eclipse.mylyn.tasks-79a78a92923d2692c688bc85a6b241a8e21e37cb.zip
402431: Bugzilla should provide kind for people attributes
Change-Id: Ie9e7224ea6d9902f6a2e17a059521aedb539f917 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=402431
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.tests/src')
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaHeadlessStandaloneTests.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaAttributeTest.java49
2 files changed, 51 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaHeadlessStandaloneTests.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaHeadlessStandaloneTests.java
index ed07e4278..e581fa1c7 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaHeadlessStandaloneTests.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AllBugzillaHeadlessStandaloneTests.java
@@ -18,6 +18,7 @@ import junit.framework.Test;
import junit.framework.TestSuite;
import org.eclipse.mylyn.bugzilla.tests.core.BugzillaAttributeMapperTest;
+import org.eclipse.mylyn.bugzilla.tests.core.BugzillaAttributeTest;
import org.eclipse.mylyn.bugzilla.tests.core.BugzillaClientTest;
import org.eclipse.mylyn.bugzilla.tests.core.BugzillaConfigurationTest;
import org.eclipse.mylyn.bugzilla.tests.core.BugzillaCustomFieldsTest;
@@ -47,6 +48,7 @@ public class AllBugzillaHeadlessStandaloneTests {
suite.addTestSuite(BugzillaVersionTest.class);
suite.addTestSuite(BugzillaDateTimeTests.class);
suite.addTestSuite(BugzillaAttributeMapperTest.class);
+ suite.addTestSuite(BugzillaAttributeTest.class);
if (!configuration.isLocalOnly()) {
// network tests
suite.addTestSuite(BugzillaTaskCompletionTest.class);
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaAttributeTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaAttributeTest.java
new file mode 100644
index 000000000..5fb813d49
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaAttributeTest.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Frank Becker and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse @Test
+ public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Frank Becker - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.bugzilla.tests.core;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.io.IOUtils;
+import org.eclipse.mylyn.bugzilla.tests.support.BugzillaFixture;
+import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil;
+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttributeMapper;
+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector;
+import org.eclipse.mylyn.tasks.core.TaskRepository;
+import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
+import org.eclipse.mylyn.tasks.core.data.TaskData;
+
+/**
+ * @author Steffen Pingel
+ */
+public class BugzillaAttributeTest extends TestCase {
+
+ public void testTaskDataSchema() throws Exception {
+ BugzillaRepositoryConnector connector = BugzillaFixture.current().connector();
+ TaskRepository repository = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, "http://repository");
+ BugzillaAttributeMapper mapper = new BugzillaAttributeMapper(repository, connector);
+ TaskData taskData = new TaskData(mapper, repository.getConnectorKind(), repository.getRepositoryUrl(), "");
+ BugzillaAttribute[] attributes = BugzillaAttribute.values();
+ for (BugzillaAttribute attribute : attributes) {
+ TaskAttribute taskDataAttribute = taskData.getRoot().createAttribute(attribute.getKey());
+ taskDataAttribute.getMetaData().setReadOnly(attribute.isReadOnly());
+ taskDataAttribute.getMetaData().setKind(attribute.getKind());
+ taskDataAttribute.getMetaData().setType(attribute.getType());
+ }
+ assertEquals(IOUtils.toString(CommonTestUtil.getResource(this, "testdata/schema/taskdata.txt")),
+ taskData.getRoot().toString());
+ }
+
+} \ No newline at end of file

Back to the top