/** * Verifies if the selected node underneath <code>treePath</code> at column <code>column</code> * has a rendered text which is equal to <code>selection</code>. * * @param pattern the pattern * @param operator The operator to use when comparing the expected and actual values. * @param column the column or column path of the item to select * @param colOperator the operator for the column path * @throws StepExecutionException If there is no tree node selected, the tree path contains no * selection or the verification fails */ public void rcVerifySelectedValueAtPath( String pattern, String operator, String column, String colOperator) throws StepExecutionException { TreeTableOperationContext context = getContext(); final int implCol = context.getColumnFromString(column, colOperator, true); checkColumnIndex(implCol); context.setColumn(implCol); String text = context.getRenderedTextOfColumn(context.getSelectedNode()); Verifier.match(text, pattern, operator); }
/** * Verifies if the selected node underneath <code>treePath</code> at column <code>column</code> * has a rendered text which is equal to <code>selection</code>. * * @param pattern the pattern * @param operator The operator to use when comparing the expected and actual values. * @param column The column containing the text to verify * @throws StepExecutionException If there is no tree node selected, the tree path contains no * selection or the verification fails */ public void rcVerifySelectedValue(String pattern, String operator, int column) throws StepExecutionException { final int implCol = IndexConverter.toImplementationIndex(column); checkColumnIndex(implCol); TreeTableOperationContext context = getContext(); context.setColumn(implCol); String text = context.getRenderedTextOfColumn(context.getSelectedNode()); Verifier.match(text, pattern, operator); }
/** * Traverses the tree by searching for the nodes in the tree path entry and calling the given * operation on the last element in the path. * * @param treePath The tree path. * @param pathType For example, "relative" or "absolute". * @param preAscend Relative traversals will start this many parent nodes above the current node. * Absolute traversals ignore this parameter. * @param operation The tree node operation. * @param column The target column for the operation. * @throws StepExecutionException If the path traversal fails. */ private void traverseLastElementByPath( INodePath treePath, String pathType, int preAscend, TreeNodeOperation operation, int column) throws StepExecutionException { Validate.notNull(treePath); Validate.notNull(operation); TreeTableOperationContext context = getContext(); context.setColumn(column); TreeItem<?> startNode = (TreeItem<?>) getStartNode(pathType, preAscend, context); AbstractTreeNodeTraverser traverser = new PathBasedTraverser(context, treePath, new TreeNodeOperationConstraint()); traverser.traversePath(operation, startNode); }