mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-30 08:04:38 +00:00
junit
This commit is contained in:
parent
844915e935
commit
c15b263b90
@ -28,13 +28,11 @@ import org.junit.Test;
|
||||
|
||||
import docking.DockingWindowManager;
|
||||
import docking.test.AbstractDockingTest;
|
||||
import docking.widgets.filter.FilterTextField;
|
||||
import ghidra.test.DummyTool;
|
||||
|
||||
public class GTreeEventTest extends AbstractDockingTest {
|
||||
|
||||
private GTree gTree;
|
||||
private FilterTextField filterField;
|
||||
|
||||
private DockingWindowManager winMgr;
|
||||
|
||||
@ -46,7 +44,7 @@ public class GTreeEventTest extends AbstractDockingTest {
|
||||
root = new TestRootNode();
|
||||
gTree = new GTree(root);
|
||||
gTree.getModel().addTreeModelListener(new TestTreeModelListener());
|
||||
filterField = (FilterTextField) gTree.getFilterField();
|
||||
// filterField = (FilterTextField) gTree.getFilterField();
|
||||
|
||||
winMgr = new DockingWindowManager(new DummyTool(), null);
|
||||
winMgr.addComponent(new TestTreeComponentProvider(gTree));
|
||||
@ -60,7 +58,7 @@ public class GTreeEventTest extends AbstractDockingTest {
|
||||
root.addNode(new LeafNode("ABC"));
|
||||
assertEquals(1, events.size());
|
||||
TreeEvent treeEvent = events.get(0);
|
||||
assertEquals(EventType.STRUCTURE_CHANGED, treeEvent.eventType);
|
||||
assertEquals(EventType.INSERTED, treeEvent.eventType);
|
||||
}
|
||||
|
||||
private void waitForTree() {
|
||||
|
@ -543,7 +543,13 @@ public class GTreeTest extends AbstractDockingTest {
|
||||
|
||||
List<TreePath> expandedPaths = gTree.getExpandedPaths();
|
||||
assertEquals(3, expandedPaths.size());
|
||||
assertEquals(originalNode, expandedPaths.get(0).getLastPathComponent());
|
||||
|
||||
// make sure one of the expanded paths contains the originalNode
|
||||
TreePath path = expandedPaths.parallelStream()
|
||||
.filter(p -> p.getLastPathComponent().equals(originalNode))
|
||||
.findAny()
|
||||
.orElse(null);
|
||||
assertTrue(path != null);
|
||||
|
||||
GTreeState treeState = gTree.getTreeState();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user