Avoid displaying error dialogs in JUnit mode.
--- a/core/com.nokia.carbide.cpp.sysdoc.hover/src/com/nokia/carbide/cpp/sysdoc/internal/hover/core/HoverManager.java Mon Nov 16 10:11:24 2009 -0600
+++ b/core/com.nokia.carbide.cpp.sysdoc.hover/src/com/nokia/carbide/cpp/sysdoc/internal/hover/core/HoverManager.java Mon Nov 16 10:25:45 2009 -0600
@@ -16,6 +16,9 @@
*/
package com.nokia.carbide.cpp.sysdoc.internal.hover.core;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.testing.TestableObject;
+
import com.nokia.carbide.cpp.sysdoc.hover.Activator;
import com.nokia.carbide.cpp.sysdoc.internal.hover.dal.devlib.DevLibProperties;
import com.nokia.carbide.cpp.sysdoc.internal.hover.dal.devlib.locator.DevLiblocatorFactory;
@@ -200,4 +203,13 @@
public static HoverManager getInstance() {
return instance;
}
+
+ public static boolean isJunitRunning() {
+ boolean result = false;
+ TestableObject testableObject = PlatformUI.getTestableObject();
+ if (testableObject != null) {
+ result = testableObject.getTestHarness() != null;
+ }
+ return result;
+ }
}
--- a/core/com.nokia.carbide.cpp.sysdoc.hover/src/com/nokia/carbide/cpp/sysdoc/internal/hover/uitlis/DialogHelper.java Mon Nov 16 10:11:24 2009 -0600
+++ b/core/com.nokia.carbide.cpp.sysdoc.hover/src/com/nokia/carbide/cpp/sysdoc/internal/hover/uitlis/DialogHelper.java Mon Nov 16 10:25:45 2009 -0600
@@ -44,7 +44,7 @@
}
};
- if (!HoverManager.isTestMode()) {
+ if (!HoverManager.isTestMode() && !HoverManager.isJunitRunning()) {
ExecutorAgent.run(mssageRunnable);
}
}