Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333970 - [ErrorHandling] Test failures in official build: at org.eclipse.ui.tests.statushandlers.StatusDialogManagerTest.testBug276371(StatusDialogManagerTest.java:638)
Summary: [ErrorHandling] Test failures in official build: at org.eclipse.ui.tests.stat...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.7 M5   Edit
Assignee: Krzysztof Daniel CLA
QA Contact: Susan McCourt CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-11 07:55 EST by Dani Megert CLA
Modified: 2011-01-25 03:22 EST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2011-01-11 07:55:37 EST
N20110110-2000.

no exception should be thrown

junit.framework.AssertionFailedError: no exception should be thrown
at org.eclipse.ui.tests.statushandlers.StatusDialogManagerTest.testBug276371(StatusDialogManagerTest.java:638)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:416)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:249)
at org.eclipse.test.UITestApplication$2.run(UITestApplication.java:197)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4064)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3683)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2697)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2661)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2495)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.eclipse.test.UITestApplication.runApplication(UITestApplication.java:140)
at org.eclipse.test.UITestApplication.run(UITestApplication.java:62)
at org.eclipse.test.UITestApplication.start(UITestApplication.java:212)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
at org.eclipse.core.launcher.Main.main(Main.java:34)
Comment 1 Remy Suen CLA 2011-01-11 08:05:12 EST
The try/catch block with the fail(String) method needs to be deleted. The stack trace as it is tells us absolutely nothing. We should let the exception be propagated up to JUnit so that it can report the trace back in its entirety.
Comment 2 Krzysztof Daniel CLA 2011-01-11 14:57:27 EST
The test was introduced to ensure that no exception during displaying status dialog will cause an endless loop of exceptions nor prevent further exceptions from displaying.

To cause an exception, I have used custom IStatus which exploded when the message was get. The code in status has not changed, the exception is properly caught and then logged via WorkbenchPlugin.log(statusAdapter.getStatus());

Due to changes introduced by bug 292135, following code will fail:
PlatformLogWriter.

IStatus status = new Status(IStatus.ERROR, "org.eclipse.ui.tests", "bomb"){
    public String getMessage() {
        throw new RuntimeException("the bomb!");
    }
};
PlatformLogWriter.getLog(status).

Thomas,
is this a valid test case for you?
Comment 3 Thomas Watson CLA 2011-01-11 16:32:54 EST
I am not sure what the correct coarse of action is here.  If someone supplies a bad status we are supposed to catch the exception and let the status through the logging system without propagating the exception to the caller?


John, only CC'ing you in case I am not available to fix this and it turns out to be something we need to address in common.
Comment 4 Krzysztof Daniel CLA 2011-01-12 03:00:42 EST
Ok, the issue is caused by the bug in the test itself. The fake status throws exception all the time, and therefore it cannot be logged properly.

I have updated the status to fail only once and therefore simulate an exception during exception handling only in status dialog.

The test passes now.

The question what to do with such a status during osgi logging is a separate issue.
Comment 5 Dani Megert CLA 2011-01-12 05:11:58 EST
(In reply to comment #4)
> Ok, the issue is caused by the bug in the test itself. The fake status throws
> exception all the time, and therefore it cannot be logged properly.
> 
> I have updated the status to fail only once and therefore simulate an exception
> during exception handling only in status dialog.
FYI: I've updated copyright date and bundle version in HEAD.
Comment 6 Dani Megert CLA 2011-01-25 03:22:26 EST
Verified in I20110118-0800.