本文整理汇总了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();
}
示例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);
}
示例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();
}
示例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());
}