当前位置: 首页>>代码示例>>Java>>正文


Java HashTree.getTree方法代码示例

本文整理汇总了Java中org.apache.jorphan.collections.HashTree.getTree方法的典型用法代码示例。如果您正苦于以下问题:Java HashTree.getTree方法的具体用法?Java HashTree.getTree怎么用?Java HashTree.getTree使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.jorphan.collections.HashTree的用法示例。


在下文中一共展示了HashTree.getTree方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getProperBranch

import org.apache.jorphan.collections.HashTree; //导入方法依赖的package包/类
/**
 * Extract from tree (included test plan) all Test Elements located in a Test Fragment
 * @param tree HashTree included Test Plan
 * @return HashTree Subset within Test Fragment or Empty HashTree
 */
private HashTree getProperBranch(HashTree tree) {
    for (Object o : new LinkedList<>(tree.list())) {
        TestElement item = (TestElement) o;

        //if we found a TestPlan, then we are on our way to the TestFragment
        if (item instanceof TestPlan)
        {
            return getProperBranch(tree.getTree(item));
        }

        if (item instanceof TestFragmentController)
        {
            return tree.getTree(item);
        }
    }
    log.warn("No Test Fragment was found in included Test Plan, returning empty HashTree");
    return new HashTree();
}
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:24,代码来源:IncludeController.java

示例2: addSubTree

import org.apache.jorphan.collections.HashTree; //导入方法依赖的package包/类
/**
 * Adds the sub tree at the given node. Returns a boolean indicating whether
 * the added sub tree was a full test plan.
 */
public HashTree addSubTree(HashTree subTree, ReportTreeNode current)
        throws IllegalUserActionException {
    Iterator<Object> iter = subTree.list().iterator();
    while (iter.hasNext()) {
        TestElement item = (TestElement) iter.next();
        if (item instanceof ReportPlan) {
            current = (ReportTreeNode) ((ReportTreeNode) getRoot())
                    .getChildAt(0);
            ((TestElement) current.getUserObject()).addTestElement(item);
            ((ReportPlan) current.getUserObject()).setName(item.getName());
            addSubTree(subTree.getTree(item), current);
        } else {
            if (subTree.getTree(item) != null) {
                addSubTree(subTree.getTree(item), addComponent(item, current));
            }
        }
    }
    return getCurrentSubTree(current);
}
 
开发者ID:botelhojp,项目名称:apache-jmeter-2.10,代码行数:24,代码来源:ReportTreeModel.java

示例3: getProperBranch

import org.apache.jorphan.collections.HashTree; //导入方法依赖的package包/类
/**
 * Extract from tree (included test plan) all Test Elements located in a Test Fragment
 * @param tree HashTree included Test Plan
 * @return HashTree Subset within Test Fragment or Empty HashTree
 */
private HashTree getProperBranch(HashTree tree) {
    Iterator<Object> iter = new LinkedList<Object>(tree.list()).iterator();
    while (iter.hasNext()) {
        TestElement item = (TestElement) iter.next();

        //if we found a TestPlan, then we are on our way to the TestFragment
        if (item instanceof TestPlan)
        {
            return getProperBranch(tree.getTree(item));
        }

        if (item instanceof TestFragmentController)
        {
            return tree.getTree(item);
        }
    }
    log.warn("No Test Fragment was found in included Test Plan, returning empty HashTree");
    return new HashTree();
}
 
开发者ID:botelhojp,项目名称:apache-jmeter-2.10,代码行数:25,代码来源:IncludeController.java

示例4: testTreeConversion

import org.apache.jorphan.collections.HashTree; //导入方法依赖的package包/类
public void testTreeConversion() throws Exception {
    HashTree tree = new ListedHashTree();
    JMeterTreeNode root = new JMeterTreeNode(new Arguments(), null);
    tree.add(root, root);
    tree.getTree(root).add(root, root);
    save.convertSubTree(tree);
    assertEquals(tree.getArray()[0].getClass().getName(), root.getTestElement().getClass().getName());
    tree = tree.getTree(tree.getArray()[0]);
    assertEquals(tree.getArray()[0].getClass().getName(), root.getTestElement().getClass().getName());
    assertEquals(tree.getTree(tree.getArray()[0]).getArray()[0].getClass().getName(), root.getTestElement()
            .getClass().getName());
}
 
开发者ID:botelhojp,项目名称:apache-jmeter-2.10,代码行数:13,代码来源:TestSave.java


注:本文中的org.apache.jorphan.collections.HashTree.getTree方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。