1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 23:25:26 +02:00

updating test suite with invalidation of filters + new 170728 bug test

This commit is contained in:
David McKnight 2007-01-26 17:12:52 +00:00
parent 6cd80af8ef
commit 9e29b10366

View file

@ -10,17 +10,23 @@
*******************************************************************************/
package org.eclipse.rse.tests.subsystems.testsubsystem;
import java.util.Vector;
import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.rse.core.SystemPerspectiveHelpers;
import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.tests.RSETestsPlugin;
import org.eclipse.rse.tests.core.RSEWaitAndDispatchUtil;
import org.eclipse.rse.tests.core.connection.RSEBaseConnectionTestCase;
import org.eclipse.rse.tests.testsubsystem.TestSubSystemContainerNode;
import org.eclipse.rse.tests.testsubsystem.TestSubSystemNode;
import org.eclipse.rse.tests.testsubsystem.interfaces.ITestSubSystem;
import org.eclipse.rse.ui.RSEUIPlugin;
public class TestSubsystemTestCase extends RSEBaseConnectionTestCase {
private ITestSubSystem testSubSystem;
@ -53,7 +59,9 @@ public class TestSubsystemTestCase extends RSEBaseConnectionTestCase {
assertNotNull("No test subystem", testSubSystem); //$NON-NLS-1$
testSubSystem.removeAllChildNodes();
ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
registry.invalidateFiltersFor(testSubSystem);
TestSubSystemContainerNode firstNode = null;
TestSubSystemContainerNode node = null;
for (int i=0; i<100; i++) {
@ -87,7 +95,8 @@ public class TestSubsystemTestCase extends RSEBaseConnectionTestCase {
assertEquals("wrong item selected", node, structSel.getFirstElement()); //$NON-NLS-1$
testSubSystem.removeAllChildNodes();
registry.invalidateFiltersFor(testSubSystem);
SystemPerspectiveHelpers.findRSEView().refresh(testSubSystem);
RSEWaitAndDispatchUtil.waitAndDispatch(1000);
@ -99,4 +108,57 @@ public class TestSubsystemTestCase extends RSEBaseConnectionTestCase {
structSel = (IStructuredSelection)selection;
assertEquals("invalid number of selected items", 0, structSel.size()); //$NON-NLS-1$
}
public void testBugzilla170728() {
IHost connection = getLocalSystemConnection();
assertNotNull("Failed to get local system connection", connection); //$NON-NLS-1$
Exception exception = null;
String cause = null;
testSubSystem = null;
try {
testSubSystem = getConnectionManager().getTestSubSystem(connection);
} catch(Exception e) {
exception = e;
cause = e.getLocalizedMessage();
}
assertNull("Failed to get test subsystem! Possible cause: " + cause, exception); //$NON-NLS-1$
assertNotNull("No test subystem", testSubSystem); //$NON-NLS-1$
RSEUIPlugin.getTheSystemRegistry().invalidateFiltersFor(testSubSystem);
SystemPerspectiveHelpers.findRSEView().refresh(testSubSystem);
RSEWaitAndDispatchUtil.waitAndDispatch(1000);
SystemPerspectiveHelpers.findRSEView().expandToLevel(testSubSystem, AbstractTreeViewer.ALL_LEVELS);
RSEWaitAndDispatchUtil.waitAndDispatch(1000);
ISystemFilterPoolManager mgr = testSubSystem.getFilterPoolReferenceManager().getDefaultSystemFilterPoolManager();
Vector strings = new Vector();
strings.add("Node.*"); //$NON-NLS-1$
try {
mgr.createSystemFilter(mgr.getFirstDefaultSystemFilterPool(), "Node*", strings, "Node*"); //$NON-NLS-1$ //$NON-NLS-2$
TestSubSystemNode node = new TestSubSystemNode("Node 1"); //$NON-NLS-1$
testSubSystem.addChildNode(node);
testSubSystem.addChildNode(new TestSubSystemNode("Node 2")); //$NON-NLS-1$
testSubSystem.addChildNode(new TestSubSystemNode("Node 3")); //$NON-NLS-1$
testSubSystem.addChildNode(new TestSubSystemNode("Node 4")); //$NON-NLS-1$
RSEUIPlugin.getTheSystemRegistry().invalidateFiltersFor(testSubSystem);
SystemPerspectiveHelpers.findRSEView().refresh(testSubSystem);
RSEWaitAndDispatchUtil.waitAndDispatch(1000);
SystemPerspectiveHelpers.findRSEView().expandToLevel(testSubSystem, AbstractTreeViewer.ALL_LEVELS);
SystemPerspectiveHelpers.findRSEView().refresh(testSubSystem);
RSEWaitAndDispatchUtil.waitAndDispatch(1000);
node.setName("Node 1 (changed)"); //$NON-NLS-1$
SystemPerspectiveHelpers.findRSEView().refresh(node);
RSEWaitAndDispatchUtil.waitAndDispatch(10000);
}
catch (Exception e) {
assertNull(e.getMessage(), e);
}
}
}