Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/notifications/NotificationsTestCase.java')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/notifications/NotificationsTestCase.java48
1 files changed, 46 insertions, 2 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/notifications/NotificationsTestCase.java b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/notifications/NotificationsTestCase.java
index 66bb4ca01..03e2737d3 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/notifications/NotificationsTestCase.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/notifications/NotificationsTestCase.java
@@ -18,6 +18,7 @@ import org.eclipse.tcf.te.runtime.events.NotifyEvent;
import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
import org.eclipse.tcf.te.runtime.properties.PropertiesContainer;
import org.eclipse.tcf.te.tests.CoreTestCase;
+import org.eclipse.tcf.te.tests.activator.ImageConsts;
/**
* Notification test cases.
@@ -44,8 +45,11 @@ public class NotificationsTestCase extends CoreTestCase {
public void testNotifications() {
IPropertiesContainer properties = new PropertiesContainer();
- properties.setProperty(NotifyEvent.PROP_TITLE_TEXT, "VxWorks Simulator"); //$NON-NLS-1$
- properties.setProperty(NotifyEvent.PROP_DESCRIPTION_TEXT, "Test notification issued by the unit test framework."); //$NON-NLS-1$
+ assertNotNull("Failed to create properties container.", properties); //$NON-NLS-1$
+
+ // First test is using the default form text factory delegate
+ properties.setProperty(NotifyEvent.PROP_TITLE_TEXT, "Notification Test"); //$NON-NLS-1$
+ properties.setProperty(NotifyEvent.PROP_DESCRIPTION_TEXT, "Test notification with a simple title and description."); //$NON-NLS-1$
NotifyEvent notification = new NotifyEvent(NotificationsTestCase.this, properties);
assertNotNull("Failed to create test notification event.", notification); //$NON-NLS-1$
@@ -53,6 +57,46 @@ public class NotificationsTestCase extends CoreTestCase {
EventManager.getInstance().fireEvent(notification);
ExecutorsUtil.waitAndExecute(20000, null);
+
+ // Second test is using a custom form text factory delegate to set an icon
+ properties.clearProperties();
+ properties.setProperty(NotifyEvent.PROP_TITLE_TEXT, "Simulator Target"); //$NON-NLS-1$
+ properties.setProperty(NotifyEvent.PROP_TITLE_IMAGE_ID, ImageConsts.PEER);
+ properties.setProperty(NotifyEvent.PROP_DESCRIPTION_TEXT, "Test notification issued by the unit test framework."); //$NON-NLS-1$
+
+ notification = new NotifyEvent(NotificationsTestCase.this, "org.eclipse.tcf.te.tests.delegates.TestFormTextFactoryDelegate", properties); //$NON-NLS-1$
+ assertNotNull("Failed to create test notification event.", notification); //$NON-NLS-1$
+
+ EventManager.getInstance().fireEvent(notification);
+
+ ExecutorsUtil.waitAndExecute(20000, null);
+
+ // Third and forth test is using a custom form text factory delegate to simulate a more complex rendering
+ properties.clearProperties();
+ properties.setProperty(NotifyEvent.PROP_TITLE_TEXT, "Simulator Target"); //$NON-NLS-1$
+ properties.setProperty(NotifyEvent.PROP_TITLE_IMAGE_ID, ImageConsts.PEER);
+ properties.setProperty("moduleName", "cobble.out"); //$NON-NLS-1$ //$NON-NLS-2$
+ properties.setProperty("success", true); //$NON-NLS-1$
+
+ notification = new NotifyEvent(NotificationsTestCase.this, "org.eclipse.tcf.te.tests.delegates.TestFormTextFactoryDelegate2", properties); //$NON-NLS-1$
+ assertNotNull("Failed to create test notification event.", notification); //$NON-NLS-1$
+
+ EventManager.getInstance().fireEvent(notification);
+
+ ExecutorsUtil.waitAndExecute(20000, null);
+
+ properties.clearProperties();
+ properties.setProperty(NotifyEvent.PROP_TITLE_TEXT, "Simulator Target"); //$NON-NLS-1$
+ properties.setProperty(NotifyEvent.PROP_TITLE_IMAGE_ID, ImageConsts.PEER);
+ properties.setProperty("moduleName", "cobble.out"); //$NON-NLS-1$ //$NON-NLS-2$
+ properties.setProperty("success", false); //$NON-NLS-1$
+
+ notification = new NotifyEvent(NotificationsTestCase.this, "org.eclipse.tcf.te.tests.delegates.TestFormTextFactoryDelegate2", properties); //$NON-NLS-1$
+ assertNotNull("Failed to create test notification event.", notification); //$NON-NLS-1$
+
+ EventManager.getInstance().fireEvent(notification);
+
+ ExecutorsUtil.waitAndExecute(20000, null);
}
//***** END SECTION: Single test methods *****

Back to the top