Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Dos Santos2014-01-15 01:56:27 +0000
committerGerrit Code Review @ Eclipse.org2014-02-12 01:27:20 +0000
commitff4c0c3bb2acad4dd614680a7228aa4c3f3ab025 (patch)
tree638e3592d8e16fecc09365283f8fe9a082007e32 /org.eclipse.mylyn.tasks.tests
parentb8fcbca33a9b308885ffb1f8ff7f2b137907758e (diff)
downloadorg.eclipse.mylyn.tasks-ff4c0c3bb2acad4dd614680a7228aa4c3f3ab025.tar.gz
org.eclipse.mylyn.tasks-ff4c0c3bb2acad4dd614680a7228aa4c3f3ab025.tar.xz
org.eclipse.mylyn.tasks-ff4c0c3bb2acad4dd614680a7228aa4c3f3ab025.zip
378032: fix for boolean attribute editors that show required decorator
Change-Id: Ie343ba26b972fe1327d2fce0e57ab07e78184de9 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=378032 Signed-off-by: Leo Dos Santos <leo.dos.santos@tasktop.com>
Diffstat (limited to 'org.eclipse.mylyn.tasks.tests')
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/AttributeEditorTest.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/AttributeEditorTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/AttributeEditorTest.java
index d328f79b9..17e46b94b 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/AttributeEditorTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/AttributeEditorTest.java
@@ -17,6 +17,7 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.mylyn.commons.workbench.WorkbenchUtil;
import org.eclipse.mylyn.internal.tasks.core.data.TaskDataState;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
+import org.eclipse.mylyn.internal.tasks.ui.editors.BooleanAttributeEditor;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
@@ -70,6 +71,19 @@ public class AttributeEditorTest extends TestCase {
}
}
+ private class MockBooleanAttributeEditor extends BooleanAttributeEditor {
+
+ public MockBooleanAttributeEditor(TaskDataModel manager, TaskAttribute taskAttribute) {
+ super(manager, taskAttribute);
+ }
+
+ @Override
+ public boolean needsValue() {
+ return super.needsValue();
+ }
+
+ }
+
private TaskRepository repository;
private TaskData taskData;
@@ -197,6 +211,15 @@ public class AttributeEditorTest extends TestCase {
manager.attributeChanged(attribute);
}
+ public void testBooleanAttribute() throws Exception {
+ TaskAttribute attribute = new TaskAttribute(taskData.getRoot(), "a.required.boolean");
+ attribute.getMetaData().setType(TaskAttribute.TYPE_BOOLEAN);
+ attribute.getMetaData().setRequired(true);
+
+ MockBooleanAttributeEditor editor = new MockBooleanAttributeEditor(manager, attribute);
+ assertFalse(editor.needsValue());
+ }
+
private TaskDataModel createManager() throws Exception {
MockTask task = new MockTask("taskId");
TaskDataState state = new TaskDataState("kind", "url", "taskId");

Back to the top