MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / buildTestBranch

Method buildTestBranch

test/tree/TestBranch.java:538–562  ·  view source on GitHub ↗

Helper to build a default branch for testing @return A branch with some child branches and leaves

(final Tree tree)

Source from the content-addressed store, hash-verified

536 * @return A branch with some child branches and leaves
537 */
538 public static Branch buildTestBranch(final Tree tree) {
539 final TreeMap<Integer, String> root_path = new TreeMap<Integer, String>();
540 final Branch root = new Branch(tree.getTreeId());
541 root.setDisplayName("ROOT");
542 root_path.put(0, "ROOT");
543 root.prependParentPath(root_path);
544
545 Branch child = new Branch(1);
546 child.prependParentPath(root_path);
547 child.setDisplayName("System");
548 root.addChild(child);
549
550 child = new Branch(tree.getTreeId());
551 child.prependParentPath(root_path);
552 child.setDisplayName("Network");
553 root.addChild(child);
554
555 Leaf leaf = new Leaf("Alarms", "ABCD");
556 root.addLeaf(leaf, tree);
557
558 leaf = new Leaf("Employees in Office", "EF00");
559 root.addLeaf(leaf, tree);
560
561 return root;
562 }
563
564 /**
565 * Mocks classes for testing the storage calls

Callers 15

copyConstructorMethod · 0.95
testHashCodeMethod · 0.95
testEqualsMethod · 0.95
equalsSameAddressMethod · 0.95
equalsNullMethod · 0.95
equalsWrongClassMethod · 0.95
compareToMethod · 0.95
compareToLessMethod · 0.95
compareToGreaterMethod · 0.95
getBranchIdRootMethod · 0.95
getBranchIdChildMethod · 0.95
addChildMethod · 0.95

Calls 6

setDisplayNameMethod · 0.95
prependParentPathMethod · 0.95
addChildMethod · 0.95
addLeafMethod · 0.95
putMethod · 0.80
getTreeIdMethod · 0.45

Tested by

no test coverage detected