Helper to build a default branch for testing @return A branch with some child branches and leaves
(final Tree tree)
| 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 |
no test coverage detected