import org.netbeans.jellytools.modules.vcscore.VCSGroupsFrameOperator; import org.netbeans.jellytools.modules.vcsgeneric.actions.VCSGroupsAction; import org.netbeans.jellytools.nodes.Node; import org.netbeans.jemmy.operators.JTreeOperator; public class VCSGroupError { public static void main(String[] args) { new VCSGroupsAction ().perform (); VCSGroupsFrameOperator vgf = new VCSGroupsFrameOperator (); String g; g = "GroupToRemove"; vgf.addVCSGroup(g); new Node (vgf.treeVCSGroupsTreeView (), g); vgf.removeVCSGroup(g); waitNoNode(vgf.treeVCSGroupsTreeView (), "", g); g = "FailingGroup"; // g = "GroupThatWillNotBeCreated"; vgf.addVCSGroup(g); new Node (vgf.treeVCSGroupsTreeView (), g); } public static void waitNoNode (JTreeOperator tree, String parent, String node) { Node par = new Node (tree, parent); for (int a = 0; a < 30; a ++) { String[] strs = par.getChildren(); if (strs != null) { boolean found = false; for (int b = 0; b < strs.length; b ++) if (strs[b].indexOf (node) >= 0) { found = true; break; } if (!found) return; } try { Thread.sleep(1000); } catch (Exception e) {} } // still exists } }