Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 115371 Details for
Bug 107753
[Decorators] Exception handling message in decoration job could be improved
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
tests
JUnitTest.txt (text/plain), 7.21 KB, created by
Krzysztof Daniel
on 2008-10-17 05:46:08 EDT
(
hide
)
Description:
tests
Filename:
MIME Type:
Creator:
Krzysztof Daniel
Created:
2008-10-17 05:46:08 EDT
Size:
7.21 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.tests >Index: Eclipse UI Tests/org/eclipse/ui/tests/decorators/DecoratorsTestSuite.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/decorators/DecoratorsTestSuite.java,v >retrieving revision 1.11 >diff -u -r1.11 DecoratorsTestSuite.java >--- Eclipse UI Tests/org/eclipse/ui/tests/decorators/DecoratorsTestSuite.java 24 Mar 2008 19:13:47 -0000 1.11 >+++ Eclipse UI Tests/org/eclipse/ui/tests/decorators/DecoratorsTestSuite.java 17 Oct 2008 09:43:47 -0000 >@@ -28,6 +28,7 @@ > */ > public DecoratorsTestSuite() { > addTest(new TestSuite(ExceptionDecoratorTestCase.class)); >+ addTest(new TestSuite(ExceptionDecoratorErrorHandlingTest.class)); > addTest(new TestSuite(DecoratorTestCase.class)); > addTest(new TestSuite(LightweightDecoratorTestCase.class)); > addTest(new TestSuite(BadIndexDecoratorTestCase.class)); >Index: Eclipse UI Tests/org/eclipse/ui/tests/statushandlers/StatusDialogUtil.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/statushandlers/StatusDialogUtil.java,v >retrieving revision 1.1 >diff -u -r1.1 StatusDialogUtil.java >--- Eclipse UI Tests/org/eclipse/ui/tests/statushandlers/StatusDialogUtil.java 25 Apr 2008 18:01:26 -0000 1.1 >+++ Eclipse UI Tests/org/eclipse/ui/tests/statushandlers/StatusDialogUtil.java 17 Oct 2008 09:43:47 -0000 >@@ -142,6 +142,9 @@ > > public static Table getTable(){ > Composite c = getListAreaComposite(); >+ if(c == null){ >+ return null; >+ } > if(c.getChildren().length == 0){ > return null; > } >Index: Eclipse UI Tests/org/eclipse/ui/tests/decorators/ExceptionDecoratorErrorHandlingTest.java >=================================================================== >RCS file: Eclipse UI Tests/org/eclipse/ui/tests/decorators/ExceptionDecoratorErrorHandlingTest.java >diff -N Eclipse UI Tests/org/eclipse/ui/tests/decorators/ExceptionDecoratorErrorHandlingTest.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ Eclipse UI Tests/org/eclipse/ui/tests/decorators/ExceptionDecoratorErrorHandlingTest.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,135 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.ui.tests.decorators; >+ >+import java.util.ArrayList; >+import java.util.Collection; >+ >+import org.eclipse.core.runtime.OperationCanceledException; >+import org.eclipse.core.runtime.jobs.Job; >+import org.eclipse.jface.dialogs.ErrorDialog; >+import org.eclipse.jface.viewers.ILabelProviderListener; >+import org.eclipse.jface.viewers.LabelProviderChangedEvent; >+import org.eclipse.osgi.util.NLS; >+import org.eclipse.swt.widgets.Display; >+import org.eclipse.ui.internal.WorkbenchMessages; >+import org.eclipse.ui.internal.WorkbenchPlugin; >+import org.eclipse.ui.internal.decorators.DecoratorDefinition; >+import org.eclipse.ui.internal.decorators.DecoratorManager; >+import org.eclipse.ui.tests.navigator.AbstractNavigatorTest; >+import org.eclipse.ui.tests.statushandlers.StatusDialogUtil; >+ >+/** >+ * @version 1.0 >+ */ >+public class ExceptionDecoratorErrorHandlingTest extends AbstractNavigatorTest >+ implements ILabelProviderListener { >+ >+ protected DecoratorDefinition definition; >+ >+ protected boolean updated = false; >+ >+ private Collection problemDecorators = new ArrayList(); >+ >+ private DecoratorDefinition light; >+ >+ /** >+ * Constructor for DecoratorTestCase. >+ * @param testName >+ */ >+ public ExceptionDecoratorErrorHandlingTest(String testName) { >+ super(testName); >+ } >+ >+ /** >+ * Sets up the hierarchy. >+ */ >+ protected void doSetUp() throws Exception { >+ ErrorDialog.AUTOMATED_MODE = false; >+ super.doSetUp(); >+ createTestFile(); >+ showNav(); >+ >+ WorkbenchPlugin.getDefault().getDecoratorManager().addListener(this); >+ >+ //reset the static fields so that the decorators will fail >+ HeavyNullImageDecorator.fail = true; >+ HeavyNullTextDecorator.fail = true; >+ NullImageDecorator.fail = true; >+ DecoratorDefinition[] definitions = WorkbenchPlugin.getDefault() >+ .getDecoratorManager().getAllDecoratorDefinitions(); >+ for (int i = 0; i < definitions.length; i++) { >+ String id = definitions[i].getId(); >+ if (id.equals("org.eclipse.ui.tests.heavyNullImageDecorator") >+ || id.equals("org.eclipse.ui.tests.heavyNullTextDecorator")) { >+ definitions[i].setEnabled(true); >+ problemDecorators.add(definitions[i]); >+ } >+ >+ //Do not cache the light one - the disabling issues >+ //still need to be worked out. >+ if (id.equals("org.eclipse.ui.tests.lightNullImageDecorator")) { >+ definitions[i].setEnabled(true); >+ light = definitions[i]; >+ } >+ } >+ } /* (non-Javadoc) >+ * @see org.eclipse.ui.tests.navigator.LightweightDecoratorTestCase#doTearDown() >+ */ >+ >+ protected void doTearDown() throws Exception { >+ super.doTearDown(); >+ ErrorDialog.AUTOMATED_MODE = true; >+ if(StatusDialogUtil.getStatusShell() == null){ >+ StatusDialogUtil.getStatusShell().dispose(); >+ } >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.viewers.ILabelProviderListener#labelProviderChanged(org.eclipse.jface.viewers.LabelProviderChangedEvent) >+ */ >+ public void labelProviderChanged( >+ LabelProviderChangedEvent event) { >+ updated = true; >+ >+ } >+ >+ public void testStatusHandlingDialog() { >+ // Need to wait for decoration to end to allow for all >+ // errors to occur >+ try { >+ Job.getJobManager().join(DecoratorManager.FAMILY_DECORATE, null); >+ } catch (OperationCanceledException e) { >+ } catch (InterruptedException e) { >+ } >+ int count1 = 50; >+ while(StatusDialogUtil.getStatusShell() == null && count1-- != 0){ >+ Display.getDefault().readAndDispatch(); >+ Thread.yield(); >+ } >+ // be sure that dialog was displayed >+ assertTrue(count1 > 0); >+ >+ int count2 = 50; >+ while (StatusDialogUtil.getTable() == null && count2-- != 0) { >+ Display.getDefault().readAndDispatch(); >+ Thread.yield(); >+ } >+ // be sure that more than one status was reported >+ assertTrue(count2 > 0); >+ String message = StatusDialogUtil.getTable().getItem(0).getText(); >+ String pattern = WorkbenchMessages.DecoratorError + " " >+ + NLS.bind(WorkbenchMessages.DecoratorWillBeDisabled, ".*"); >+ assertTrue(message.matches(pattern)); >+ // Turnoff the lightweight one so as not to clutter the methods. >+ light.setEnabled(false); >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 107753
:
110346
|
115371
|
115915
|
120456
|
120545