Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 203353 - Add method org.eclipse.ui.internal.ErrorEditorPart.getError().
Summary: Add method org.eclipse.ui.internal.ErrorEditorPart.getError().
Status: RESOLVED DUPLICATE of bug 90582
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 3.4   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-13 15:45 EDT by Robert Konigsberg CLA
Modified: 2009-10-01 09:36 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Konigsberg CLA 2007-09-13 15:45:44 EDT
I have written a test for my custom editor. It looks like this:

    IEditorPart editor = openEditorFor(file);
    assertTrue(editor instanceof MyEditor);
    
 For the first time, this test has failed. I can't quite tell why, but I see that editor is an ErrorEditorPart.
 
 I see that an error is stored in the ErrorEditorPart. I would like a very easy way to access to error and include it in my test case. e.g.
 
   public void testInit() throws Exception {

    IEditorPart editor = openEditorFor(file);
    if (editor instanceof ErrorEditorPart) {
      fail("Error not created: " + ((ErrorEditorPart) editor).getError());
    }
    assertTrue(editor instanceof MyEditor);

 Make sense?
Comment 1 Boris Bokowski CLA 2007-09-18 12:40:16 EDT
>  Make sense?

Almost :)

ErrorEditorPart is not API, and I doubt that we would want to make it API.

I believe you want openEditor to follow the spec and throw a PartInitException.


*** This bug has been marked as a duplicate of bug 90582 ***
Comment 2 Robert Konigsberg CLA 2008-04-07 07:39:35 EDT
Boris, this is from a while ago, sorry I didn't reply sooner. I'll wait for now on the other bug, that seems to be the right thing, am I correct?