Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Davis2017-03-24 17:07:15 +0000
committerSam Davis2017-03-24 17:19:51 +0000
commitb81cfc5248c1ef87bd858b537ce8176328521bd7 (patch)
tree55e022caeb5cb94532d7e7a3878e1e2f8d9b74ff /org.eclipse.mylyn.tasks.tests
parent3fe7bc9a97e262ff1553d376491e48681cc5c189 (diff)
downloadorg.eclipse.mylyn.tasks-b81cfc5248c1ef87bd858b537ce8176328521bd7.tar.gz
org.eclipse.mylyn.tasks-b81cfc5248c1ef87bd858b537ce8176328521bd7.tar.xz
org.eclipse.mylyn.tasks-b81cfc5248c1ef87bd858b537ce8176328521bd7.zip
514190: NPE expanding attachments section
Change-Id: I29a3b560bd04e7a7fcb2f53d379a8546c44423e9 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=514190
Diffstat (limited to 'org.eclipse.mylyn.tasks.tests')
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/editor/AttachmentTableLabelProviderTest.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/editor/AttachmentTableLabelProviderTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/editor/AttachmentTableLabelProviderTest.java
index 7497e955b..60affa198 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/editor/AttachmentTableLabelProviderTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/editor/AttachmentTableLabelProviderTest.java
@@ -11,6 +11,7 @@
package org.eclipse.mylyn.tasks.tests.ui.editor;
+import org.eclipse.jface.viewers.StyledString;
import org.eclipse.mylyn.internal.tasks.core.TaskAttachment;
import org.eclipse.mylyn.internal.tasks.ui.editors.AttachmentTableLabelProvider;
import org.eclipse.mylyn.tasks.tests.TaskTestUtil;
@@ -43,4 +44,15 @@ public class AttachmentTableLabelProviderTest extends TestCase {
assertEquals("myid", labelProvider.buildTextFromEventIndex(5, attachment).getString());
}
+ public void testGetAttachmentDescription() throws Exception {
+ TaskAttachment attachment = TaskTestUtil.createMockTaskAttachment("1");
+ attachment.setDescription(null);
+ AttachmentTableLabelProvider labelProvider = new AttachmentTableLabelProvider();
+ StyledString styledString = labelProvider.buildTextFromEventIndex(1, attachment);
+ assertEquals("", styledString.getString());
+
+ attachment.setDescription("test");
+ styledString = labelProvider.buildTextFromEventIndex(1, attachment);
+ assertEquals("test", styledString.getString());
+ }
}

Back to the top