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 127804 Details for
Bug 194917
stack overflow error from working set management
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]
save-restore free workingset
patch_test_free_Wset.txt (text/plain), 9.60 KB, created by
Hitesh
on 2009-03-06 07:21:32 EST
(
hide
)
Description:
save-restore free workingset
Filename:
MIME Type:
Creator:
Hitesh
Created:
2009-03-06 07:21:32 EST
Size:
9.60 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.tests >Index: Eclipse UI Tests/org/eclipse/ui/tests/api/IAggregateWorkingSetTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/IAggregateWorkingSetTest.java,v >retrieving revision 1.1 >diff -u -r1.1 IAggregateWorkingSetTest.java >--- Eclipse UI Tests/org/eclipse/ui/tests/api/IAggregateWorkingSetTest.java 23 Jan 2009 18:09:25 -0000 1.1 >+++ Eclipse UI Tests/org/eclipse/ui/tests/api/IAggregateWorkingSetTest.java 6 Mar 2009 11:59:24 -0000 >@@ -1,103 +1,136 @@ >-/******************************************************************************* >- * Copyright (c) 2000, 2008 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.api; >- >-import org.eclipse.core.resources.IWorkspace; >-import org.eclipse.core.resources.ResourcesPlugin; >-import org.eclipse.core.runtime.IAdaptable; >-import org.eclipse.ui.IAggregateWorkingSet; >-import org.eclipse.ui.IMemento; >-import org.eclipse.ui.IWorkingSet; >-import org.eclipse.ui.IWorkingSetManager; >-import org.eclipse.ui.XMLMemento; >-import org.eclipse.ui.internal.IWorkbenchConstants; >-import org.eclipse.ui.tests.harness.util.ArrayUtil; >-import org.eclipse.ui.tests.harness.util.UITestCase; >- >-public class IAggregateWorkingSetTest extends UITestCase { >- >- final static String WORKING_SET_NAME = "testws"; >- final static String AGGREGATE_WORKING_SET_NAME_ = "testaggregatews"; >- >- IWorkspace fWorkspace; >- >- IWorkingSet[] components; >- IAggregateWorkingSet fWorkingSet; >- >- public IAggregateWorkingSetTest(String testName) { >- super(testName); >- } >- >- protected void doSetUp() throws Exception { >- super.doSetUp(); >- IWorkingSetManager workingSetManager = fWorkbench >- .getWorkingSetManager(); >- >- fWorkspace = ResourcesPlugin.getWorkspace(); >- components = new IWorkingSet[4]; >- for (int i = 0; i < 4; i++) { >- components[i] = workingSetManager.createWorkingSet(WORKING_SET_NAME >- + i, new IAdaptable[] {}); >- workingSetManager.addWorkingSet(components[i]); >- } >- fWorkingSet = (IAggregateWorkingSet) workingSetManager >- .createAggregateWorkingSet(AGGREGATE_WORKING_SET_NAME_, >- AGGREGATE_WORKING_SET_NAME_, components); >- >- workingSetManager.addWorkingSet(fWorkingSet); >- } >- protected void doTearDown() throws Exception { >- IWorkingSetManager workingSetManager = fWorkbench.getWorkingSetManager(); >- workingSetManager.removeWorkingSet(fWorkingSet); >- for (int i = 0; i < components.length; i++) { >- workingSetManager.removeWorkingSet(components[i]); >- } >- super.doTearDown(); >- } >- >- public void testSaveWSet() throws Throwable { >- //<possible client code> >- IWorkingSetManager workingSetManager = fWorkbench >- .getWorkingSetManager(); >- IWorkingSet set=workingSetManager.getWorkingSet(AGGREGATE_WORKING_SET_NAME_); >- if(set.isAggregateWorkingSet()){ >- IWorkingSet[] sets=((IAggregateWorkingSet)set).getComponents(); >- if(sets.length>=1){ >- sets[0]=null; //client fails to pay enough attention to specs or unknowingly does this >- } >- } >- //</possible client code> >- //error makes it look like it comes from workingsets api, with no clue about the actual culprit >- IMemento memento=XMLMemento.createWriteRoot(IWorkbenchConstants.TAG_WORKING_SET); >- set.saveState(memento); >- } >- public void testGetElemets() throws Throwable { >- //<possible client code> >- IWorkingSetManager workingSetManager = fWorkbench >- .getWorkingSetManager(); >- IWorkingSet set=workingSetManager.getWorkingSet(AGGREGATE_WORKING_SET_NAME_); >- if(set.isAggregateWorkingSet()){ >- IWorkingSet[] sets=((IAggregateWorkingSet)set).getComponents(); >- if(sets.length>1){ >- //code 2 fails to pay enough attention to specs or unknowingly does this >- sets[0]=workingSetManager.createWorkingSet(WORKING_SET_NAME, new IAdaptable[] { fWorkspace.getRoot() }); >- //code 1 part removes a workingset >- workingSetManager.removeWorkingSet(sets[1]); >- } >- } >- //</possible client code> >- >- //unexpected >- assertTrue(ArrayUtil.equals( >- new IAdaptable[] {}, >- fWorkingSet.getElements())); >- } >-} >+/******************************************************************************* >+ * Copyright (c) 2000, 2008 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.api; >+ >+import org.eclipse.core.resources.IWorkspace; >+import org.eclipse.core.resources.ResourcesPlugin; >+import org.eclipse.core.runtime.IAdaptable; >+import org.eclipse.ui.IAggregateWorkingSet; >+import org.eclipse.ui.IMemento; >+import org.eclipse.ui.IWorkingSet; >+import org.eclipse.ui.IWorkingSetManager; >+import org.eclipse.ui.XMLMemento; >+import org.eclipse.ui.internal.IWorkbenchConstants; >+import org.eclipse.ui.tests.harness.util.ArrayUtil; >+import org.eclipse.ui.tests.harness.util.UITestCase; >+ >+public class IAggregateWorkingSetTest extends UITestCase { >+ >+ final static String WORKING_SET_NAME = "testws"; >+ final static String AGGREGATE_WORKING_SET_NAME_ = "testaggregatews"; >+ >+ IWorkspace fWorkspace; >+ >+ IWorkingSet[] components; >+ IAggregateWorkingSet fWorkingSet; >+ >+ public IAggregateWorkingSetTest(String testName) { >+ super(testName); >+ } >+ >+ protected void doSetUp() throws Exception { >+ super.doSetUp(); >+ IWorkingSetManager workingSetManager = fWorkbench >+ .getWorkingSetManager(); >+ >+ fWorkspace = ResourcesPlugin.getWorkspace(); >+ components = new IWorkingSet[4]; >+ for (int i = 0; i < 4; i++) { >+ components[i] = workingSetManager.createWorkingSet(WORKING_SET_NAME >+ + i, new IAdaptable[] {}); >+ workingSetManager.addWorkingSet(components[i]); >+ } >+ fWorkingSet = (IAggregateWorkingSet) workingSetManager >+ .createAggregateWorkingSet(AGGREGATE_WORKING_SET_NAME_, >+ AGGREGATE_WORKING_SET_NAME_, components); >+ >+ workingSetManager.addWorkingSet(fWorkingSet); >+ } >+ protected void doTearDown() throws Exception { >+ IWorkingSetManager workingSetManager = fWorkbench.getWorkingSetManager(); >+ workingSetManager.removeWorkingSet(fWorkingSet); >+ for (int i = 0; i < components.length; i++) { >+ workingSetManager.removeWorkingSet(components[i]); >+ } >+ super.doTearDown(); >+ } >+ >+ public void testSaveWSet() throws Throwable { >+ //<possible client code> >+ IWorkingSetManager workingSetManager = fWorkbench >+ .getWorkingSetManager(); >+ IWorkingSet set=workingSetManager.getWorkingSet(AGGREGATE_WORKING_SET_NAME_); >+ if(set.isAggregateWorkingSet()){ >+ IWorkingSet[] sets=((IAggregateWorkingSet)set).getComponents(); >+ if(sets.length>=1){ >+ sets[0]=null; //client fails to pay enough attention to specs or unknowingly does this >+ } >+ } >+ //</possible client code> >+ //error makes it look like it comes from workingsets api, with no clue about the actual culprit >+ IMemento memento=XMLMemento.createWriteRoot(IWorkbenchConstants.TAG_WORKING_SET); >+ set.saveState(memento); >+ } >+ public void testGetElemets() throws Throwable { >+ //<possible client code> >+ IWorkingSetManager workingSetManager = fWorkbench >+ .getWorkingSetManager(); >+ IWorkingSet set=workingSetManager.getWorkingSet(AGGREGATE_WORKING_SET_NAME_); >+ if(set.isAggregateWorkingSet()){ >+ IWorkingSet[] sets=((IAggregateWorkingSet)set).getComponents(); >+ if(sets.length>1){ >+ //code 2 fails to pay enough attention to specs or unknowingly does this >+ sets[0]=workingSetManager.createWorkingSet(WORKING_SET_NAME, new IAdaptable[] { fWorkspace.getRoot() }); >+ //code 1 part removes a workingset >+ workingSetManager.removeWorkingSet(sets[1]); >+ } >+ } >+ //</possible client code> >+ >+ //unexpected >+ assertTrue(ArrayUtil.equals( >+ new IAdaptable[] {}, >+ fWorkingSet.getElements())); >+ } >+ >+ >+ public void testSaveRestoreFreeWorkingSet() throws Throwable { >+ IWorkingSetManager manager = fWorkbench.getWorkingSetManager(); >+ >+ IWorkingSet freeWorkingSet = manager.createWorkingSet("containing", >+ new IAdaptable[] { fWorkspace.getRoot() }); >+ >+ IAggregateWorkingSet containing = (IAggregateWorkingSet) manager >+ .createAggregateWorkingSet("container", "container", >+ new IWorkingSet[] { freeWorkingSet }); >+ >+ assertTrue(ArrayUtil.equals(new IAdaptable[] { fWorkspace.getRoot() }, >+ containing.getElements())); >+ >+ IMemento memento = XMLMemento >+ .createWriteRoot(IWorkbenchConstants.TAG_WORKING_SET); >+ containing.saveState(memento); >+ >+ // load the IMemento >+ IAggregateWorkingSet aggregateReloaded = (IAggregateWorkingSet) manager >+ .createWorkingSet(memento); >+ manager.addWorkingSet(aggregateReloaded); >+ try { >+ assertTrue(ArrayUtil.equals( >+ new IAdaptable[] { fWorkspace.getRoot() }, >+ aggregateReloaded.getElements())); >+ } finally { >+ // restore >+ manager.removeWorkingSet(aggregateReloaded); >+ } >+ } >+ >+}
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 194917
:
100844
|
127554
|
127694
| 127804