# HG changeset patch # User Ed Swartz # Date 1258388745 21600 # Node ID e03ece49757c1a580ecf3396bdc83d370ba8b131 # Parent a8e3469fafa41d018bc8e287951cfbf38cac64e8 Avoid displaying error dialogs in JUnit mode. diff -r a8e3469fafa4 -r e03ece49757c core/com.nokia.carbide.cpp.sysdoc.hover/src/com/nokia/carbide/cpp/sysdoc/internal/hover/core/HoverManager.java --- 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; + } } diff -r a8e3469fafa4 -r e03ece49757c core/com.nokia.carbide.cpp.sysdoc.hover/src/com/nokia/carbide/cpp/sysdoc/internal/hover/uitlis/DialogHelper.java --- 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); } }